4 ms·
>Java, Go's ... it's syntax is hard to read. Excuse me but Java? This is as subjective as it can be.
by konart 4y ago
>Java, Go's ... it's syntax is hard to read.
Excuse me but Java? This is as subjective as it can be.
- qsort 4y agoJava's syntax is the most bog-standard Algol you can imagine. There's definitely some subjectivity to it, but how is Java hard to read?
- konart 4y agoEverything is too long to read. This is mine personal problem. All java code be lie `public static void SomeReallyLongNameDescribingEverthing42 implements SomeOtherEvenLongerName` For me it's 10 times harder to follow than Go's `if err` blocks (which I actually do appreciate most of the time).
- kaba0 4y agoThat is not a good faith argument.. the only long thing in your example is a name you yourself created, absolutely nothing inherent in the language. But taking your argument in good faith, sure naming conventions are an important part of a language, but Java’s is not “obtusely long”, but “meaningful camel-case”.
- konart 4y ago>meaningful camel-case CamelCase makes it even worse. Short CamelCase is quite okay, but the longer it gets, the harder it on my eyes. But even with short naming it still like 2-3 words just to name a function. wtf.
- kaba0 4y agoIs unreadable abbreviations better? Like, basically everything other than C has full words concatenated in various ways.
- konart 4y agoAs I see it (short version): 1. snake_case - best of the best. words are separated, easy to read even if the words are not in english or latin 2. ShrtCmlCase - worse than snake. Pros: quite short, does not take whole monitor width. Cons: requires additional thinking and some sort of in-team guidelines. Very opinionated. 3. JavaCamelCase - worse than ShrtCmlCase. Pros: you can put in and describe anything in a single name of a class\variable. Cons: you spend too much attention on reading rather than analysing the program. I can understand why Java uses long names though. Its oop and enterprise nature is to "blame". This kind of naming is unavoidable when you are building a giant monolith with hundreds or thousands of classes, all kind of inheritance nuances and trying to have all names actually mean and describe something.
- kaba0 4y agoI frankly don’t see a significant difference between 1 and 3. I do prefer snake case, but it is such an insignificant change that probably the IDE color scheme is an order of magnitude more meaningful.
- Thorentis 4y agoJava's core syntax is very similar to existing languages. Function signatures, loops, var declarations, error handling. Excluding access restrictors (public/private), you could pass it off as C/C++/C#/Python with braces/PHP without $/etc. There isn't a ton about Java's syntax to be super opinionated on, compared to Go, simply due to how unique Go's syntax is.
- konart 4y agoIdk, I don't see much difference between Java and Go (and similar languages). But Go feel lighter and more concise. My main problem with Java code is that it's too hard to read due to endless variables\classes etc names and such. It's almost like reading some Oracle's documentation rather than reading code.
- kaba0 4y agoGo’s function signatures are very hard to parse in my opinion. Like I can literally extract every information from both C-like signatures, from Haskell-like ones as well as Scala/Kotlin-like (var: type), but Go’s is not intuitive at all.
- konart 4y agoEverything is subjective. I find it very straightforward: (x type, y, z type) (a, error) {}. Golang date formatting on the other hand... I still mad an whoever is responsible for this.