4 ms·
In my personal opinion it's a great language to solve problems _I_ have to deal with in course of my work. Can I solve them with Java? Sure. Difference is go
by konart 3y ago
In my personal opinion it's a great language to solve problems _I_ have to deal with in course of my work. Can I solve them with Java?
Sure.
Difference is go does not have the complexity you can find in Java and quite opinionated. So you don't have to spend as much time working with the language inself and can focus on getting the job done.
Go is not as expressive and some other languages and does not have the same abstractions that make other languages more suited to be used while developing comlex software.
Thing is - in many cases you simple do not need any of it, but need a fast verbose language with good tooling.
Call it Java Light or something.
- za3faran 3y agoCould you elaborate on exactly what complexity in Java you're referring to? By having an overly simplistic language, you end up pushing more complexity onto the programmer and into the code base. There is no free lunch. I find it much more sane to solve and express code in Java. You get terser, more to the point code that reflects the underlying logic more clearly, compared to having to read many lines or pages to understand what's going on.
- konart 3y ago>By having an overly simplistic language, you end up pushing more complexity onto the programmer and into the code base. There is no free lunch. Sure, I just don't see this as a problem. As a result you have a) a number of third party packages to chose from depending on your needs\opinions b) you have a more verbose codebase, some people find it harder to deal witih while I find it easier to deal with. >compared to having to read many lines or pages to understand what's going on. Different people different ways of thinking I guess. In my eyes Java code looks to much like a specification in for of a code. Easier to do a code review but harder to actually understand how it works. And I personally need this dive into internals to actually feel confident about the code. >Could you elaborate on exactly what complexity in Java you're referring to? I don't have too much experience in Java, but from what I've seen - Java has too many abstractions and OOP for the sake of paradigm and nothing else. UPD: adezxc's comment is a good addition to mine
- adezxc 3y agoIt is frustrating to read Java code. I don't want to understand your abstractions or class definitions like final, static and whatever. I don't want to learn about Gradle or Maven to understand how a package is working, I'd rather do it in code. Consider even the current "Hello, world" example in Java (Yes, I know about the proposal about simplifying it), it is tedious, why would I need to understand public/private and classes before launching a simple program? I fully agree it is a terrific piece of software, especially for industry-grade applications, yet it just isn't attractive. Main thing IMO, is that you can start out writing pretty good Go code after 24 hours and just improve on your skills as a general programmer. With Java, after a few months you would still need to know about some methods or OOP tips/tricks, design patterns etc. to become proficient.
- kaba0 3y agoThere is no going around abstraction, that’s a necessary part of any non-trivial program as that’s the only method we have to control complexity. Your struct is also an abstraction, you could have defined another one, use it differently, etc. Many of the design patterns are useless bullshit, that is long superseded by a language feature, so that point doesn’t stand imo. Go also has public/protected, it is just case-specific. If anything, that makes it harder to understand, how should I knew that Asd is different from asd beforehand?
- konart 3y ago>If anything, that makes it harder to understand, how should I knew that Asd is different from asd beforehand? By reading docs or some kind of "Go by Example"? The same way you learned the difference between `private` and `protected`.
- adezxc 3y agoIt is easier to know that lowercase is package-specific, uppercase is exported, than knowing which field is private/public by default. Go reserved keywords: break, default, func, interface, select, case, defer, go, map, struct, chan, else, goto, package, switch, const, fallthrough, if, range, type, continue, for, import, return, var Java reserved keywords: abstract, continue, for, new, switch, assert, default, goto*, package, synchronized, boolean, do, if, private, this, break, double, implements, protected, throw, byte, else, import, public, throws, case, enum, instanceof, return, transient, catch, extends, int, short, try, char, final, interface, static, void, class, finally, long, strictfp, volatile, const, float, native, super, while.
- kaba0 3y agoJava is absolutely not a complex language. The “enterprise java” style is an unfortunate one that can actually be traced back to C++, but it is not a necessity at all, and due to the sheer size of the java ecosystem you will find plenty of examples of a more barebones approach — also supported by the language developers. I fail to see why I would go with go over java, besides.. perhaps some CLI app? With Graal even that can be implemented in Java.
- konart 3y ago>The “enterprise java” style is an unfortunate one >but it is not a necessity at all The thing is in real life you have to deal with this kind of code most of the time. Because most of the time you deal with the old code or people who are used to some patterns you have to use too because you are part of the team. Go enforces (kind of) a more barebones approach by default. PS: I think it's poinless to compare two languages. We should rather compare real practices and read examples.
- kaba0 3y agoAd absurdum than a new language will always be better, because usage patterns change and the new language doesn’t yet have any existing code bases using the old ones.