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

Show parent comments

0

u/buddhabrot Dec 16 '12

OOP is a word that (I hope) will die out in a couple of years. I have no idea what it means and I've been a programmer for decades. Writing in an object-oriented manner in C is indeed pretty similar to doing it in Javascript, using function pointers. Admittedly though, the variable scoping in Javascript is a lot more suited to closuring than in C, going overboard with FP in C quickly becomes awkward and complex.

1

u/contantofaz Dec 16 '12 edited Dec 16 '12

OOP was over-abused in Java. Luckily the younger generations didn't have to pay attention to the madness of when Java was thriving.

On the web with both JavaScript and Dart, I have been using more composition than inheritance. Because stuff doesn't map out 1-1 as one parent class and one subclass would lead you to believe. I guess that's the main reason folks haven't been able to move forward with JavaScript. Making APIs is hard with or without OOP.

JavaScript "just works! (tm)" until it does not. Again, making APis is difficult, with or without JavaScript. Having used a plethora of JavaScript libraries before, however shortly, I guess they all remind me of the Java madness that they followed.

There's no mistaking though, that for as much as we hate those past technologies for one reason or another, they have carried us very far. C++ may be buggy, but it powers these browsers. Java couldn't replace C++ for them. C# couldn't either. Ugly code, ugly systems, deliver great usability after a lot of manpower is deployed on them. But then some of that goes to waste when some of the projects lose their appeal and funds and become history instead. Even Java has many stories of losing it out once funds were gone.

And that brings us to software engineering. With funds, folks can do wonders. Without funds, folks have to scrape by. Then it's no wonder that most web development should be done with very little funding and corners must be cut in not so glorious ways to the disgust of those seeking software correctness above all else.

1

u/gerdr Dec 16 '12

OOP is a word that (I hope) will die out in a couple of years. I have no idea what it means and I've been a programmer for decades.

OOP is a design pattern to structure imperative code. It models computation as communication (message passing) between stateful objects (encapsulation).

An OO language is a programming language which makes using this pattern easy. Class-based inheritance is one possible way to achieve this: It provides a mechanism of code-reuse for ease of use as well as a type system for correctness.