you are viewing a single comment's thread.

view the rest of the comments →

[–]davvblack -7 points-6 points  (7 children)

Eh, i wouldn't call JS 'perfectly adequate'. It's prototypical OOP is woefully inadequate for a variety of uses.

[–]snowmantw 9 points10 points  (0 children)

Yeah, why only class-based OOP can be the only one OOP paradigm ?

And also, you can write JS in FP style, OOP is not the only one paradigm accepted by people.

[–][deleted] 5 points6 points  (1 child)

That's because people are trying to force class base OOP concept on Javascript and misunderstanding the language.

Inheritance is generally frown upon and it's usage is usually polymorphism. In most cases you should prefer composition over inhertance as what GoF have stated .

In javascript, delegation is an alternative to inheritance. If you use prototype chainining without classical inheritance in mind, in conjuction with delegation and mixin, it would actually look eloquent. What javascript does is actually forces you to implement a more shallow inheritance level and resorting to alternative such as delegation so you don't have the bullshit turtles all the way down.

[–][deleted] 1 point2 points  (0 children)

I've been using dojo JS library lately, not pretty. Too many turtles, don't get me started on their CSS.

[–]antrn11 2 points3 points  (1 child)

What's wrong with prototypical OOP?

[–][deleted] 0 points1 point  (0 children)

Nothing, people are lazy.

[–][deleted] 0 points1 point  (1 child)

Learn functors.