Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Its just a different way of doing things. After a while one does not notice it anymore albeit it is a tad harder to do in in a c#/java way.
Typescript has come a long way with this though -
gvnix19226y@AleCx04 It felt really clumsy.
Looks like they tried the functional programming way & gave up in the end.
"Sir! People still want classes!"
"FUCK IT, give them classes. and everything java has" -
@gvnix it was actually supposed to be Scheme(a Lisp language. And one of the main 2 dialects the other being the Common Lisp type) for the browser. The project was supposed to make Scheme the true language of the browser and mind you these languages are functional(but not purely functional like Haskell)
In the end they decided to change it to a different syntax type that was more common to the majority of languages, hence the curly brackets and the semicolons and stuff.
Legit I have not checked why they went with prototype based object system. Not many languages implement this, the other one I can think that has it is Lua, but Lua is a better designed language with more sane defaults.
It does feel clumsy at first. To some it never goes away and the lang does have a fuckload of quirks. Even with the current iteration of the language supporting "classes" it is merely syntax sugar over its prototype based system.
I still like it a lot tho. -
OOP JS? Yeah, fuck that. I'm trying to stop using ctor functions and class because that's just syntactic sugar over the prototype stuff. I'd rather have plain objects and explicit prototypes. I think JS should stop pretending to be object oriented, it's really confusing.
edit: oops, I'm just parroting what @AleCx04 said. Hello, fellow JS enthusiast 😍 -
I never seriously used JavaScript and actually only looked up prototype-based type systems (especially JavaScript's) because of this post and (I never thought I'd say this, couldn't stand it whenever I had to use it) it does make perfect sense
You just have to realize that you're inhering from objects, not classes
EDIT: the site that helped me understand https://javascript.info/prototype-i... -
gvnix19226y@Krokoklemme its not like I didn't understand it, the thing i dont get is why the fuck they moved on to class, extends etc ?
-
In defense of the entire weed smoking community, we didn't come up with this shit.
Ask the crackheads. Maybe they did it. -
navitas29156y@gvnix They didn't move to classes. Classes and Extends are synthentic sugar for Prototypes and Inherits. They do almost the exact same thing.
-
@gvnix because most people are either too stupid or to ignorant to look up how prototypes work and will then just start screaming for classes
Basically it happened the way you described it: the community asked for it, so added it. Kinda stupid, but I understand why they added it
Just completed Object oriented JavaScript course and I have to say, the creaters of JS must have smoked some good shit before they the came up with this clusterfuck.
rant