6 ms·
Rails is awesome, and so is Django. I’ve built mission-critical apps in both and still do with Python. That said, I’d love to switch to Go for building large mo
by rednafi 2y ago
Rails is awesome, and so is Django. I’ve built mission-critical apps in both and still do with Python. That said, I’d love to switch to Go for building large monoliths since it has a tighter type system and better concurrency constructs.
The problem is, Go community has never really filled that gap. I love Go, but the whole "Go doesn’t need a Rails or Django" mindset is part of why it hasn’t taken off in this space. Building networking tools and CLIs in Go is great, but when it comes to quickly building a full-stack web app, I still reach for Rails or Django. So this whole "X is dead" doesn't apply to Rails at all.
- sigzero 2y agoI don't think Go was trying to capture that space really.
- rednafi 2y agoGo initially tried to capture the C/C++ space and failed miserably. Rob Pike lamented[^1] over that in a famous blog post. It got the most love from people coming from Python and Node. Then it became the defacto language for writing networking tools, and to this day, it holds that crown. Go is in an awkward spot—it’s not dethroning Python because it’s not as expressive, academics hate it, and it’s not as fast as Zig or Rust to appeal to systems programmers. So it only makes sense to target the web services section dominated by Django and RoR. [^1]: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html https://commandcenter.blogspot.com/2012/06/less-is-exponenti...
- __MatrixMan__ 2y agoGo is best at interfacing with kubernetes, which I think will carry it pretty far, for better or worse.
- rednafi 2y agoYeah, Go’s niche is networking. But it could be so much more. The language is nice and fast, and there’s no reason it can’t be a solid choice outside the microservice and tooling universe.
- jen20 2y agoThe Kubernetes API is one of my least favourite Go packages - largely generated, boilerplate all over the show and hasn’t even adapted to use things like log/slog without some wrapper. A much nicer library for dealing with Kubernetes is the kube crate [1] for Rust. The worst aspect of it is the dependency discipline, though that is no worse than the official Go client. [1]: https://github.com/kube-rs/kube https://github.com/kube-rs/kube
- sroerick 2y agoNot too familiar with Go but this makes sense to me. The standard libraries are really great for microservice type stuff. Things that, as a python guy, I would have reached to Flask for. Problem is, I never reached to Flask for much of anything. I’m really having fun with Go these days, though
- rednafi 2y agoGo’s stdlib is almost as good as Python’s—with the bonus of a stricter type system and faster execution speed. Package management in Go is better too, though uv is making Python’s experience smoother. That said, Python is great, and beginners love it. For algorithms and prototyping, I still prefer it. But for writing servers, Go’s stdlib lets me spin up a production-ready, concurrent server using just the basics. What Go lacks, though, is something like Django, which it could really benefit from.
- sroerick 2y agoWSGI was a learning curve for me
- rednafi 2y agoASGI too. But it’s not too bad and tools like Starlette / FastAPI make it a breeze. Go servers are fast but generating docs from code is a lot more work which you get free in FastAPI.
- adhamsalama 2y agohttps://huma.rocks/ https://huma.rocks/ https://github.com/go-fuego/fuego https://github.com/go-fuego/fuego
- lolinder 2y ago> Go’s stdlib is almost as good as Python’s—with the bonus of a stricter type system and faster execution speed Define good, and for what applications? I'm having a very hard time imagining that go's standard library is anything like as comprehensive as python's.
- peteforde 2y agoKudos: I find this to be an exceptionally helpful and concise description of the Go meta. I would offer that Erlang did a good job of capturing the [concurrency?] space, though some of the tooling is showing its age. It's therefore interesting to see Elixir straddle the divide between Erlang and Ruby. I'm still Rails all day, but I've never stopped thinking Elixir is cool.
- out_of_protocol 2y agoWell, i think Elixir/Phoenix is better Rails than real Rails - great developer experience (and developed by rails contributors)
- arrowsmith 2y ago100%. I’m never going back.
- mstipetic 2y agoEvery time I step out of elixir I feel like I’m coding with some cumbersome construction gloves and everything is kinda coerced to work together. But for some reason it’s not picking up a lot of steam and the job situation is rough
- lolinder 2y agoTyped languages are in big time, and any dynamic language is facing an uphill battle for adoption, no matter how good it is. Elixir seems to recognize this and is getting there, but it hasn't fully arrived yet.
- blandflakes 2y agoTypes and editor tooling IMO. Both places they're making investments, but both areas where I feel like I'm giving up a lot of power, even though it's admittedly to GET a lot of power.
- cgg1 2y agoI’m a big fan of Django and Go as well but the only thing in the Go ecosystem that I’ve found that comes close is beego: https://github.com/beego/beego https://github.com/beego/beego But it still needs to mature quite a bit before I’d be comfortable saying it’s anywhere near Django or Rails
- joshlemer 2y agoThere’s also https://www.goravel.dev/ https://www.goravel.dev/
- koito17 2y agoWith tools like ogen[1], one can take a single OpenAPI document and generate server code with a static router, request/response validation, Prometheus metrics, OpenTelemetry tracing, and more out of the box. It can also generate clients and webhooks. Authentication is just declaring a SecurityScheme in the OpenAPI document then implementing a single function. The rest of the backend is just implementing a single interface. Unlike oapi-codegen, there is no need to tinker with routing libraries or middleware for authentication and logging. Pair this with sqlc[2] and SQLite's `pragma user_version`, and you get type-safe database code and database migrations for free. I will concede that adding SQLite is a manual process, but its just two imports added to main.go. Frontend is entirely your choice. Go's standard library provides good enough text templating that I don't miss ERB or Django-style templates. Using the standard library's `embed` package, one can easily embed static assets into a single binary, so deployment can be as simple as `go build` and moving the binary. I have a hard time using languages besides Go for developing backends, because the code generation tools make Go as convenient as frameworks like Quarkus while staying lightweight and fast. [1] https://ogen.dev/ https://ogen.dev/ [2] https://sqlc.dev/ https://sqlc.dev/
- multiplegeorges 2y ago> Frontend is entirely your choice. You are missing the entire point of Rails and making the OP's point for them. > Go's standard library provides good enough text templating Rails offers much more than this, this again makes OP's point for them.
- samtheprogram 2y agoSecond this. My GP missed the point — the integration with front end tooling all the way to the database means you get so much more for free.
- rednafi 2y agoExactly. I don’t want to waste time on trivial decisions like which frontend tool to use or what templating engine to pick. This is exactly why Go isn’t great for building full-stack apps. Every app in Go looks different because you have to assemble all the parts yourself. In contrast, RoR or Django provides a nice rubric to get you up and running quickly. That said, I still like Go when I need to spin up a microservice with a well-defined scope.
- shortrounddev2 2y agoNode/Express is my goto for quick and dirty picoservices that only really run on local developer machines. Asp.Net WebAPI or MVC is my ideal backend stack
- rednafi 2y agoNeat. For me it’s Python FastAPI and then Go.
- WuxiFingerHold 2y agoI was looking for a mature, complete and powerful statically typed stack as well. ASP.NET was my clear answer (not Go or Rust). There's a lot of noise coming from Microsoft to sell their new products (this year: Aspire.NET). But don't be mislead by this noise: .NET Core (C#, ASP.NET Minimal API or MVC, EF Core) is more batteries included and reliable than most other options. The only gripe I have is the need to get into the OOP and DI mindset ("create custom implementations of some abstract classes and put them into DI and the framework calls your implemented methods magically" kind of stuff). Takes some time, but not a big deal for experienced devs (and younger ones can learn faster anyway :-)).
- rednafi 2y agoThe problem is finding fresh blood who want to write C#. RoR or Django is a much safer choice in that regard. This OO/DI stuff has fallen out of fashion (whether that’s good or bad, I don’t know) and very few enjoy working with these constructs anymore.
- tormak070707 2y agoThat's true. Once upon a time when I was intern I was charmed with ASP .NET. Couple of years later I had opportunity to work with Django. Everything looked so batteries included, felt hackable and syntax was friendlier to me (Only exception ORM). Unfortunately project got on hold and I was moved to write new service in ASP .NET. Holding mental model of Dependency Injections, everything OOP, boilerplate produced is cumbersome, CamelCase...
- neonsunset 2y agoHave you ever had to actually hire?
- rednafi 2y agoMultiple times; both in the US and Western Europe. Hiring Juniors for C# was harder than finding Python and Ruby people.
- sroerick 2y agoI’m working on a project in go right now, and I’m really, really enjoying it, but I really do not disagree with you. AI has helped me overcome those framework hurdles. The codebase feels extremely clean to me. My gut still says rails for customer facing, Django for internal tooling or data work.
- teleforce 2y agoThe author of Stanza language has this insightful article on the viability of a programming language for creating a powerful framework like Ruby on Rails [1]. Surprisingly there's no Go and Java equivalent, either it's the incompetence of the programming languages (can't) or the programmers (won't), or both. [1] Stop Designing Languages. Write Libraries Instead: http://lbstanza.org/purpose_of_programming_languages.html http://lbstanza.org/purpose_of_programming_languages.html
- sverhagen 2y agoI've had to do some maintenance on Rails apps in the past, coming from my Java background, and it was painful as hell. It's just what you're familiar with. I can take my Java and Spring Boot, both of which I'm very familiar with, and write an article like that to wonder why Ruby has not something awesome like Spring Boot. But I don't do that, because it'd be equally embarrassing. Spring Boot for me is super productive, has a lot of batteries included, and is a dream to work with, hence I have no desire to play with Rails. Had I stumbled into Rails development, as a career path, I'm sure it'd talk about this the opposite way.
- rednafi 2y agoOTOH, Java almost made me quit and choose a different career. I’ll work with anything but Java. I’ve worked with Python, JS, Ruby, and Go, and I’ve been fortunate enough to avoid working with OO languages. To each their own.
- 2y ago
- joshlemer 2y agoYou could give https://www.goravel.dev/ https://www.goravel.dev/ a look!
- pjmlp 2y agoIt isn't the anti-frameworks mindset, it is also the anti-modern-features mindset. Java, Kotlin, Scala, C#, F#, OCaml, Haskell, D, are also much better for networking tools and CLI. And nowadays people can't even complain the Java AOT options are commercial, or .NET is stuck on Windows.
- rednafi 2y ago> It isn't the anti-frameworks mindset, it is also the anti-modern-features mindset. Touché! > Java, Kotlin, Scala, C#, F#, OCaml, Haskell, D, are also much better for networking tools and CLI. Maybe. But I wouldn't touch any CLI written in a Java, Kotlin or Microsoft Java with a 10-foot pole. YMMV.
- pjmlp 2y agoSo you dump every executable before making use of it?
- lapusta 2y agoI could really recommend Encore https://encore.dev/ https://encore.dev/ that works best when you use their PaaS offering https://encore.cloud/ https://encore.cloud/ (think of NextJS & Vercel combo). One can argue it goes against some of the Go principles, but it's a really nice stack for solos or small teams without dedicated SREs. And as you grow you can BYOC & deploy it yourself or completely rewrite your API layer using Go stdlib. You would still need NextJS or Remix/RR7 for the front-end, but one nice thing is that it would auto-generate the client SDK in TypeScript which makes integration a breeze. And while I personally prefer Remix/RR7 for frontend, Encore has integration with Vercel PR feature which is really hard to beat.
- krschacht 2y agoRuby has Sorbet if you want to add typing. And better concurrency constructs for Ruby are in the final stages of being backed with Fibers. For example, Falcon is the new Ruby web server that’s built with Fibers. It’s not quite ready to replace Puma but Fibers are coming along.