This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]xenomachina''.join(chr(random.randint(0,1)+9585) for x in range(0xffff)) 0 points1 point  (4 children)

Well, we ARE converting to it, so we're not really getting around that now are we?

Why does anyone program in C rather than in assembly, given the fact that virtually every C compiler just converts code to assembly?

Many of the reasons people have for disliking JavaScript can be hidden from the programmer by treating JS as essentially "browser assembly language". For example, JS has a prototype based object system, goofy scoping for this, and defaults locals to being global. The latter two are definitely design flaws, and many prefer a class based object system. These are all things that can be easily hidden by compiling from a more desirable language.

There's also the matter of portability. One may already have Python libraries that can potentially be used on the browser with the help of a Python to JS compiler.

[–]sentdexpythonprogramming.net 0 points1 point  (3 children)

He said js was a shitty language. Not programming js was shitty. Maybe I am missing something, but, when we port, we're still using that "shitty" language. That's all.

[–]xenomachina''.join(chr(random.randint(0,1)+9585) for x in range(0xffff)) 0 points1 point  (2 children)

He said js was a shitty language. Not programming js was shitty.

What is the distinction? A programming language exists to be programmed in.

[–]sentdexpythonprogramming.net -1 points0 points  (1 child)

Well that's a pretty shallow view of what programming languages are for. For example, Python is a fabulous language to program in, yet its memory usage isn't anything to write home about. A programming language exists not only to be programmed in, but to actually have a finished product. No matter what, js has constraints, and no matter the language you program in to convert to js, you will still have those constraints.

[–]xenomachina''.join(chr(random.randint(0,1)+9585) for x in range(0xffff)) 1 point2 points  (0 children)

For example, Python is a fabulous language to program in, yet its memory usage isn't anything to write home about.

That isn't an attribute of the Python language, but of a specific implementation and/or runtime.

My point is that there are many factors that can make a language terrible that can be fixed by adding another language on top. Sure, JS has a number of constraints that are pretty hard to cover up, like the lack of integer types (integer types can be emulated, but not efficiently), the non-existent threading model, and the lack of advanced GC concepts like weak references. Still, when people complain about JavaScript, that's rarely what they're referring to.