Hacker News new | ask | show | jobs
by jen20 997 days ago
I’m with you on Python 2 to 3 being a fine idea and an improvement but…

> You would have exactly the same problems if you tried to compile old K&R C code or C++ code from 20 years ago using modern compilers. Or tried to feed modern C# code to a compiler from 10 years ago.

If you feed 10 year old C# to a modern compiler it will compile it fine. I’d imagine most C and C++ of even 20-year vintage will still compile. The issue is of forward compatibility, not backwards.

1 comments

No it won't, as it might be using the breaking for change introduced in C# 5, or .NET Framework features not made available on .NET Core.

Likewise C and C++ have had enough breaking changes since 2010.

It depends. Some projects can be retargeted to netstandard2.0/net6(8).0 without any changes at all, some require minor update of dependencies and some other - do face breaking changes in library code because APIs did get deprecated.

With that said, neither IL nor C# itself had any changes breaking forward compatibility (aside from a very early change to foreach recently discussed here).

C# isn't used in isolation without standard library.

Also, "it depends" isn't the same as "If you feed 10 year old C# to a modern compiler it will compile it fine."