Re:A minimal blog engine written in Go, compatible with Ghos...
by monk_e_boy on Saturday April 25, 2015 @06:00PM
(#9439700)
How did using Go feel compared with other languages, I'm a php, ruby, python guy. Just wondering your opinion on why you chose Go?
[ Parent
| on HN ]
Re:A minimal blog engine written in Go, compatible with Ghos...
by Kabukks on Saturday April 25, 2015 @07:49PM
(#9439951)
I chose Go because I wanted to learn it ;) In retrospect tough, I couldn't have wished for a better language to write a web server in. I especially like the opinionated handling of code formatting and memory safety (it won't let you compile if you have a unused variable for example) and the consistent error handling (I know, a lot people seem to dislike Go's error-oriented programming style).
Re:A minimal blog engine written in Go, compatible with Ghos...
by wting on Saturday April 25, 2015 @08:25PM
(#9440042)
Unused variables have nothing to do with memory safety. At most they'll take up some stack or heap space.
https://en.wikipedia.org/wiki/Memory_safety
Memory safety is enforced in Go via best practices–like C and C++ ecosystems. However because of gc and channels race conditions happen less often in Go but there's no explicitly tooling to prevent them from happening:
Re:A minimal blog engine written in Go, compatible with Ghos...
by Kabukks on Saturday April 25, 2015 @08:38PM
(#9440073)
You are right. I was thinking about the general fail-safety of my programs. Not letting me compile saved me from overlooking a (return) value more than once.
Re:A minimal blog engine written in Go, compatible with Ghos...
by threeseed on Saturday April 25, 2015 @08:47PM
(#9440086)
You could accomplish the same thing by incorporating a code checker as part of your build process.
That way you would be catching a lot more code issues then just unused imports, variables etc.