Hacker News new | ask | show | jobs
by jerrygoyal 847 days ago
Is there an article that teaches how to approach coding with future expansions in mind? It's understood that predicting all future features is impossible. Writing code for the product's current state often results in extensive refactoring when new functionalities are introduced.
3 comments

In my experience, writing code that tries to be extensible also results in extensive refactoring when new functionality is introduced.

My advice would be to make the code easy to understand and relatively un-entangled. Those make the inevitable refactorings easier.

I would say don’t try to make code extensible - try to make code replaceable.

If it is not complex it is easy to rewrite and replace. Some things need to be complex but trying to make things extensible is making it needlessly complex quite often.

Isn't that what almost the whole field of software engineering is about?

In my experience, key is to keep the code as small and simple as possible, that way there is less that might need changing in the future.

I think there is no single one because it would be different for different types of software.

No silver bullet I would say.