3 ms·
> Javascript has pretty much nothing to do with Java. It's not a copy of Java in any way. I never said it was. I said: > JavaScript was made in like a weekend
by UnoriginalGuy 12y ago
> Javascript has pretty much nothing to do with Java. It's not a copy of Java in any way.
I never said it was. I said:
> JavaScript was made in like a weekend and copied Java badly
The original author knocked out JavaScript's overall design in a weekend, then they tried to shoehorn in Java-like features badly. That's why we have artifacts like the Date() having month at 0 (like Java). They took a whole bunch of Java concepts and tried to clone them into JS after the naming.
My post would have made more sense if you understood a little more about JavaScript's history (both before and after naming). There was definitely a sense of making it more Java-y after it was named that.
> It's an extremely functional language
No, it just isn't. JavaScript has state all over the darn place. I mean heck it has a global scope with no namespaces at all, that alone is a death nail on calling anything a "functional language." I have no way of writing a function in JavaScript which makes a guarantee that it has no internal state, so the optimiser cannot make assumptions about that function either (e.g. inlining it). In fact I can dynamically change a function's definition at runtime, so it never runs the same code twice.
- acjohnson55 12y agoIf it's just Date semantics, that's a fairly insignificant amount of copying. I'm not saying there isn't superficial similarity. But just look at the fact that Javascript until ES6 has lacked a useful `class` keyword, without which you can't even write a Java program. I suppose "functional" is in the eye of the beholder. I see it in terms of what a language allows you to do, not what it prohibits you from doing. You can absolutely choose not to use shared mutable state.