Hacker News new | ask | show | jobs
by EugeneOZ 3725 days ago
Huh, funny enough - Go was my first try to replace PHP, but as I don't share opinion "copy-paste is better than generics" and "executable comments are ok", I tried Rust, and now I have REST API with 10000+ LOC - it serves multiple web apps and works just awesome and I really feel fun of programming and I'm enjoying language. So "I don't know why you'd want to write a web app in Rust" sounds ridiculous for me. Really, "I don't know why you'd want to write a web app in Go".
1 comments

"executable comments are ok"? Where did you hear that?
Go has many "special comments" that actually do stuff:

* build tags (https://golang.org/pkg/go/build/)

* code generation (https://blog.golang.org/generate)

This is the exact point where you start to see that the Go creators are ok with hackery as long as it works and doesn't make the overall design too complicated.

It looks like we agree Go has "special comments", not "executable comments".

I recognise that Go' special comments can be seen as a hack, but honestly they are not so different from Rust's attributes or Haskell's pragmas, which can look clunky too.

No way. Comments are comments, attributes are attributes. Previous discussion: https://news.ycombinator.com/item?id=9522973
Bingo.