News for hackers. Stuff that matters.
Re:Ask HN: What is your best advice for a developer to write... by kzisme on Wednesday June 29, 2016 @01:02PM (#12002969)
When you refer to style what sorts of aspects are you looking at? Simple things like bracket placement, naming conventions?
Re:Ask HN: What is your best advice for a developer to write... by rabidrat on Wednesday June 29, 2016 @03:15PM (#12003959)
It's all kinds of things. I recently read a suggestion that you should be able to remove everything from a function's source except the declaration and the comments, and still know exactly what it does. I'm thinking about adopting that stylistic choice, and after a few weeks/months come back to reevaluate if it's worthwhile or overwrought. Or it will just be so obviously great that it becomes a permanent part of my stylekit.
Re:Ask HN: What is your best advice for a developer to write... by stonemetal on Wednesday June 29, 2016 @08:44PM (#12005899)
By style I mean it closer to writing style. How you express your thoughts. For example checking preconditions and returning an error in a block up front instead of mixed in with the computation, or nesting your computation in a bunch of precondition if checks.

Bracket placement is trivial and can be formatted with a tool in a second or two so play around with that all you like.

Re:Ask HN: What is your best advice for a developer to write... by maxxxxx on Thursday June 30, 2016 @11:28AM (#12009193)
It's not only about formatting or naming. It's about how you break down the problem. I sometimes write functions for a certain problem and later realize that I have written the same thing 3 years before. When I compare the code it's almost the same. Almost same function name, same parameters, same result type.