3 ms·
+1. One of the single best pieces of programming advice I ever received when I was young was my TL saying "I don't like this, it's too clever". I spent a brief
by pschuegr 3y ago
+1. One of the single best pieces of programming advice I ever received when I was young was my TL saying "I don't like this, it's too clever". I spent a brief period at a FAANG company and IMO the people there are too smart to be good developers.
My coding heuristics now pretty much boil down to:
1) Less code is better code. The only code with no bugs is no code. After you get something working, remove as much code as you can.
2) Simple code is better code. Don't waste time making your code complex for the sake of being efficient until you've used it and proven that it's a bottleneck with a profiler. Otherwise, just do the simplest thing you can think of that will work.
3) Don't think too far ahead unless you specifically have been tasked with it. Otherwise, do what will work now. Refactor when necessary.
- peterashford 3y agoYep. 100% on board with this. The more code and the more complexity, the harder the system is to understand, maintain and extend.
- Groxx 3y agoYeah. I summarize 1+2 as "optimize for reading" personally - none of us is as dumb as we are in the past/future, explain yourself and don't be clever without an explicit need and a way to recover from it later, etc.