One year after switching from Java to Go
401–410 of 503 posts
Re: One year after switching from Java to Go
#402I am sure Go has many benefits, but coming from .NET I don't see a big improvement in switching to Go. .NET feels less verbose, it's batteries included, has an AOT compiler, tons of libraries, starts fast, has very good tooling and performance wise it compares well to Go. Also, it can be used for more than web apps and command line tools. Where I see a benefit, though, is using go in a large greenfield project becaus…
The big change is cultural. The places I've seen using .NET felt like cults to me, a monoculture were everyone must run windows, swearing by how powershell is the shell of the gods, ms sql being the only true data store that's the best solution for 100% of every use cases, azure being the best cloud provider, and everyone forced to use vs code because of all its fancy integration with even the pm tools.
Re: One year after switching from Java to Go
#403Earlier quoted context omitted.
At work we work on a Java code base 20 years old and it is written like C. No dependency injection or other Java Web development like shenanigans. Almost every lib etc has been built in-house. It runs an MMO, it's fast. Its just way more productive/faster to work and implement something in the Java codebase than a C++ codebase that we have. Someone shared a Job posting which asked for "no java experience". It was fun…
It's kinda understandable. I've seen "Java coders" write Python for example. The first thing they do is create a class and maybe even a Factory or Interface. You can see instantly where their experience is from and it's hard to unlearn.
Re: One year after switching from Java to Go
#404Earlier quoted context omitted.
AFAIK, the basic issue is still open at https://github.com/golang/go/issues/33803 and https://github.com/golang/go/issues/59715 . You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs . Go 1.19 only had this in its notes for memory changes "...includes support for a soft memory limit. This memory limit includes the Go heap and all other me…
> ...includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program" Of course it’s a runtime setting, it won’t affect other factors but you can’t say it didn’t solved anything “…
Neither Go 1.19 nor any subsequent version has "solved" this issue.
Re: One year after switching from Java to Go
#405A typical no network initialized service in Java would start under 500ms (a p90, give or take).
Re: One year after switching from Java to Go
#406Earlier quoted context omitted.
With a 1980's technology out of Xerox PARC, it is called IDE.
Exactly. Although from the reply I got above it seems to be alien tech to some.
Especially that we are not even talking about own code, but third-party annotations with its third-party consumers. Also, grepping is a pretty standard term, it doesn't necessarily mean literal CLI grep, but go on with your advanced tooling as if no one else would be familiar with an IDE.
Re: One year after switching from Java to Go
#407Never quite understood the attraction of dependency injection frameworks. Sure pass in your dependencies as an interface via some sort of constructor, but why all the frameworks to do so? Why all the complexity with hard to debug magic strings, annotations and finding out what's missing from the classpath at runtime? Just seems as a very complicated way to avoid creating package c that brings together package a and d…
Many years ago there was a running joke that a "dependency injection framework" in PHP was a single array with stuff in it.
Then it all became much more java-like.
Re: One year after switching from Java to Go
#408Earlier quoted context omitted.
To me the implication is that the culture at this company won't allow this team to master Go either, and in a few years there will be a post describing how they moved from Go to another language. Many people like to write about how Golang is so simple, but the drawback of that simplicity is that many features of other languages are either covered by additional dependencies or by inflating code size. It's just as poss…
Golang's standard library looks pretty complete to me and they will probably master it in a month.
For example, what do you think the following should print?
values := []int{4, 8, 15, 16, 23, 42}
for value := range values {
fmt.Println(value)
}
I don't think there are very many people who would guess the integers 0 to 5.I also like the following one:
ch := make(chan int)
ch
What would this print? The only correct answer is sadly "fatal error: all goroutines are asleep - deadlock!".Golang is a fine language and simpler than most, but sadly "simpler" is not the same as "simple".
Re: One year after switching from Java to Go
#409Earlier quoted context omitted.
I don't see that as a problem at all, just like I don't see header files in C++ as a major problem, there are benefits as well and Java has the best IDEs of any language I've worked in except maybe SmallTalk.
Let me know when you can work on a medium-sized Java codebase in Emacs or Vim smoothly.
Re: One year after switching from Java to Go
#410Earlier quoted context omitted.
Maybe go just isn’t for you? It really doesn’t need every feature of other languages. The error handling is ideal for me, better than any other language. You are always explicit, with every function call, about “what could happen if this fails?” Maybe passing it up the stack is the best way to handle it, but also maybe it’s better to handle it somewhere in the middle. The thing that always happens with exceptions in…
Exceptions are a terrible idea. However, I strongly prefer rust error handling to Go. go: (res, err) := foo() if err != nil return err (res, err) := bar(res) if err != … Equivalent rust: let res = bar(foo)?)?; I think go should add the ? sigil or something equivalently terse. Ignoring all the extra keystrokes, I write “if err == nil” about 1% of the time, and then spend 30 minutes debugging it. That typo is not possi…
I hear people say this frequently, but don't ever hear people actually state the case.
My experience is that particularly for web back-end exceptions have been incredibly useful, but I'm interested in the counter view.