Hacker News new | past | comments | ask | show | jobs | submit login

Go is probably most productive language I'd use for CLI tools and quick server stuff. There are libraries for most things you need, often better documented than python counterparts. Single binary and good tooling.

Now, one may hate something about the language but at the end we bite the bullet and get things done.

That said, Go doesn't have a great ecosystem for website backend dev. You can do it, but often less convenient.




When you say website backend dev. What can be improved?


Compared to say Rails/Django, there’s very little magic in the Go ecosystem. You end up rewriting a lot of boilerplate. People would often recommend that you start with bare bones net/http, database/sql, etc., not even a minimal framework like Gin/Echo. This is okay for building performant microservices, but it does get annoying when you’re just trying to spin up your twentieth boring CRUD backend quickly.


I wrote a REST API / boilerplate reducing codegen tool for this exact reason for the Go Fiber framework. Maybe might help.

https://github.com/tompston/gomakeme


as someone not familiar with Go, always wondering why Go people like to recommend the net/http package instead of those framework, are most go backend services actually written from scratch? I find it quite hard to understand since in the Java world it's usually SpringBoot everywhere


I would love to see some "plug and play" user account management. Like handling registration (with confirmation emails), updating/deleting data, build in handling of changing password to increase complexity over time (or forcing change when some leak happen), some protection from login attacks, account levels (and simple adding new level over time), feature toggles, build in multitenancy (so I don't need to code it later when page grow and need it, something like [1]), using ULID (or something similar) instead simple incremental number for ID, build in login history, some login security features (like email on each login, block account login if someone try login from predefined/differen country and email user about that with unblock/allow access link) and more high level stuff (like account anonymising instead of deleting for reporting). So all the stuff that is good to have when you need it but you don't have time to work on it when you focus on business logic.

[1]: https://blog.checklyhq.com/building-a-multi-tenant-saas-data...


Typesafe SQL, typesafe template (or just useful template, not the ones in the stdlib which sucks tremendously), model metaprogramming, etc...


Do you have any examples of other languages offering typesafe SQL integrations? Not sure what to think of it, given how you'd end up having to map SQL datatypes (across multiple database engines) with Go's own (not very powerful) types or a custom type validation layer (which already moves the problem to runtime instead of compile-time).

I did see a post the other day criticizing Go's standard template language and approach. Maybe someday someone will stand up and build an alternative, more advanced template engine - it can just be a library, after all.


In Rust: https://github.com/launchbadge/sqlx In Haskell: https://hackage.haskell.org/package/esqueleto

Either it analyzes the given SQL to determine the in/out types of each SQL query, or it calls the database describe feature at compile-time.


FWIW for SQL, sqlc[1] is probably the nicest SQL layer I've used in any language.

[1] https://github.com/kyleconroy/sqlc


Really, really wanted to use it a few days ago.. but not sure if it's a mysql8 issue but seems most of my "very simple" table definitions couldn't be parsed :/

Looking at the github there seems to a lot of "parsing problems" for the schema files :(




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: