DEV Community


Reusable code (tick), backwards compatibility (fail)

johnkazer profile image John Kazer ・1 min read

When I was a lad, starting out in development (COM, C++, DLLs etc for Windows), we never broke an interface. That is, the latest version of a module would always support every previous API (interface) version.

However code reuse was really hard. DLLs were rarely actually reused for other projects.

Nowadays with this new web stuff it all seems to be the other way round. Reuse is everywhere but interface updates often break old code. Old code is stuck using the original reused files.

This seems wrong to me. A major version of a package shouldn't break old code. It should just offer a new API with the old stuff in parallel.

Am I missing something?

Discussion (1)

Editor guide
ben profile image
Ben Halpern

The rise of the web and platforms like GitHub make it a bit more reasonable to break interfaces I think. The word should get out quickly enough. Backwards compatibility is big burden for software to maintain.

That being said, I think it does go to far in the JavaScript community. I’m not sure what the answer is, but the pendulum does seem way to far in the direction of being cool with breaking interfaces.