4 ms·
I'd rather think they hate it for being a word salad with lots and lots of boilerplate. Go has its issues, but that isn't one of them.
by yxhuvud 4y ago
I'd rather think they hate it for being a word salad with lots and lots of boilerplate. Go has its issues, but that isn't one of them.
- kaba0 4y agoHave you seen the two languages, like.. ever? I’m sorry for the harsh language, but Go is literally much much more verbose than java, and not just recent Java that has since improved, even Java 8.
- Cthulhu_ 4y agoCitation needed; first off, verbosity is not the problem, verbosity is NEVER the problem; any significant codebase will end up with millions of LOC (and tokens) regardless of language choice. Second, Java's infamous for having VeryLongClassNameFactoryBeans on the one hand, and deep class hierarchies on the other, with new classes being declared for everything. Third, it depends. You can set up a HTTP server in two or three lines in Go without 3rd party dependencies. This [1] is the shortest Java versions I've found, and it contains a lot more magic. I'm biased in favor of Go, but verbosity is not the issue there. [1] https://stackoverflow.com/questions/3732109/simple-http-server-in-java-using-only-java-se-api https://stackoverflow.com/questions/3732109/simple-http-serv...
- kaba0 4y agoWe were talking about PL features, and now you bring up a style of writing said language (which by the way comes from very different times and is no longer the norm)? Composition over inheritance has been a mantra in Java circles for a very long time now. The important difference is for example that Go can’t have proper error handling no matter how good the developer is, due to the language not having a proper abstraction over that.
- seti0Cha 4y agoThat's a feature not a bug. Go intentionally forgoes abstractions of that sort. I personally prefer well written Java exception handling, but often Java exception handling code is a bolted on afterthought. Go's approach is to make error handling something you have to think about for virtually every line of code, rather than a superstructure built around the code. This can feel slow and painful to write, but it guides the developer toward considering each error case individually, potentially resulting in more nuanced responses to errors. It also makes reading the code dead simple.
- kaba0 4y ago> Go's approach is to make error handling something you have to think about for virtually every line of code But that doesn’t work, and you can’t handle every error at the place of its origin.
- seti0Cha 4y agoSeems to me like it does work, based on many successful projects using it. There's nothing that forces you to handle the error at the place of origin, you can pass it on like you do with exceptions. You just can't bubble it up multiple levels.
- sorokod 4y agoLooks like four lines of main() code, the rest is a specific hadler that would be needed regardless of language. What part do you find magical?
- deleted 4y ago[deleted]
- twic 4y agoTo be clear, you think this (using the web server built into the JDK): HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0); server.createContext("/test", http -> http.sendResponseHeaders(200, -1)); server.start(); Contains too much magic?
- ihateolives 4y agoNo, but nobody's going to use it. They're gonna Spring Boot all the things anyway, no matter how small the task, because "you might need it in the future". CRUD API with 4 endpoints? Spring Boot! Logging server? Spring Boot! That's where the magic is.
- ohgodplsno 4y agoWhereas the brave Go developer is going to rewrite a half baked implementation of Spring Boot for every service that ends up growing a little bit more than expected, all on the default go server. Weeeeeeee
- lenkite 4y ago"Second, Java's infamous for having VeryLongClassNameFactoryBeans on the one hand, and deep class hierarchies on the other, with new classes being declared for everything." I have always wondered why Java is hammered for this while Apple is celebrated for this. CMMetadataFormatDescriptionCreateWithMetadataFormatDescriptionAndMetadataSpecifications(allocator:sourceDescription:metadataSpecifications:formatDescriptionOut:)
- the-alchemist 4y agoI almost didn't believe you there! https://developer.apple.com/documentation/coremedia/1489454-cmmetadataformatdescriptioncreat https://developer.apple.com/documentation/coremedia/1489454-... "Creates a metadata format description by extending an existing description with the values you specify." The description doesn't sound so bad...
- jjav 4y ago> I have always wondered why Java is hammered for this while Apple is celebrated for this. Indeed. And it's good to remember that there is nothing in the Java language forcing one to name things verbosely, that's on the developer's personal choice. Just like on every other language.