Talk:Loops/Downward for: Difference between revisions

no edit summary
m (→‎worse programming pratices?: Do not open. See instead for details. -- ~~~~)
No edit summary
 
Line 11:
 
:: I hope it was understood that I never suggested that bad practices are to be promoted, but rather exposed. More often than we care to admit, programmers use a "trick" or somesuch for golf-playing, brevity, space saving, or other reasons (even if good intentions was the primary goal), and whereas it may seem to be a good idea to the coder, it may be defeating the purpose in the long term. This is especially true, I should think, for Rosetta Code, where the programming examples are supposed to show how to solve a task (hopefully with clarity, logic, and good practices), but of course, my religion is better than your religion (this's stated to show that quite often, it's what's believed to be true/better, and not backed up with facts). Programming books have chapters (or at the least, disclaimers) on what not to do or shouldn't be done (as far as one method or style versus another). Some styles or methods are highly controversal, but when shown side-by-side with a better method, light can be shown on the merits of one versus the other. It's pretty hard to convince people that their code is hard or difficult to read, since the author of said code can easily read it (as it conceived/written by them), but other persons may have a much more difficult time perusing unfamilar code, or worse yet, an unfamiliar language. PS: your mileage may vary. For recreational use only. Void where prohibited. Not intended for small children. Restaurant package, not for resale. Other restrictions may apply. Do not write below this line. -- [[User:Gerard Schildberger|Gerard Schildberger]] 12:56, 5 July 2012 (UTC)
 
==what's in a range?==
 
The text should imho state if the 0 is to be included or not.
In C-like languages, this usually looks like <lang C>for (run=start; run > end; run--)</lang> and is often a source for an off-by-one boundary error. -- [[User:Cg|Cg]] 11:35 10 Dec 2020 (CET)
Anonymous user