News for hackers. Stuff that matters.
Re:Ask HN: What is your best advice for a developer to write... by spreeker on Wednesday June 29, 2016 @05:48PM (#12005078)
1) Learn the limits of your own brain and of the average human brain. On average someone can remember about 7 items. So do not write functions with more variables. Cut problems in many stupid little problems which are easy to reason about and debug. So whenever you see a function gets to 25 lines cut it up in to pieces. Because of your own/average brain limits large functions are garanteed (95% sure) to have bugs. 2) Test all your assumptions you make about code and build on those assumptions and build tests to check them. So you keep building on a solid code base that does not "surprise" you. 3) Be crazy about Good variable names and clear functions names and avoid abreviations because those costs brain cycles.

There are no comments on this comment yet.