Put the knife down and take a green herb, dude.
One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com
Using 89% of the same design the blog had in 2001.
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.
MarkUpDown is the best Markdown editor for professionals on Windows 10.
It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.
Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor.
Stop looking. MarkUpDown is the app you're looking for.
|Tuesday, November 11, 2003|
It's about time I put my foot down. Programmers that say not to use While... Wend loops in VB6 are smoking the wacky weed. (here's one example, "The antiquated While..Wend loop shall not be used". Reminds me of when Joel Spolsky says, "As if source code rusted")
Look, the only advantage to using Do While... Loop is that you can break out of the loop prematurely. That's a bad coding practice, people. If I'm eying code at the bottom of the loop, debugging something sufficiently long, I might miss that you've Exit Do'd somewhere above. One might complain that loops shouldn't include something quite so big. Then just substitute a function call in the loop that I'm debugging and missing that exit in the loop instead.
The point is that exiting a loop in some random place is every bit as confusing as a GOTO; it breaks an easy, logical flow. I should be able to glance at a loop and reasonably assume that each operation on the same level of whitespace is executed. Logical flow is also a reason why you should never put Dim's (VB's method of declaring variables) mid-method. I shouldn't have to fish through your method's code to see what kind of object "tempX" is. Which is even more reason why you should use some sort of naming convention that explains what each variable is. Now I don't even have to glance at the declarations section to see what's going on in a line of code. And, of course, as implied above, whitespace should be used to show when branches can be taken and what level of code belongs where.
1.) While... Wend encourages good programming practices. Use it. Have a really good reason when you don't.
2.) Don't use Goto. (For PolCorrect people: "Do use alternatives to Goto")
3.) Don't exit loops prematurely (there is an exception that proves the rule. I might talk about it later) (PC People: "Do complete each loop in its entirety, using If's to section logic within")
4.) Declare variables at the top of a method unless it's, for some screwed up reason, impossible.
5.) Use a naming convention that allows you to know what each variable's object type is at a glance.
6.) Use "hierarchical whitespace", daggummit.
7.) Getting me to talk about one "good" programming practice will, if I'm not careful, unleash hours of rules/Don't's.
8.) Summing is fun.
posted by ruffin at 11/11/2003 10:20:00 AM
All posts can be accessed here:
Just the last year o' posts: