Live data from Hacker News

Lies we tell ourselves to keep using Golang

fasterthanli.me

71–80 of 561 posts

Re: Lies we tell ourselves to keep using Golang

#71

This is an opportunity piece written for no reason other than to ride the wave from a recent re-post of a 2 year old blog article. It offers nothing over the original blog post and it's difficult not to be cynical about the authors intent with this article.

>ride the wave from a recent re-post of a 2 year old blog article

You've been here a decade! This is part of the HN experience. I'm sure we'll have an Atlas Obscura submission about the scintillating history of Serbian skin-contact white wines later today.

Re: Lies we tell ourselves to keep using Golang

#72

> Why does the Go compiler suddenly care if we provide explicit values now? If the language was self-consistent, it would let me omit both parameters, and just default to zero. Without analyzing the rest of the post (which I read without having the skill to fully comprehend), this stuck out to me. Perhaps the language behaves one way and not another by design? It's abstraction. By using a Struct, I'm telling the func…

It is a very minor point and could easily be removed from the article, but I had that realization while writing those samples and it stuck with me.

I really think that if we follow the "zero values by default" philosophy, it wouldn't be shocking for Go to accept omitting function arguments and just zero them.

The fact that it doesn't, and insists on you passing the right number of arguments, makes the point that you can't in fact, just afford to zero out everything that isn't explicitly specified.

Re: Lies we tell ourselves to keep using Golang

#74
I'm not emotionally attached to Go, I want to learn rust, and I'm old enough to realize the search for the perfect tool is utter folly. So the inevitable religious wars that surround critiques like this don't move the needle for me.

So while this article didn't really convince me of anything, I have to admit I did learn a thing or two (or five). Kudos to the author, who is a fantastic writer and communicator. Even if you aren't neck deep in the language wars, it's worth reading.

Re: Lies we tell ourselves to keep using Golang

#75
post #25

Quoted post unavailable.

I agree that this article is low-quality and self-contradictory, and flagged it too.

However,

> It reads as an asshole college sophomore who rips on plebs who dare to have different perspectives than them

This is going a bit too far, don't you think?

Re: Lies we tell ourselves to keep using Golang

#76
post #36
post #10

Oh no, here we go again. So you don't like Go (no idea what this "golang" thing is everybody keeps talking about)? That's cool! You don't have to write yet another blog post saying that you really, really don't like it, with more strawman arguments and again quoting that quoted-to-death quote by Rob Pike about Go being designed for stupid developers, we got you the first time!

BTW The official github organization is literally "golang" https://github.com/golang

Yeah, "golang" is the standin for when "go" is already taken (https://github.com/go). But still, the official name is "Go", and there's no good reason to not use it in the title of a blog post (other than SEO I guess)...

Re: Lies we tell ourselves to keep using Golang

#77

I don't know nothin' about Go. But this complaint really surprised me: > Go not letting you do operator overloading, harking back to the Java days where a == b isn't the same as a.equals(b) Does this guy really not understand that in a mutable language, (eq ...) is not the same as (equalp ...) and should never be confused with it? Also: operator overloading is the spawn of Satan.

Usually you do want to compare by value, so it should get the obvious syntax. When you want to compare by reference, you should write if(&a == &b) or ReferenceEquals(a, b) or something.

Re: Lies we tell ourselves to keep using Golang

#78
I guess that, like everything, it depends on what you're using it for and which compromises one is willing to do.

I'm not proficient nor use at $DAY_JOB C, Go or Rust. However, I wanted to write an Emacs dynamic module and those were my main choices AFAIK.

I've picked Go to write a grunt work module (fetching JSON, parsing it, transform it, send back to Emacs) and it's been smooth sailing.

I then found the benefits of writing client glue code between Minikube, direct K8s and Docker and Emacs a breeze.

What lie am I telling myself?

Re: Lies we tell ourselves to keep using Golang

#79

Im a go noobie so I had a question about the following. > Go's lack of support for immutable data — the only way to prevent something from being mutated is to only hand out copies of it, and to be very careful to not mutate it in the code that actually has access to the inner bits. I thought everything was handed out as copies in go by default unless a pointer was being passed. So this would make it “easy” to tell wh…

> I thought everything was handed out as copies in go by default unless a pointer was being passed. So this would make it “easy” to tell whether you are mutating a object or not.

The first bit is correct.

The point the article makes is that, to know whether a variable is potentially mutated, you have to go look at the signature of any function called on it. E.G. you can't just look at main and "know" whether a will get mutated or not, you have to also look at the signature of `Changed`. In C, with the following code

    #include 
    struct test {
 int value;
    }

    int main() {
        struct test a = test { value: 1 };
        Change(a);
        printf("a.Value = %d\n", a.Value);
    }
I can be 100% sure that a is never mutated, because it is passed to change value, and won't get automatically turned into a reference. Had Change be called with `&a`, then I'd know that a potentially gets mutated.

In Rust, `a` would have to be declared mutable to start with, e.g.

    fn main() {
        let mut a = A { value: 1 };
        a.Change();
        println!("{:?}", a);
    }
The above, I know that Change can potentially mutate a. And if a had been declared `let a`, I can be 100% sure that change cannot mutate it.

The direction go took is in line with many other languages (I think C++ behaves this way, it automatically turns values into references based on function signature).

Re: Lies we tell ourselves to keep using Golang

#80

Im a go noobie so I had a question about the following. > Go's lack of support for immutable data — the only way to prevent something from being mutated is to only hand out copies of it, and to be very careful to not mutate it in the code that actually has access to the inner bits. I thought everything was handed out as copies in go by default unless a pointer was being passed. So this would make it “easy” to tell wh…

Having followed language wars for a while as a relative newcomer to programming (longtime lab rat type), my present conclusion is that languages are just tools, comparable in my experience to different laboratory techniques and instrumentation. Different tools are appropriate for different purposes. Some are a lot less convenient than others to set up and use. Some are so obscure that nobody really supports them anym…

I definitely see that languages are just tools and you pick the right one for the job.

I guess the confusion for me is, languages often have overlapping usecases with slightly different semantics/syntax.

How do we objectively evaluate what is better? is it industry adoption? academic praise? im sure theres an answer to that but i havent went down that rabbit hole yet

Post reply on HN