Skip to main content
5 events
when toggle format what by license comment
Jul 10, 2018 at 19:01 comment added Bill K Great points, I'd like to simplify this to say that "DRY" is the most important single factor. Identifying "repeats" and removing them is the cornerstone of nearly all the other programming constructs. To put it another way, all programming constructs are there, at least in part, to help you create DRY code. Start by saying "No Duplication Ever" and then practice identifying and eliminating it. Be very open as to what might be a duplicate--even if it's not similar code it might be duplicating functionality...
Jul 7, 2018 at 8:36 comment added cmaster - reinstate monica @Jaquez Ah, totally forgot about that one. Thanks for reminding me. I've updated my answer to include this :-)
Jul 7, 2018 at 8:35 history edited cmaster - reinstate monica CC BY-SA 4.0
added 317 characters in body
Jul 7, 2018 at 4:33 comment added Jaquez Great points about splitting long methods. Another good heuristic regarding the first paragraph after the anecdote: if your method can be logically divided into sections and you are tempted to write a comment explaining what each section does, then it should be broken apart at the comments. Good news, those comments probably give you a good idea of what to call the new methods.
Jul 6, 2018 at 14:23 history answered cmaster - reinstate monica CC BY-SA 4.0