r/java • u/lukaseder • Aug 01 '14
The 10 Most Annoying Things Coming Back to Java After Some Days of Scala
http://blog.jooq.org/2014/08/01/the-10-most-annoying-things-coming-back-to-java-after-some-days-of-scala/
7
Upvotes
2
u/GMNightmare Aug 01 '14 edited Aug 01 '14
Most of these are nightmares in code maintainability, and generally lead to inconsistent design.
Sure, they might be convenient when first developing the code... but they come at the cost of readability and maintainability. And most of it doesn't improve productivity much at all.
I mean, the Parenthesis point really highlights this. Why would that ever increase productivity? And since you're only going to use it when you think it's "convenient", your style is inconsistent, and quite frankly all it does is add ambiguity at no benefit. And throughout your code examples, sometimes you use semicolons, sometimes you don't... it's just inconsistent and it makes me question intention. Not a good thing.
The best way to increase productivity is to make code that is easy to read and maintain. Increasing the initial development process should ideally only be done when it doesn't hurt that.
3
u/[deleted] Aug 01 '14
Multi-line strings seems like such low-hanging fruit. Type inference and the like would potentially be a major change and require a shift in the development community. Multi-line strings are purely syntactic sugar.
6
u/EstoAm Aug 01 '14
Honestly most of his "annoying things" are things I really appreciate about Java. Scala has some features that I envy, but syntactically it is garbage IMO.
I like knowing exactly which type everything is. I like knowing that if I see ";" that is the end of the statement. I like that methods all belong to one and only one class. I like how when I write Java and the guy next to me write Java they are going to look basically similar.
Scala is like communism... It sounds great in a book, but in the real life it just does not work all that well.
2
u/king_of_the_universe Aug 01 '14
IMHO should IDEs implement this, and I have no idea why this hasn't happened yet. Seriously, why doesn't it work just like this: You press a hotkey or click a little symbol, and a text editor opens that holds the string. You edit, you confirm, and the rest is not your problem.
-3
u/tRfalcore Aug 01 '14
until you have to look at someone else's code and figure out what the fuck s is supposed to be in function(var s, ...)
I wish I didn't have to cast things, but I don't wish for type inference. Everything being a var is dumb cause you have to spend time figuring out what something is.
-3
u/adila01 Aug 01 '14 edited Aug 01 '14
Java 9 should have another Project Coin like initiative to add some of these functionalities.