3 ms·
> Hint: if you think JS sucks because of browser incompatibilities, what you really hate is bad implementations of the language, not the language itself. At th
by skrebbel 13y ago
> Hint: if you think JS sucks because of browser incompatibilities, what you really hate is bad implementations of the language, not the language itself.
At the risk of going slightly off topic, this is true only if you have purely academic interests.
A programming language, fundementally, is just a document with a spec (for the sake of argument, let's ignore the languages that have a reference implementation as a "spec"). That spec is all there is to it for PL geeks.
Us engineers, however, we want to use a language. I don't care what's in a spec, I care about whether it works, and how. Whether it works is completely related to the implementations of the language that I need to consider, and completely unrelated to the language spec.
Besides bad JS implementations, Python is a fun example. It effectively has two mainstream implementations: CPython 2 and CPython 3. If you want to support both, you face all kinds of hurdles, much like cross-browser JS programming.
Does this mess badly reflect on the language itself? Hell yeah.
- m0th87 13y agoMost of the inconsistencies in JS are with respect to the DOM / standard library exposed by the various browsers. That is surely not part of the PL. As for Python 3, if they hadn't made breaking changes, people would complain instead about the various warts the language has acquired over the years that they refuse to fix for the sake of backward compatibility. There's no solution that makes everyone happy, but I'm glad that the python community is still willing to make high risk / high reward decisions about the language's evolution. That's a sign that it's not yet set in its ways.
- skrebbel 13y agoOh, sure enough. I agree with the Python 3 decisions. In fact, my beef is mostly with the (otherwise excellent) ecosystem not doing enough effort to keep up. You only need a few major frameworks and libraries to say "ok, next release is Py 3 and Py 3 only" and the whole ecosystem moves over within a year, I'll bet.
- haberman 13y agoDo keep in mind though that writing JS for the web is one of the few instances today where an app is expected to run flawlessly on several completely independent implementations. Put any other language in JS's place and you'd probably have gotten a similar number of incompatibilities between browsers (especially since many/most of these incompatibilities are actually in the DOM -- an API). This is a symptom of software diversity, not of JS.
- smoyer 13y ago"Do keep in mind though that writing JS for the web is one of the few instances today where an app is expected to run flawlessly on several completely independent implementations." This is indeed a hard problem, and is precisely why the ECMAScript specification exists. Whether it's precise enough in all instances is another question. In other realms, the same problem is faced by Java, and there the implementation is split into the compiler and the JVM. Breaking it into two pieces at these boundaries has advantages - compliance suites can test that the compiler generates valid bytecode (the Java equivalent to native machine code) and further test that the JVM behaves as expected with known bytecode.
- mjolk 13y ago>CPython 2 and CPython 3. If you want to support both, you face all kinds of hurdles, much like cross-browser JS programming. Does this mess badly reflect on the language itself? Hell yeah. I don't think that it's at all the same as the current JS problems. Most Python devs (myself included) are sticking to the newer 2x releases because - things work perfectly well in 2x - 2x is still actively developed - we can pull down 3x behavior from 'future' when wanted - no one is putting a gun to heads to make people upgrade - python isn't client side. if you can't make up your mind or ship correctly, that's on you, the dev Which is to say, I don't see how this reflects poorly on the language. If a developer feels that he needs to support Cpython 2 and 3, that's his own deal because he could pick one and bundle his application appropriately. Now for JS, you don't really get a say as a front-end dev because the client is in charge of what interpreter he brings to the table. You don't get a say, unless you know what browsers you can get away with targeting (e.g. ie6 users aren't likely to be shopping for the latest android device).