If hell is paved with good intentions, then computing hell is paved with bad excuses. Some look like reasonable design ideas, but very often they only quack like a duck…
- This code can be hacky, it will never be used in production.
- Useful code gets deployed, or did you intended to write useless code?
- I added an abstraction layer.
- You tried to protect yourself from learning on how a library works, and added a level of indirection that obscures the call path and makes the code more complicated.
- Hash-maps have O(1) lookup time.
- Yes, and they are also 100 times slower, and you structure holds less than 100 items…
- I have not deleted this code, because it could be useful later
- Clearly, you do not understand how version control systems work, and increased the use the fossilized lava flow design pattern.
- It is an object, object-oriented is better.
- Your method is static, but not marked as such, so we need to instantiate a class just to unit-test that method.
- Values are not integers, so I used floats
- And you did not consider using fixed point notations, or normalising values properly. So now we cannot use simple equality, and our accounting code will never be right.
- I made my code generic
- There is only one use case, you made your code needlessly complex, and probably added some bugs in the mix.
- Doing X is trivial, so I wrote a quick function
- You avoided looking for the library or reading its documentation. Your code works for the trivial case and breaks for corner cases we will happily discover in production.
- I don’t need to think about memory usage, this language has a garbage collector
- The garbage collector will slow the system to a glacial pace before throwing out of memory errors.
- This system will only be used by engineers, so supporting only ASCII is fine.
- Because engineers never, ever, ever use data from the real system.
- This error cannot be fixed, so it is fine to call
- Clearly any system that links-in your code wants to crash when this condition occurs.
- I designed an elegant language to hold this data
- Clearly, the engineer who will need to change that data in a hurry wants to learn a new language, and then fix the bugs in the interpreter.
- I’m calling an external tool like
awk, it’s the Unix way
- You have added an external dependency, made the code less readable and probably added a few bugs in argument generating and result parsing code.
- Putting dates in strings is safer
- And you did not document in which format…
- That notation is universally known, so there is no need to document it.
- Clearly, all of the planet uses the same school system and same notations as you did.
- Assertions are for people who do not write proper error handling
- No, they are for checking that impossible things never happen, and nobody writes error handling for impossible things, that would be silly.