Hacker News new | ask | show | jobs
by yarou 4234 days ago
A bit OT, but probably the biggest roadblock for me switching over to Go is the wonky syntax. Are there any plans to make Go more accessible to someone coming from more traditional languages? (i.e. like "do" notation in Haskell) I've done the Go tutorial about 5 times last I checked (seriously), and I just can't stomach the syntax. I may be tainted by my years of C, though.
3 comments

What?! If anything, your use of C should make Go's syntax really familiar (aside from putting the name before the type, which doesn't take long to get used to). It's exactly like any other C-like imperative language. C, C++, Java, C#, even Javascript. Those are pretty traditional langauges. Haskell is not what I think most people would call a "traditional language".

What exactly is your problem with the syntax?

My point about Haskell was not to say that it was more intuitive for imperative programmers, rather, it was to demonstrate a syntactic sugar construct that eases programmers in. Because Go's syntax is so similar to C, it is confusing because as a coder, I can only context switch a finite amount of times.
> I just can't stomach the syntax. I may be tainted by my years of C, though.

I can't relate to this.

That's exactly my years of C that makes Go quite attractive to me. The way I see Go is that it allows me to code as close to metal as C, but without the pains of C -- headers, make file/dependencies, memory management, and more.

> code as close to metal as C

> without ... memory management

Read again. As said "as close to ... but without", I didn't say "close to". If you are unable to make sense of what I wrote, don't blame me for your shortcomings.
You appear to know both Haskell and C, but find Go's syntax hard to deal with? This is one of the weirdest Go complaints I've read, for sure. Syntactically, it's just one of the many Algol/pascal-style imperative languages of the last 40 years. Most people get used to it quickly.

At least it's nice and unambiguous.