Hacker News new | past | comments | ask | show | jobs | submit login

But 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.



Then 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 :)


Can'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...


If the compilers you use have been updated this millennium, yes. However, that's a big if.


There 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: