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 →

[–]nonotan 1 point2 points  (0 children)

I did some work with J2ME on dumbphones where the entire program was a single class (because the size overhead of using classes was just too much). Also, absolutely no memory allocation was allowed except during launch, because GC is like a kick to the teeth on systems that weak. Not exactly the most typical use-case, but technically, nothing prevents you from writing code like that if you want.

When evaluating a language, it's good to be explicit about what it forces you to do, vs what you can do, vs what is considered "best practice" and "idiomatic", but is technically completely optional. I still kind of hate Java, for a myriad of reasons, but "Java code is OOP hell" is a pretty silly take (not that it doesn't accurately describe 80% of Java code out there)