Hacker News new | ask | show | jobs
by masfoobar 845 days ago
^^ This.

This is one of the good things about C. I could write something in C99 and, in 10 years, it will likely still compile without changes!

Can we say this about Java, C#, D.. and ESPECIALLY Rust??? You might still be able to download the specific version, but you then have to cater to package manageers, or the IDE/editor you are using, etc.

C does not try to cram in "Cool Feature A" and "Cool Feature B" because it is the cool thing of the time.

I think the only other languages to come close is Odin and, perhaps, Zig. Both have not had a production release (yet) so I am still expecting there to be some changes at this point. However, once mature, I would expect very little changes if left for 10 years. Of course - they are young languages but Odin (especially) makes it very clear what they will and won't add to the language, and keeps it pretty close to C in a number of ways.

1 comments

> I could write something in C99 and, in 10 years, it will likely still compile without changes! Can we say this about Java, C#, D.. and ESPECIALLY Rust???

I think you could say this about Java. The others, I'm unsure about.

I would agree that Java, of all those I listed, is likely to be better supported. I do wonder if a Java version from 10 years ago would still be officially supported (or recommended) - and encouraged to use the later Java release... meaning (likely) code changes.

This is not entirely the case for C. I guess.. it depends.

If I use gcc (std=c99) for a project I wrote today... this will likely work in 10 years time, with the latest gcc version... without changes.

C# dev here, you can compile applications from any time period very easily as long as you have the correct .NET SDK version, which is specified in the .csproj file.

It's the same with Java, where to compile old applications you also need to use the same JDK version, however with Java it's a bit harder cause there is no file that says which JDK version should be used to compile this. At least I think so, correct me if I'm wrong.