Hacker News new | past | comments | ask | show | jobs | submit login

I don't really agree. I don't think there is much difference between reading code you wrote a few weeks ago and code someone else wrote - at least not in this context.



We might just have to agree to disagree, but I would disagree with your claim here in the strongest possible terms.

When someone new comes into a project, you can’t assume what skill level they’re at, how they think about code, what design patterns have been most strongly used in the teams they were previously on.

Code you wrote a few weeks ago is still going to be hugely similar to the types of code you often write, the ways you think about design patterns, etc., especially if you’re on a team for a long time.

Code someone else wrote very frequently looks completely alien, especially for new people, or someone from a different team that has to collaborate on one small cross-cutting problem, or people who look at your code long after you left the company.

Using things like auto because it has some benefit as you write the code, in your mind, is deceptive for exactly this reason. Those criteria are hardly ever still relevant when it is someone else reading the code.


Sure. Do you have experience using 'auto'? I'm asking because I once thought exactly like you, but changed my mind after a few years of real-world experience. But of course, YMMV.


Yes. Previously at a proprietary trading company, we refactored a large subset of the code to use auto, and found that people, especially traders and quants, who have to do projects extending that code on a more ad hoc basis, had a drastically harder time reading and reasoning about it, so we rolled back and instead had a company convention to disallow the use of auto.

If the only people reading the code was my team, then it probably would have been fine (though still a silly thing to get rid of or to stop writing new type annotations).

But that’s never the case in real software. Other people needing to quickly grok it is usually concern #1, even higher than performance most of the time (and that stuff powered a real-time trading system).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: