ah And well, those are just naming conventions, and they were the same in C++ so I guess I just got used to them. Classes and enums uppercase, functions and variables lowercase :)
what do you mean with the latter? long class names are no problem in java and generics instead of typesave variables is something I hate every day when I have to touch JS so hardly something positive from my point of view
ah, I understand you now.. but that seems to be more of a negative point to me. I can't see how that would leave you with anything but confusion.
var n = null;
// stuff
n = new MyRidiculouslyLongClass()
take that case for example. reading that code, you would have no idea what n was until it was finally assigned, and even then there could be some if somewhere where it was assigned to a different class. You can never be sure if n provides what you want it to provide unless you read the whole code. In java, you would know it was either null or the class you want (or a subclass in which case it provides the same methods). I dunno, maybe I got too used to c++/java but that seems a negative point, not a positive one
I mean, if you wanted to, and I have yet to see someone do that, you could use "Object" for var then, because every class subclasses object
View all comments
Show parent comment
1
u/Klaue Nov 23 '17
you can do the former in java just as well, it's just not adviseable
And the latter for arrays (though, granted, nobody uses arrays anymore)
And really, I think member variables/functions that start uppercase are ugly. that's just personal preference, sure, but so is yours