by teddyh · 9y ago · 0 comments
If you use reasonable and forward-looking language constructs, it will be runnable – or at least very easy to port to – newer major versions of the language. This is also true for the transition from Python 2 to Python 3. The problem is that a lot of people used (and still use) Python 2 badly.
Yes.
There are many differences between K&R/UNIX C and C89. For example, in K&R string constants could be modified, and repitions of the same constant would be different strings. This is not the case in C89. Variadic functions are different. Octal numbers were changed. Arithmetic works differently. And so on.
I can't comment on Perl 4 vs 5 vs 6.
Perl 5 is backwards compatible with Perl 4
Perl 4 is just a renamed version of Perl 3 to coincide with the release of the book "Learning Perl"
Perl 3 is backwards compatible with Perl 2
Perl 2 is backwards compatible with the original Perl
Many of the problems that new Perl programmers have with learning Perl is that every new feature had to be added in a way that it didn't break existing code. That is why for example you have to add "use strict" and "use warnings" to every Perl source file, even though that should be the default.
Perl 6 exists because we "wanted to break everything that needs breaking", so it is very different than any previous version.
That is why both Perl 5 and Perl 6 will both continue to be supported languages.
Imagine taking good ideas from every high level modern programming language, bringing them all together, while making the features seem like they have always belonged together. That is Perl 6.
I like to say that as Perl 4 is to Perl 5 is to Perl 6, C is to C++ is to Haskell,C#,smalltalk,BNF,go, etc
Every compiler has a writable strings flag for backwards compatibility.
Everything else you cited is backwards compatible. You are confusing forward compatibility with backwards compatibility.