Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love how stubbornly plain and lacking in magic Go is. There is almost no hidden control flow, there's no aspect oriented programming, or operator overloading, etc., etc. - pretty much everything the code actually does is in front of you.

I think this means you have a bigger upfront cost in writing code the first time, with the benefit of easier debugging and easy maintenance later (which is a tradeoff I'm very happy to take).



TBH go does have a lot of weird magic stuff.

For example:

- types vs type aliases

- the init function

- how you define a struct can have significant impact on performance. There are lints that align struct better.

- changing a returned value in a defer function. Very useful but can easily hide complexity.

- interfaces are.. weird. They can also easily hide weirdness.


I was not very explicit on what magic means to me (so fair do's). By magic I mean logic of a program which is not plain function calls, conditionals, etc. or unexpected/hidden logic.

In that light, I agree init calls and defers are a bit magic. I'll even add panics in there. But I don't use these much personally, so I'm hesitant to say it is a lot of magic - especially compared to something like Java for example.


Build directives are magic comments. Embed is a magic comment but you also need to import it. Weird magic syntax to declare enums. Etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: