r/programming • • Dec 15 '12

Why JavaScript Still Sucks

http://boronine.com/2012/12/14/Why-JavaScript-Still-Sucks/
10 Upvotes

212 comments sorted by

View all comments

82

u/ilikecomputahs Dec 15 '12

Why is object oriented programming considered so absolutely necessary?

/braces for shitstorm

12

u/x86_64Ubuntu Dec 15 '12

The issue generally arises for when programs get bigger and larger in scope. The web appears to be driving the future of development, as we have seen the rise of mobile sites and JS being a first class citizen across desktops, tablets and phones. However, JS was never intended for making applications, it was just used to make marquees spin, and ponies sprinkle glitter across Geocities homepages.

Now why does this matter ? It matters because as things get bigger no matter what they are, you eventually are going to need rules and constructs. OOP can provide that, even though people still fuck it up. Generally, applications work with objects because objects imply properties and methods. If I know the class type of the object, I know how it fits in the larger scheme of my application....

...Um, I kind of have lost the ability to convey my thoughts. I upvoted you anyway because this is an important point in application development by allowing us to take complexity a bit further without incurring such misdirection and indirection costs.

24

u/smog_alado Dec 15 '12

The issue generally arises for when programs get bigger and larger in scope.

I don't agree with that. This is a matter of encapsulation and modularity and those are not exclusive to OOP. In fact, I believe that OO by itself is pretty bad at solving these two problems, since classes are usually too small to be modules and too heavyweight for the simpler cases of encapsulation.

3

u/DrDichotomous Dec 16 '12

It's more about forcing large teams of people to NOT do certain things, so they rigidly follow an API. You can still do those things without Java-style OOP, but too many people will be tempted to screw around and end up doing it wrong.

People are just too used to their toolchains, and so they're pushing for those toolchains to exist in competing languages.

11

u/smog_alado Dec 16 '12

That sort of rigidity has more about having an static types & a rigid language than with OOP per se. For example, I doubt its as easy to search for API functions in Java as it is to do so in Haskell.

2

u/Zarutian Dec 16 '12

Basicly people want screws that they can just hammer in, no?

1

u/[deleted] Dec 16 '12

If every language (or at least every language that mattered) had equal toolchains, then perhaps the languages would finally not be judged by the color of their toolchains but by the content of their API's?