News for hackers. Stuff that matters.
Re:One Year After Switching from Java to Go: Our Experiences by throwaway2037 on Tuesday February 18, 2025 @10:17PM (#43098179)

    > The biggest selling point of Go to me is that I can usually just look at anyone’s code and know what it’s doing
This is not possible in Java or C#? Both of those languages are so simple to grasp.
Re:One Year After Switching from Java to Go: Our Experiences by zdragnar on Tuesday February 18, 2025 @10:24PM (#43098215)
The languages aren't, strictly speaking, so much the problem as are the massive frameworks configured via distant files with lots of DI and reflection magic involved.

Go has some large frameworks, but the community frequently suggests they aren't needed and that the standard library is enough.

Re:One Year After Switching from Java to Go: Our Experiences by demi56 on Wednesday February 19, 2025 @12:23AM (#43098856)
So the community influences the language, not the language that influence the community that explains everything
Re:One Year After Switching from Java to Go: Our Experiences by rob74 on Wednesday February 19, 2025 @02:50AM (#43099710)
Well, it's a bit of both. Java is of course very influential, and because it uses a framework for web applications, many languages/communities started imitating that (Ruby/Rails, PHP/Laravel, JS/[Framework_of_the_day] etc.). Then Go came along with its back-to-basics approach and its standard library which is "batteries included" but definitely not a framework, and for some this is a breath of fresh air, while for others it's apparently unbearably alien and backwards...
Re:One Year After Switching from Java to Go: Our Experiences by gf000 on Wednesday February 19, 2025 @06:03AM (#43100819)
I'm fairly sure that most of these frameworks are not direct imitations of what Java did, and there was a back-and-fort co-evolution where standard CRUD web applications can be written in a very very productive way (for the small price of learning a framework).

Sure, reinventing the wheel is fun, but if I can finish a whole project while the equivalent go code can finally return "Hello world", then I'm not sure it's a worthwhile tradeoff. Java is not anemic when it comes to its standard library, people moved to frameworks because a good deal of CRUD apps have to solve some of the same problems. Don't forget, the only silver bullet is reusing existing code.

Re:One Year After Switching from Java to Go: Our Experiences by demi56 on Wednesday February 19, 2025 @08:07AM (#43101703)
I would say the leaders(could be the creators) of the language plays the most important role in its infancy the decisions they make defines what decisions the community are gonna make and the was what Go made right, Java been a business oriented decisions made by the community will also be business oriented
Re:One Year After Switching from Java to Go: Our Experiences by Cthulhu_ on Wednesday February 19, 2025 @08:16AM (#43101802)
Exactly; if you ask about for example a test assertion or mocking library like in Java, you get told to not use it. These libraries often add a DSL of sorts, meaning you have to relearn them.

Granted, Go's testing library / setup is also a bit of a jump from regular Go code (especially things like table tests). But the assertions are just `if`s.

Re:One Year After Switching from Java to Go: Our Experiences by lelanthran on Wednesday February 19, 2025 @01:27AM (#43099187)
> This is not possible in Java or C#? Both of those languages are so simple to grasp.

Not really, no.

Apart from the cognitive burden of knowing the test framework in use, the DI tooling in use, the Mocking framework in use, plus all the annotations that each framework may want/need, almost none of which applies to the Go projects I've seen, the languages themselves have drifted away from simplicity.

I used to program in C# but left it for a long time and only recently looked at it again. C# is approaching C++ levels of syntax indecipherability.

Re:One Year After Switching from Java to Go: Our Experiences by zigzag312 on Wednesday February 19, 2025 @03:32AM (#43099933)
> C# is approaching C++ levels of syntax indecipherability.

Can you post an example of such new syntax? In my experience C#'s syntax is getting cleaner.

Re:One Year After Switching from Java to Go: Our Experiences by gf000 on Wednesday February 19, 2025 @05:56AM (#43100780)
C# tends to accumulate a lot of new features, but Java has a bog-standard syntax and even new features are very carefully added and easily guessable even if you haven't seen them before (e.g. switch expressions vs statements).

There is absolutely nothing more readable in Go than in Java, it's just classis familiarity (referencing the simple vs easy talk), I would even wager that too little expressivity will actively hinder code understanding.

(It's much easier to understand the intent of a complex stream API "pipe" than 4 nested for loops with ifs, with a bunch of dumb if errs pretending to be error handling).

Also, you are comparing a complex framework that solves 70% of your problem domain (at the price of a bit of a learning curve) with a vanilla Go project that only calls libraries. The exact same is more than possible with Java, it just doesn't make much sense in case of CRUD apps because better ways exist.

Re:One Year After Switching from Java to Go: Our Experiences by CharlieDigital on Wednesday February 19, 2025 @07:27AM (#43101322)
Kinda disagree on C#

It's actually converging with JS and TS

Small repo: https://github.com/CharlieDigital/js-ts-csharp

Re:One Year After Switching from Java to Go: Our Experiences by spicyusername on Wednesday February 19, 2025 @08:23AM (#43101876)
Gotta disagree for C#.

It definitely has more language features than Go, but by no means is indecipherable.

I find C# syntax to be quite crisp.

Re:One Year After Switching from Java to Go: Our Experiences by rapsey on Wednesday February 19, 2025 @02:28AM (#43099570)
Programs written in those languages tend to have many layers of abstractions, on top of abstraction heavy frameworks.
Re:One Year After Switching from Java to Go: Our Experiences by nprateem on Wednesday February 19, 2025 @06:07AM (#43100840)
Try understanding what spring boot is doing. Annotation soup. It's practically impossible for a beginner to Spring to debug.
Re:One Year After Switching from Java to Go: Our Experiences by mattgreenrocks on Wednesday February 19, 2025 @08:15AM (#43101788)
IntelliJ seems able to locate all potential implementations at injection points just fine.
Re:One Year After Switching from Java to Go: Our Experiences by gf000 on Wednesday February 19, 2025 @07:02AM (#43101149)
I mean, would you be able to pilot an airplane at first try? Does it mean that it is badly designed?

Frameworks reverse who calls who, it is your code that will be called at certain points, not the other way around. Obviously, one has to learn a bit about the framework before touching one, blindly copy-pasting from stackoverflow/chatgpt is not software develolment.