Hacker News new | ask | show | jobs
by lj3 3248 days ago
> What you're saying is probably more true in the web dev world.

Any world in which OOP is the primary paradigm. Then again, I've seen truly horrid procedural code as well. Do you have any specific ideas on why the code you're working with seems to be the exception to the rule? Or is it pretty much all in that blog you linked?

2 comments

A few things come to mind:

- Windows is (mostly) a platform, not an end application. So you need...

- Backwards compatibility. It is a pretty hard requirement, as one of the major selling point of Windows is that your existing stuff will keep working. Programs targeting 16-bit Windows from the early 90s still work on Windows 10 (though they recently removed the 16-bit subsystem from 64-bit Windows). I believe it's the same with Office document formats. You already have the code that handles all of the old APIs and functionality, so...

- If it ain't broke don't fix it. The old code has been thoroughly battle tested. Obscure edge cases have been addressed. Bugs have been fixed over the course of many releases. There is no chance that your rewrite will avoid regressions, and you'll almost certainly introduce new bugs too. It's better to make necessary changes to the old code than to try to start from scratch. And...

- It's a lot cheaper too.

Joel Spolsky has a great blog post about rewrites: https://www.joelonsoftware.com/2000/04/06/things-you-should-...

I have seen or worked multiple still maintained projects way older then 5 years - with parts of old code still there. Most of them in java or .net.
5 years old Java code is really no problem as long as it uses maven as build tool (and don’t use long deprecated code generation tools).

This is the main difference l see between maintaining old Java code and e.g old Delphi code:

In maven/java I can run a couple of commands to build it, open it in any of my three favourite IDEs (Netbeans, IntelliJ and Eclipse in that order) and it just works.

In other languages there is often some dependency hunt involved before you can even start. Bonus for dependencies that must be installed using .exe installers, in a specific order (hint: if you don't get it right - good luck with cleaning the registry before trying another installation order.)

I might have been very unlucky in my encounters with legacy code in other languages but so far every encounter makes me love the Java ecosystem more.

(Although I'll happily admit that parts of it might be related to the fact that Java developers seems to avoid using non oss code to a much larger degree than anyone else - maybe except from php and js devs?)