Earlier quoted context omitted.
>because it prevents you from building abstractions, Replying to just this part of your comment, but building abstractions can be as much a source of new complexity and cognitive overhead as it can reduce them. I think Go is wise to be on the side of less abstraction, because most of the abstractions it makes hard end up hurting more than they help. >What an extremely convenient template to dismiss any nuanced argume…
> because most of the abstractions it makes hard end up hurting more than they help. You got any proof for that?
I want off Mr. Golang’s Wild Ride (2020)
341–350 of 477 posts
Re: I want off Mr. Golang’s Wild Ride (2020)
#342Earlier quoted context omitted.
It requires several additional lines of code just to bubble up an error, for starters, and there's nothing stopping you from ignoring errors and continuing with what could easily be corrupt data.
The latter is a much stronger argument than the former (no idea why people get so worked up about character counts), but even then, "shit" is really strong considering how often one experiences exception traces when using an application written in Python or Java or some other exception-based language. Point being, we should probably evaluate error handling schemes based on results rather than ideology (even though I…
Re: I want off Mr. Golang’s Wild Ride (2020)
#343Earlier quoted context omitted.
What an extremely convenient template to dismiss any nuanced argument against "worse is better". You even get to question my credentials a couple times! (I apparently pick metrics that are convenient to my argument, and fundamentally misunderstand programming language design). Even if I accept the premise that "I'm challenging Go on things it doesn't promise to deliver" (which is disingenuous to begin with — correctn…
> What an extremely convenient template to dismiss any nuanced argument against "worse is better". Nuance is exactly what I'm arguing for, there's none in the article. > You even get to question my credentials a couple times! (I apparently pick metrics that are convenient to my argument, and fundamentally misunderstand programming language design). You're right, I apologize. I usually try hard to never directly addre…
I don't think that is clear at all in the general case. There's no reason why we should believe that "something had to be traded off to achieve it". In some cases probably that's what happened, maybe even explicitly, but in other cases there are just some designs that are better than others.
Re: I want off Mr. Golang’s Wild Ride (2020)
#344I use Golang professionally every day, and these aren't the sorts of things that I run into. Then again, we run everything on Linux.
One thing I wish Golang had was the ability to easily deep clone things. Especially if you have a struct with nested struct _pointers_.
Options now are manually doing it field-by-field (error prone, if a new field is added you might miss it); using reflection (yuck!); or marshalling to JSON and back again.
Another thing is when reading to/from JSON, being able to differentiate between a field which doesn't exist ("undefined" in Javascript), or is null. Unfortunately some third-party APIs I interact with treat "null" as a command to remove the field. But if you use `omitempty`, you can't have null at all.
Other than that though, it's a treat to work with!
Re: I want off Mr. Golang’s Wild Ride (2020)
#345> It is a minefield of subtle gotchas that have very real implications Perfectly describes my 10+ years with the Node ecosystem. Not that it's a bad thing necessarily. I've made it my niche and the knowledge I've accumulated has made for a great career. But still, I understand the narrative.
And the most interesting thing to my mind is how little the subtle gotchas matter. The key is they're subtle. If a subtly-wrong design takes only 20% of the code of the truly-correct design to express and understand and it works for 99% of the cases, then there's actually a benefit to a lot of users of using that architecture. If you end up in the swamp outside the happy path you can get badly burned, but that's the…
Still don't care because 80/20?
Re: I want off Mr. Golang’s Wild Ride (2020)
#346A two year old rant that everyone saw the first time about a language which has subsequently changed significantly is not in any sense "hacker news." It is "old hacker opinions."
> I wrote this in 2020, and have changed jobs twice since. Both jobs involved Go in some capacity, where it's supposed to shine (web services). It has not been a pleasant experience either - I've lost count of the amount of incidents directly caused by poor error handling, or Go default values.
Re: I want off Mr. Golang’s Wild Ride (2020)
#347Earlier quoted context omitted.
Yeah, and I kind of did that. But I've found it annoying and not great. For example in the base struct I had an interface and a ton of methods that use it. Then when I declared the concrete struct, I have to manually point the concrete type that matches that interface to the base class's interface. Composition doesn't really allow the same thing as inheritance. Composition typically means you'll have a motor and whee…
Seems pretty straightforward to me: type Car struct { Motor Motor Wheels [4]Wheel } type Motor interface { Rev() } type KiaMotor struct { ... } func (kia *KiaMotor) Rev() {} func NewKiaCar() Car { return Car{Motor: &KiaMotor{ ... }} }
In your case you're making a Kia car by making a regular car with a Kia motor.
In my case (at work) I'm making a type KiaCar struct { Car ... }.
Which is why I have to link a concrete type in the KiaCar to the Car if I want methods with Car receivers and KiaCar receivers to use the same concrete Motor.
I do like what you've written above though. I'll consider if I can use that instead of what I'm doing currently.
I'm just not entirely sure how I'd write methods for the KiaCar that knows what its concrete type is.
Re: I want off Mr. Golang’s Wild Ride (2020)
#348I liked the article. I think it was really well written and these are great points. So if not Go, then what's the alternative? I too am starting to feel a bit burnt out by some of Go's deficiencies, but one of the things I really like about Go is its concurrency model. What other languages have great concurrency models? Please keep in mind that I want to keep things simple... having a single binary to deploy is incre…
For what it's worth, the deployment story for Elixir is great. Erlang has a built-in concept of "releases", which Elixir supports natively.
In essence, it compiles all dependencies and outputs a directory containing the VM, and all the compiled bytecode. After that, you just copy the directory to /app on your runtime container (or whatever other kind of deployment method you're using), and it runs fine from there.
Re: I want off Mr. Golang’s Wild Ride (2020)
#349I'm baffled that the Go designers for a long time basically considered generics to be harmful - but had no problems adding reflection to the language.
Re: I want off Mr. Golang’s Wild Ride (2020)
#350Earlier quoted context omitted.
Fair question, here's a few: - object methods cannot be passed as arguments to a function or another method like regular functions can because they lose their 'this' pointer. - array.sort() is broken. It does the sort in-place and converts the elements to strings before sorting . - const doesn't support separate declaration and assignment. This makes it harder to conditionally decide what to assign to a variable whil…
That's a good list, and I was right; I've been at this so long I've forgotten that most of those are 'WAT' to the average user. Regarding `object methods cannot be passed as arguments to a function or another method like regular functions can because they lose their 'this' pointer.`: yeah, the fact that JS objects are actually kinda weird li'l things is frustrating. There are nowadays two ways to handle that: - refer…
Just to share an experience on the other end, I worked with Erlang several years back. While it was a harder language to learn, every new thing I learned about the language gave me the impression that the language designers did the right thing.
Don't get me wrong, I'm having fun with my current Typescript/NodeJS stack at work, but if I was building my own stuff it would absolutely be on the Erlang VM.