4 ms·
I believe there were alternatives at the time, but expensive. Java was free and also syntactically compatible with C++. I think that rather these properties (th
by js8 1y ago
I believe there were alternatives at the time, but expensive. Java was free and also syntactically compatible with C++. I think that rather these properties (than being somewhat unique) are the main causes of its success.
- zabzonk 1y ago> syntactically compatible with C++ Not. And certainly not semantically.
- Pet_Ant 1y agoThat’s just obtuse. Compare Lisp, Forth, APL, Prolog, Ada, or Fortran. Java is just C++ with a few twists. You can literally write code that will compile in both.
- js8 1y agoThat's exactly how I meant it. Another alternative to Java at the time was Smalltalk, with different syntax. Choosing C++ syntax for Java was clearly a marketing move (as it was for C++) - we shouldn't underestimate network effect of familiar syntax. I think Java succeeded for the same reasons C++ succeeded - built on familiar syntax, reasonably free and "supported by" a large company. Java being a decent language is a consequence of its success more than of its original design.
- igouy 1y agoFree as in beer, in contrast to proprietary Smalltalk.
- zabzonk 1y ago> You can literally write code that will compile in both. An example, please.
- Pet_Ant 1y agoint fibonacci(int n) { if (n <= 0) return 0; if (n == 1) return 1; int a = 0, b = 1, temp; for (int i = 2; i <= n; i++) { temp = a + b; a = b; b = temp; } return b; } ...if only the return type was "Crow" then you could .eat() that...
- zabzonk 1y agoThat will not compile with javac, as it is not a method of a class.