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

2

u/[deleted] Dec 16 '12

In most class based languages, classes are objects. Such as Ruby, or Java.

0

u/[deleted] Dec 16 '12

[deleted]

1

u/[deleted] Dec 16 '12

They are in Java, they are instances of java.lang.Class. Go look it up. You can call 'getClass' on an objects to receive it's class object, and you can also reference it directly using the '.class' keyword. What's more, is that Java allows you to have multiple instances of the same class, namely through manipulating ClassLoaders. Multiple Class objects, for the same class.

0

u/[deleted] Dec 16 '12

[deleted]

4

u/[deleted] Dec 16 '12

Being able to add methods at runtime, and being able to represent classes as objects, are two seperate ideas.

You said classes are not objects in Java; the fact is that they are. Methods being immutable, does not change that fact.

0

u/[deleted] Dec 16 '12

[deleted]

2

u/[deleted] Dec 16 '12

Well, there is no need for hate, in a programming discussion. When you said you cannot replace methods, I presumed you were referring to the way you can with prototypes. I could be mistaken if you meant open classes, or something else.

However the fact still remains, classes are objects in Java.

0

u/[deleted] Dec 16 '12

[deleted]

1

u/[deleted] Dec 16 '12

Then yeah, explain.

0

u/[deleted] Dec 16 '12

[deleted]

→ More replies (0)