Skip to main content
13 events
when toggle format what by license comment
May 6, 2016 at 7:45 answer added tokland timeline score: 2
May 6, 2016 at 1:27 history edited 200_success CC BY-SA 3.0
retitle best-practice question into a code review question
May 6, 2016 at 0:37 comment added maurice Most helpful comments: "Split long lines" -@doug65536 "'time-to-comprehension' is usually a good estimation."-@Ext3h Would upvote the comments, but have insufficient rep to do so.
May 6, 2016 at 0:26 comment added RubberDuck Please be sure to include a language tag on your questions. I added ruby for you.
May 6, 2016 at 0:25 history edited RubberDuck
edited tags
May 5, 2016 at 23:42 comment added Ext3h Does it take more than 20 seconds top to understand what the function does? Yes? Then it is too long. By far. In this case, it's at least 5 minutes until you have grasped the code flow in this function. And the chance of changing this function without introducing a new bug is rather low. Pick any arbitrary period for the upper bound, but going by "time-to-comprehension" is usually a good estimation from my experience.
May 5, 2016 at 23:29 comment added doug65536 Long lines are frustrating and they hide bugs. Split long lines at sensible points. You should be able to have a large complex text editor and debugger on-screen with your code. Your entire screen width is not the limit.
May 5, 2016 at 23:19 comment added Niklas Rosencrantz @maurice When you have this anti-pattern of nested if ... else you can refactor it by reducing the depth of the branches and breaking out your loops and conditions into smaller functions. Read: programmers.stackexchange.com/questions/205803/…
May 5, 2016 at 22:59 review Close votes
May 6, 2016 at 14:01
May 5, 2016 at 22:49 history edited maurice CC BY-SA 3.0
added 2259 characters in body
May 5, 2016 at 22:49 review First posts
May 6, 2016 at 0:42
May 5, 2016 at 22:47 comment added maurice My question is so broad that it seems to me like the particular code is irrelevant. It may be that the question is too broad for this forum, but I figured it was worth a shot. I'll add my code now...
May 5, 2016 at 22:43 history asked maurice CC BY-SA 3.0