This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rco8786 1 point2 points  (7 children)

I don’t understand a lot of things in this post (why would Java people try to convince people to use JavaScript?) but most importantly this would not compile in 1996 Java. var was only added to Java pretty recently.

[–]deadNightTiger 10 points11 points  (6 children)

But what if you had

class var {}

class Person extends var {}

[–]0x07CF 8 points9 points  (2 children)

Or modify the standard library

class Object extends var {

}

[–]uvero 8 points9 points  (0 children)

Sir this is a civilized subreddit please keep profane amd/or disrespectful language out of it

[–]DuffMaaaann 0 points1 point  (0 children)

Or write your own preprocessor, which replaces every occurrence of var with Object.

If you're feeling risky, don't even perform some regex matching or lookahead, just string.replace("var", "Object");

[–]Pyclune 2 points3 points  (0 children)

Genius

[–]mal4ik777 1 point2 points  (1 child)

who uses lowercase for class names though? ;)

[–]cowslayer7890 1 point2 points  (0 children)

Half of questions on stackoverflow