News for hackers. Stuff that matters.
Re:Signs your code sucks by WilliamLP on Friday October 23, 2009 @03:01PM (#899408)
> You need to use comments to explain the code – Code should be able to explain itself and should be in a format that is easily readable.

No thanks. Has this author ever written any algorithm more complicated than a basic CRUD app? I'd like to see him read some kind of well written complicated graphics algorithm without any comments. The "why" is often really really important, and you can't read that from the instructions.

Re:Signs your code sucks by nollidge on Friday October 23, 2009 @03:38PM (#899475)
Agreed. Moreover, certain "why"s like "why's this here instead of over in this class?" or "why is this bit of code repeated?" can't necessarily be explained by refactoring.

And sometimes there's just certain technical limits you just can't get around, and you have to comment those.

Re:Signs your code sucks by ggruschow on Friday October 23, 2009 @03:14PM (#899435)
Are little ASCII comments mixed in with code the best way to explain a complicated algorithm?
Re:Signs your code sucks by scott_s on Friday October 23, 2009 @03:27PM (#899457)
Algorithm, no. Details of the implementation, yes. Some implementations require subtle things that aren't obvious unless you're mired in the details. It's nice to have reminders why, say, this particular value needs a +1.