Skip to main content
6 events
when toggle format what by license comment
Mar 11, 2015 at 13:29 comment added Trylks @MichaelDurrant it's not meant to be an order from best to worst but from most basic to more sophisticated. For clarification: Code should be self-documenting, which solves several problems. The worst problem may be comment-code inconsistencies. There are no tests for the comments, thus they are more likely to contain errors, hence avoid comments as much as possible. (1) If some code needs clarification, before (2) writing some comment, (3) try writing the code better, (4) if the code still needs clarification then goto (1).
Mar 11, 2015 at 10:55 comment added Michael Durrant I'd consider reversing First is documentation and comments in the code. Second, tools that provide coverage tests. I'd probably focus on tests first and if possible use them to drive out the exact code. Then I add any documentation and (rarely) comments for gotchas.
May 27, 2014 at 9:08 comment added Trylks Your comment is about writing code fast or often, you are missing the point. I'm not talking about writing but about reading code, it's all about readability. A verbose program isn't readable. A one liner may work as a "summary" and as such it may be more readable, even if slightly complex. Synthesizing is important when writing anything, and specially code.
May 24, 2014 at 16:26 comment added Maurycy Personally I prefer a one liner even if it is slightly complex and I prefer it not. It is more important to write readable code that to write it fast. If you don't write this functionality often, it is likely to make a mistake or a stupid type. If, on the other hand, you use it often, the you should already know where this utility function is stored and use that instead.
Apr 25, 2013 at 19:28 history edited Trylks CC BY-SA 3.0
added 85 characters in body
Apr 24, 2013 at 17:26 history answered Trylks CC BY-SA 3.0