Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with you here. That project manager you mentioned is a lot of things to a lot of people. But I think as programmers we might want to agree on a set of standards that identify the good and the bad. I am one year or so older than Dan, and it would help my career to know that more experienced programs could identify who is the best among them.


This again depends on the domain and programming language you will be working on. But almost always the following line holds good.

Make your code readable.


I've had the fortune / misfortune of working with some very smart programmers, who could quickly come up with amazing and correct algorithms to solve difficult problems... but I found much of their code very hard to read; it wasn't "horror code" by any means, but it was often terse and tricky, and pretty comment-light.

My theory was that because these guys were so smart, in many cases they overestimated the ability of others to comprehend what was clear to them, and as a result simply made their code too clever and omitted comments that might help clarify it.

It was a definitely a valuable experience, though; besides the natural pleasure of working with very smart people, it really drove home the importance of actively pursuing clear and well-commented code! :]


Those algorithms should be left as is. They are good.

However, they should be encapsulated in an easy to understand API.

That way, you (the usual programmers) can call the code, and they (the very smart programmers) can write smart and efficient code. You are not supposed to tweak that smart code, just call it.

The solution is not to dumb down everything. That way leads to madness. Or Java.


Fast forward a few years...

None of the original developers are still at the company and one of your customers has discovered a bug in their implementation because of some obscure edge case and now you get to spend the next month understanding the complex code and writing a patch.

Writing maintainable code is not the same as dumbing everything down.


Just the same as if someone finds a bug in Boost.

It is hard to understand. It is efficient. It probably requires computer science knowledge to solve the issue. And yet it is as maintainable and well documented as they possibly can make it.

Not everything can be 'business logic' in the sense of 'something a manager can understand but not code'.

Some algorithms are just hard. And they are worth it.

What would be Google without PageRank? What would be Skype without their LAN piercing modules? What would be iD without their game engines? What would be CryTek without their game engines?

Worthless, that's the answer.


Make no mistake. Clever code is not necessarily good code.

I'm not in favour of littering the code with a pile of comments which will most likely become obsolete in three months, but it's very important to do whenever you are: - implementing a non-trivial algorithm - doing something surprising (maybe to fix something on a specific architecture or whatever) - implementing a complex business rule


But their code could also be hard to understand because you don't understand the problem good enough.




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

Search: