Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
quicksort set
#5
Quote:1) put your code in order. What I mean is, don't perform a function that's not really needed for another 100 lines. Examples include...CLS as first line of code...why is this here? Is this really the first thing the program does? It looks to me like it creates the arrays firs? Why not call RANDOMIZE TIMER just before the first call to RND? If you do this, then each line is much easier to understand, since it appears in the proper context of the program.

Standard procedure. CLS and RANDOMIZE TIMER go first. Easy to find. The rest follows. What if I wanted to remove everything and try some other sort or PRINT statement? I wouldn't have to retype CLS and RANDOMIZE TIMER, then.

Quote:2) Learn to block indent with spaces between blocks.

There is nothing to learn. Indentation is unnecessary. AGAIN, code isn't meant to be skipped through as some sort of long, boring, arduous literature book that one has no interest in reading, with the spaces and comments meant to highlight "the good parts". The sample code is really quite simple...

Quote: 3) use a *few* comments.

Again, unnecessary.. maybe it would be necessary if the code consisted of strange functions that aren't immediately apparent.

Quote:4) This is really important...stop using period as a seperator in variable/function names. It makes it look like you are using nested types (are those possible in QB??)

Again, using periods as separators when they're not TYPEs isn't bad. QB also supports line numbers and GOTO statements, and it supports TYPEs. So you can't say that it's bad just because "i look like" I'm doing something.

Besides, what's easier to do -- dot or SHIFT+capital letter? Dot. One hand. And, less error-prone.

Quote:I believe the advantages of doing this are 3-fold. 1) your code would be easy to read/understand, and therefore others might be willing to criticize the code itself, rather than always being blinded with it's incomprehensibility2)you would get more constructive criticism whereby you could learn/interact more with those who might otherwise be willing to understand your work3)you might become a better programmer who can handle larger, more complex projects as you become more organized.

I don't think so. 1), I don't need anyone to criticize my code. 2) I don't *need* people to understand anything about "my work", if they can't read it, they can just use it anyways... (see 1) 3) I *am* organized, and my coding style is a testament to this. However I'm impatient, and the amount of dead games that I started but never finished leaves a blazing trail behind me as I walk.

Quote:Edit::: As an example of why to block indent...the last line of code is Next i%...The first thing I did was look what this variable was...and I see the first meat of your code is a FOR i% loop, and I said-A-Ha!!!...but alas, I was wrong

Which is exactly why Internet Explorer is so vulnerable. There are no easy ways out of reading code. Forget indentation. NOW.

PS: You just might get an error when running that code 'cuz Arraysize isn't an integer...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Messages In This Thread
quicksort set - by Agamemnus - 11-22-2003, 11:46 PM
quicksort set - by relsoft - 11-23-2003, 01:03 PM
quicksort set - by Agamemnus - 11-23-2003, 08:27 PM
quicksort set - by Mango - 12-19-2003, 09:36 PM
quicksort set - by Agamemnus - 12-19-2003, 10:48 PM
quicksort set - by Mango - 12-19-2003, 11:07 PM
quicksort set - by Agamemnus - 12-20-2003, 08:52 AM
quicksort set - by adosorken - 12-20-2003, 09:04 AM
quicksort set - by Agamemnus - 12-20-2003, 09:23 AM
quicksort set - by adosorken - 12-20-2003, 09:32 AM
quicksort set - by Mango - 12-20-2003, 09:46 AM
quicksort set - by adosorken - 12-20-2003, 06:07 PM
quicksort set - by Agamemnus - 12-20-2003, 08:56 PM
quicksort set - by Agamemnus - 06-03-2005, 07:37 PM
quicksort set - by Torahteen - 06-03-2005, 08:01 PM
quicksort set - by Agamemnus - 06-03-2005, 10:15 PM
quicksort set - by Torahteen - 06-03-2005, 10:44 PM
quicksort set - by Agamemnus - 06-03-2005, 10:51 PM
quicksort set - by Moneo - 06-03-2005, 11:17 PM
quicksort set - by Torahteen - 06-04-2005, 01:04 AM
quicksort set - by Agamemnus - 06-04-2005, 01:14 AM
quicksort set - by TheBigBasicQ - 06-07-2005, 01:35 AM
quicksort set - by Agamemnus - 06-10-2005, 06:50 PM
quicksort set - by Agamemnus - 06-10-2005, 09:43 PM
quicksort set - by Ralph - 06-14-2005, 08:21 PM
quicksort set - by MystikShadows - 06-14-2005, 11:23 PM
quicksort set - by SBM Productions - 07-13-2005, 10:22 PM
quicksort set - by Ralph - 07-14-2005, 03:48 AM
quicksort set - by Moneo - 07-15-2005, 11:50 PM
quicksort set - by rpgfan3233 - 07-16-2005, 01:31 AM
quicksort set - by yetifoot - 12-07-2005, 08:40 AM
quicksort set - by Agamemnus - 12-07-2005, 10:01 AM
quicksort set - by Ralph - 12-07-2005, 08:29 PM
quicksort set - by Mango - 12-08-2005, 06:21 AM
quicksort set - by Agamemnus - 12-09-2005, 04:53 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)