Hacker News new | ask | show | jobs
by pjmlp 1764 days ago
My C and C++ code for Windows 3.1 written in 1995 would compile just fine today on Windows 10.
2 comments

I heard this a lot but I wonder if it's still really true. I mean, can I literally open the latest visual studio and open an old project, hit build and it will just work?
Naturally it depends on what you are doing, but for regular Win16/Win32 code that uses Windows type macros and no low level tricks pretty much so.

And even if you take Win16 out of the picture, Win32 exists since 1995.

I'm not doubting that the windows API has remained stable. I'd like to try if the tooling (e.g. IDE config format or makefile equivalent) has also received the same amount of attention to backward compat
Again, depends on what you were using.

Borland C++ or Watcom, probably not much help.

Delphi, C++ Builder, Visual C++ for Windows 95/2000 mostly work, naturally you might need to use the IDE wizards to upgrade project files, or fix tooling paths on the makefiles.

https://github.com/dbremner/cake is a 16-bit Windows 1.0 application that I ported to Win64; most of the changes weren't required.
As a person that gets anxiety from JS projects and how fast things move, I love this aspect of C. It puts the soul to ease.
The JS code you wrote 20 years ago still runs today (and much much faster)

The problem is not JS, more the dependencies you decided to take for your project.

Indeed. Going back to my example, stuff written with OWL won't compile today.