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

I would argue that it depends on the developer. Someone just starting out and not having a great deal of experience with algorithms, data structures, security, and the like will need to spend much more time focusing on those aspects. Their challenge isn't [only] writing elegant, maintainable code... it's getting their code to work at all at a reasonable level of performance.

Someone who has been writing software for a few decades will be starting out having already implicitly rejected bad algorithms, unmaintainable designs, unscalable data structures, and poor security practices. Years of development has given them an intuitive feel for the best starting point for an efficient, scalable, and secure design.

Not to mention that anybody with sufficient experience knows to figure out the overall design first before cracking open the code editor. As such, their focus should be on keeping their code elegant and maintainable because it will be built on top of a reasonably performant architecture. And when they discover areas which need greater efficiency, the ease of refactoring the well designed architecture is an inherent bonus.




I agree with that. One thing I didn't mention in my original comment is that I think that there is often a rough correlation between elegant, readable code and at least basic efficiency. I tend to think that code that uses the right data structures looks cleaner. For instance, code using an array instead of a hash tends to look a little bit funny if it's constantly looking up elements by a particular attribute. This is especially the case today when so many excellent data structures and algorithms are already implemented in library code with nice pretty APIs. (I feel that I should mention, though, that the authors of those libraries probably worried a lot about efficiency!)




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

Search: