Live data from Hacker News

From Node.js to Go

bowery.io

31–40 of 192 posts

Re: From Node.js to Go

#31

Earlier quoted context omitted.

You may wish to explore Rust - http://www.rust-lang.org/ . I can't speak to tooling but it has advanced typing and ease of distribution seems similar to Go. Edit: mea culpa for my attempt at tongue-in-cheek humor, "I think that's called Rust - http://www.rust-lang.org/"

Rust's type system is definitely more robust than Go's, however it's also a different language and different philosophy. Go was created to be easy to read and easy to write, which is mirrored in the language (e.g. no generics). Rust is more complex, which might be a factor when deciding between Go and Rust. Plus it does not have the same adoption in the industry as Go.

No argument here. OP specifically mentioned advanced typing, tooling, and distribution. Rust covers at least two out of the three (can't speak to tooling) so I thought OP might like to explore it a bit.

Re: From Node.js to Go

#32

"but he didn’t learn his lesson there" This set me up for a negative article about Go, but, like other Go-related materials, it makes me want to use it. I should use it.

"Something must be done. This is something. Ergo, we must do it."

Why should you use it? What problems does it solve for you?

Re: From Node.js to Go

#33
I'e been writing my first production-sized Go app over the last few months, and really enjoy it. Some observations:

- The standard library is solid, and I was surprised how well-rounded and mature the third-party library support it. Coming from a Python/Ruby background, that was nice to see.

- I totally agree with the comments on this thread about dependency management. Godep [1] is nice, but it would be great to see a canonical dep management tool for go.

- The tooling for Go is excellent: More languages need something like "go fmt".

- In general the document is solid, but I've found the usability of the generated docs to be poor. You think they could bribe a few Google designers to spend some time fixing that...

- I've noticed a lot of Rust lovers commenting about how great Rust's type system is. It probably is, but I haven't run into any problems with Go's type system. I've found it to be practical and easy to use. The only issue is parsing JSON when you're not marshalling it to struct. They need to fix that (although there are some nice third-party tools to make it easier).

- Go is a minimal language and has been called boring. [2] I don't claim to be an expert yet, but I don't think I've reached this level of productivity with a language this quickly before.

[1] https://github.com/tools/godep

[2] http://stevebate.silvrback.com/go-is-boring

Re: From Node.js to Go

#34

Go does lack quite a bit of the web pizzazz you'd find in rails, but I learned a lot more by writing web things in go than I did in rails because so much less of the magic is hidden away from you.

This was something keeping me back from Go before. However, in 2015 when you're doing so much more on the client, and things like Angular and React are available, this concern becomes reduced or eliminated.

Re: From Node.js to Go

#35
post #28

> Go is a compiled language so distributing applications for use on multiple platforms is just easier. How is this a true statement? Ease of distribution isn't a function of a language's runtime environment (native vs interpreter).

Sure it's a true statement. Even if you have to compile to different targets (and you do), that's much simpler than implementing shared dependencies on those different targets. When you deploy a binary with no external dependencies, you can (generally) set it and forget it. It's not to say there aren't meaningful differences across targets you need to account for, but it is "just easier" in my experience.

So, it's not a function of compiled vs interpreted. It's about a single binary vs shared resources.

So while you can't get a single binary with an interpreted language (you need the shared runtime), however you can also get shared libs using a compiled language.

I've found doing cross platform development using NodeJS significantly easier than using C++ (of course I had to use compilers that didn't default to IEEE 764).

So old.

Re: From Node.js to Go

#36
post #2

Go is definitely promising but the last time I checked the problem with web development with Go was that there is no mature libraries for User authentication etc(Please correct me if I'm wrong). This makes going with Node or something like Rails more tempting.

I wrote a Go Web Application with authentication and an API to learn Golang. I must say, writing an API and some other services (SMTP pipe listener) was much nicer in Go than Authentication. There is gorilla/sessions for sessions, but there's a lot to be desired here. A weak secret here means other people can decrypt the SessionStore Blob and possibly get secret information as a passive attacker or authenticate as an…

I think those issues will improve over time with maturity. Golang seems to not like to do things in more than one way, as the article stated. Currently there is competing solutions to all of those problems[1]. I suspect you won't see built in solutions until community libs and users choose the prevailing standard solution to each problem.

To also be fair, web apps are nodes bread and butter, not so much so for Golang (apart from maybe api's - which tend to have pretty straight forward auth mechanisms and dont require csrf, xss or templating solutions, traditionally anyway). With that in mind I wouldn't be surprised if go's devs continue to leave web solutions up to the community. I expect to see a lot of frameworks come along similar to pythons django, rubys rails, and phps laravel.

Disclaimer: non elitist node dev, closely watching go

[1] https://github.com/golang/go/wiki/Projects

Re: From Node.js to Go

#37
post #36

Earlier quoted context omitted.

I wrote a Go Web Application with authentication and an API to learn Golang. I must say, writing an API and some other services (SMTP pipe listener) was much nicer in Go than Authentication. There is gorilla/sessions for sessions, but there's a lot to be desired here. A weak secret here means other people can decrypt the SessionStore Blob and possibly get secret information as a passive attacker or authenticate as an…

I think those issues will improve over time with maturity. Golang seems to not like to do things in more than one way, as the article stated. Currently there is competing solutions to all of those problems[1]. I suspect you won't see built in solutions until community libs and users choose the prevailing standard solution to each problem. To also be fair, web apps are nodes bread and butter, not so much so for Golang…

I agree. Go was really nice to write code in since I do a huge variety of system level and Web things. It's my goto for practically everything now.

It will get better but for now I think writing a full web-app in Go, (presentation etc) is pretty annoying.

Re: From Node.js to Go

#38
post #9

For me the single biggest disadvantage of Go against Node.JS is the lack of a decent dependency management solution. NPM is awesome and Go doesn't even have a "meh" answer to that.

NPM is only awesome until you need to do something with it on Windows.

Never had any problem with it when we did a Cordova based application for a customer of ours.

Re: From Node.js to Go

#39
post #9

For me the single biggest disadvantage of Go against Node.JS is the lack of a decent dependency management solution. NPM is awesome and Go doesn't even have a "meh" answer to that.

Maybe it's just me, but I really like the way Go does package management. Not needing to publish to a central place for packaging is awesome (just have it on any website), but I agree that it needs reorganization (godep is a step in the right direction)

Re: From Node.js to Go

#40
I'm having a hard time enjoying Go. It just reminds me a little too much of Java, and I programmed in that language for way too long. After I finished my test program, I uninstalled the toolkit from my system. Right now, I feel that there's no perfect language for me. I do love JavaScript, but there are some things I wish they'd fix. And it takes browser makers way too long to support the latest features. Been messing around with Erlang. Kind of an interesting language.
Post reply on HN