Live data from Hacker News

Go, or Ruby or ExpressJS for an API?

news.ycombinator.com

11–19 of 19 posts

Re: Go, or Ruby or ExpressJS for an API?

#11
Ruby if you want quick /initial/ development.

Go if you need performance, but slower development time.

ExpressJS/Node for neither. Just kidding, it might be sort of like a combination of the two, moderate development and moderate performance. Though, this sort of makes it's usefulness moot for me, but that's /just/ me. I either the fastest development time, or fastest application. Both usually ends in a clusterf*ck of some kind (IMHO).

Personally, though, I wouldn't use any of the above except Ruby and would use something JVM based. Play! is a mature framework, it's fast, and is easy to use/deploy. It also comes in both Scala and Java varieties.

I've used everything mentioned but Go, and the JVM keeps coming back to haunt me because it's fast as hell and has TONS of libs.

Re: Go, or Ruby or ExpressJS for an API?

#12
I've just finished building an API in Go, and my experience was:

You have to write more actual code than in Rails (or even ASP MVC), so it takes longer to develop, but it's much more satisfying.

I'm not 'web-scale' so the speed differences didn't actually matter that much. I didn't optimise for speed and the benchmarks were still impressively exceeding our requirements.

The standard library is amazing in places, but there are some libraries (gorilla in particular) that are almost obligatory.

If you have to write 2 API's you'll re-use a lot of code... you've effectively rolled your own API framework.

If your editor can handle snippets, make one for "if err != nil{" since that's a good 25% of any go program it seems ;)

Go is deep; the tools are deceptively simple and amazingly powerful. I refactored a lot as I went along and discovered better, more elegant ways to do things I'd brute-forced on the first iteration.

It was fun! Go is a really lovely language to code in.

Re: Go, or Ruby or ExpressJS for an API?

#13
post #9

Earlier quoted context omitted.

Why do you consider it wrong? It seemed almost ideal especially expressjs when breezing through the dev docs

As I said, I've used Sails.js. Their ORM is subpar, doesn't even support associations yet. By wrong I meant that where Node.js shines most is in its unified approach to client/server relationships. Since you're building an API (as in server-side logic with world-facing endpoints) you may want to stick to Rails, since it's great at that out-of-the-box, for tried-and-true.

You can't judge the platform by one framework. Node.js also shines in concurrency and networking, which are valuable things for an API, and allows you to offer streaming endpoints with ease.

Re: Go, or Ruby or ExpressJS for an API?

#15
post #3

Depends on your needs. If you need to get something up and running quickly, I would recommend you stick with Ruby. If you can afford some extra time to learn a new framework then both Go or Express/Node.js are great options that would enhance your skill set. Node.js and Go are both growing quickly in popularity. They're much faster on the execution side than Ruby and provide additional optimization opportunities via…

Do you have any benchmarks between go and node? I'm so curious about this.

Here's a couple links that touch on Node.js vs Go performance.

http://jaxbot.me/articles/benchmarks_nodejs_vs_go_vs_php_3_1...

https://news.ycombinator.com/item?id=6649606

Re: Go, or Ruby or ExpressJS for an API?

#16
I think the best platform to begin with is the one you are most familiar and comfortable with. Node and Go both have performance benefits over Ruby. If you are a fan of the intricacies of javascript, you can give Node a shot. I don't think Go has much of an ecosystem compared to Node yet.
Post reply on HN