Hacker News new | ask | show | jobs
by pcunite 2183 days ago
I have code running in a product first put together in 2001 that is still in operation today. It was rewritten in a different language shortly thereafter, then refactored again sometime after that. I wrote it, and you know what? It's still bad! So, I'm not that great of a programmer.

:-)

I had to sell a portion of the code a while back. Embarrassed for anyone to see it, I tried to focus on just one thing: make it easy to read and follow. Especially since the client was buying the source code.

It was really freeing. I didn’t need to care about all the industry "standards". By presenting it as "easy to read" I could unburden myself of intellectual contests. They do have merit and I appreciate those smarter than myself. But for this situation, the client was at liberty to turn the code into anything they wanted. My code must be the standard for readability and it was fast enough. They added "const" to everything and that was probably proper.

These manifestos are really just guide rails which without could otherwise send you over cliffs. Guides are not laws and rules to be adhered to literally. They are to make you think about why you have twenty levels of inheritance, ten function parameters, and abstractions that don't apply to the domain you are modeling.

If I was to instruct a young programmer today, I would steer them more towards being "simple" and less towards "impressive". Being impressive and clever has its place. Too much, however, and no one will know what you were doing.

1 comments

I would say many examples in the book is just for demo. In real life, it have to trade off somethings