3 ms·
That's very clever, but the OP's point is that you shouldn't try to be clever. Your life will be easier if the code is simple. When I read the initial example
by sjducb 4y ago
That's very clever, but the OP's point is that you shouldn't try to be clever. Your life will be easier if the code is simple.
When I read the initial example I can understand it in the time taken to read the code.
With your example I had to think for about 1-2 min before it made sense. If the codebase is full of clever stuff then I have to spend hours understanding all of the clever things before I can make changes. If everything is simple then it's easy to change.
If you want to see where overengineering leads you then take a look at this project. https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
It is satire but I have absolutely worked in places that write code like that.
Good programmers know that it's 10x times harder to read code than write it, so they deliberately keep it simple so that they can read it later.
- Pr0ject217 4y agoThank you for your response. Would you mind clarifying what is clever about it? Thank you very much.