2 ms·
"Can any of you actually relate a real-world case where a 4-month-long team-driven effort produced some code to solve a problem that could be solved by one cowb
by greenyoda 12y ago
"Can any of you actually relate a real-world case where a 4-month-long team-driven effort produced some code to solve a problem that could be solved by one cowboy in 3 months and 20% as many lines?"
I've had the experience of refactoring my predecessor's code and ending up with 20% of the number of lines. Inexperienced programmers tend to write repetitive code instead of looking for abstractions to simplify the problem.
- jakobegger 12y agoBut sometimes you can see the possible abstractions only after the fact... I often end up deleting a lot of my own code that turned out to be unnecessary.
- spiritplumber 12y agoThen there's the situation in industrial control systems where sometimes you really itch to do that, but you can't because the return statements mess up the tight timing :)
- JoachimSchipper 12y agoCan't you use stuff like gcc's __attribute__((always_inline)), or just straight-up C macros, for cases like those? Worst comes to worst, you can always use m4/cpp/some other preprocessor, although that does tend to hurt...
- spiritplumber 12y agoIf the compilers you use have been updated this millennium, yes. However, that's a big if.
- qb45 12y agoThere are people who don't care to simplify the code even after the fact. I worked on a project where half or so of the code was copy-pasted from somewhere else in the same codebase. The original author claimed that this way is better as it allowed him to see what the code does without jumping around the whole codebase.