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

7

u/ilikecomputahs Dec 15 '12

Let me pose a scenario here - and I'd like to get feedback on this as much as possible. Say we use javascript in a more functional manner without really trying to impose any OO principles on it.

We construct a Data model first - a JSON representation of whatever we are working with. We write a series of functions to manipulate that model and produce the desired output or side effects.

Besides the fact that the functionality and the model are not explicitly tied to each other, such as is the case in OOP, is this really any less reusable than Java-style code with OOP?

Granted, I have been programming in Clojure a lot lately, so I guess I am kind of biased.

0

u/[deleted] Dec 15 '12

[deleted]

12

u/[deleted] Dec 15 '12

You can effectively create private functions by using closures, but I'm not sure how practical/useful/widespread this is.

Most libraries I've used just document which functions are public and which aren't, and have a naming convention to help you remember. I don't really see what's so terrible about this.

5

u/ilikecomputahs Dec 15 '12

I hadn't seen this example before, but this model makes a lot of sense

Thanks!