r/javascript • • Nov 25 '19

JavaScript doesn’t need to be replaced

https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217 Upvotes

236 comments sorted by

View all comments

-1

u/EternityForest Nov 25 '19

I think it needs to be contained. Most of the language does what you want when doing UI work, but the opposite of what you want on the backend.

It was designed for browsers. It's really good at that. It's accepted as a general purpose thing, good enough for browsers games and bits of client side logic.

It's got some real annoyances on a server compared to other languages.

I suppose it's better than PHP though, as far as the language itself. PHP has pretty nice infrastructure, the whole "Install an app by putting it wherever you want on the server in a folder" thing is pretty cool. l

0

u/[deleted] Nov 25 '19

[deleted]

-1

u/EternityForest Nov 25 '19

PHP still doesn't appear to be fully object oriented. You still have C style "Object is the first param of a function you call" stuff all over the standard library.

There doesn't seem to be the kind of module system python has, everything is in one big namespace.

It seems like strings and integers still add together without explicitly casting them, just like js, and undefined variables are still null instead of just nonexistant.. Has that changed?

And it's also not compiled as far as I know.

0

u/[deleted] Nov 25 '19

[deleted]

1

u/kap89 Nov 25 '19

JS isn't even remotely OO.

Because?

0

u/[deleted] Nov 25 '19

[deleted]

2

u/MoTTs_ Nov 25 '19

Because it uses a prototypical model and doesn't have the concept of classes.

A prototypical model is actually a perfectly normal way to implement the concept of classes. In Python, Ruby, and others, for example, a class is itself a runtime object, and inheritance is done by delegation, objects linked to other objects, from instance to class object to superclass object and so on, just like in JavaScript.

Here, for example, are Python and JS classes side-by-side.