Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Are you using Go for web development?
20 points by open-source-ux on June 26, 2016 | hide | past | favorite | 12 comments
If you're using Go for web development, how have you found the experience?

What made you choose Go? Did you come from another language associated with web development (e.g. Python, PHP, Ruby)? Or did you pick Go as your first language for diving into web development? Have you run into any stumbling blocks?

I've just starting learning Go for web development and would be interested to hear comments and thoughts from anyone using Go for web development.



Coming from C++/C# and having previously used PHP for my web projects, I absolutely love Golang!

I never really liked dynamically-typed languages ... actually I really dislike PHP, but it was ... easy and familiar.

But after just a few days of playing with Golang it just felt right. It's a language to get shit done fast and easy ... and that's the most important thing IMHO.

And yes - I don't miss generics ... at all :>

For the last 14 months I've been working on a self-hosted server for building complex CRUD apps using drag-n-drop in the browser and building it with Go was a great decision.


[deleted]


The site of the project (including demos of built apps for inventory management, accounting, sales management, etc.) will be up and running by the end of the week.

I'll make sure to post it in the ShowHN section. :)


You'll want to take a look at Sameer Ajmani's (Go Team Manager) talk "Program your next server in Go"

https://talks.golang.org/2016/applicative.slide#1

As well as this post on "Go Concurrency Patterns: Pipelines and cancellation"

https://blog.golang.org/pipelines

You'll get a feel for how you can use Go to quickly build and compose distributed microservices that can "time out" but still won't bring down the entire house of cards ;)


I use Go for this sort of thing because it's easier than any of the interpreted options. The language itself is very simple, but the killer feature for me is the simplicity of deployment. I can deploy a Go app simply by sending a single file onto another machine, plus or minus some init scripts.


This, no intricate dependency management or whatever, you just pick what you need, import it and get stuff done.


I have built a lot of random stuff in Go.

I picked up go about two years because it seemed to be a really cool middle-of-the-road language. It wasn't great at anything but was pretty good at most things. Before, I had written a lot of PHP on the web.

No stumbling blocks after getting set up (GOPATH, getting newest version installed). It's always slow to learn something new.

My advice. Do not return dynamic content with Go. If you build a backend webservice in Go that is meant to serve complicated dynamic content (like the way it is possible to do with PHP), you will have a bad time. htmltemplates in Go are not good and you'll waste a lot of time try to live with them. It's better just to return a little bit of info that a front end js app can bootstrap the front-end with.


You know you can use almost any template language with go right? Just look for a package that'll compile into templates then execute them. There are packages for pug (Used to be jade,) amber, handlebars, mustache etc.


I have used it since 2 years ago or so to implement JSON REST APIs and some small admin pages for app backends. I compare with Python which I have also used for this.

Cons:

- More verbose than Python (returning errors and static typing make it not as succint as Python)

Pros:

- Static typing without being too ceremonius (compared to Python it's nice to have some errors catch by the type compiler that would popup in runtime. Refactoring also is nicer with a static typing safenet).

- Easy deployment (rsync the binary to the server and of you go, no more Pip and dynamic libraries bullshit)

- Low memory usage (nice to have the production backend running and see that it uses 15MB of mem where in Python it would be like 10 times more and with worse concurrence)

- Performance (somewhat minor plus for me because the bottleneck is almost always on the database)


I started using Go a few years back for my web based food project. I have loved it so far. I usually program things in Perl, so Go is a nice supplement for me.

Having a single binary to deploy and 1.x compatibility have probably been the two features I like most about the language.

The community is great, and they are always very helpful. I think a great community around a language really makes or breaks a language.


It's a great language for webdev as long as you stick to REST api's with frontends that consume the json returned from it.


In this context, a lot of languages become great for webdev I guess.. :)


almost all of Golangs core libraries are written in Go and are fully open sourced. This makes jumping from your code to the std liberary super easy. Besides all the amazing open sourced projects, the best and easiest way to learn the language is by looking at the Golang source itself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: