6 ms·
The beauty of rails is how simple and quick it is to get a robust (if bare) application up and running. Even if you use sinatra or padrino instead, the wealth
by munmaek 7y ago
The beauty of rails is how simple and quick it is to get a robust (if bare) application up and running.
Even if you use sinatra or padrino instead, the wealth of the web community built around ruby still makes it rather easy.
If I were a tech lead and had to make a choice now, in 2019, I would still (probably) choose rails-api for a backend with some separate frontend.
I've been slowly working on a backend for a web app in Rust, and it's really made me realize the sheer amount of things rails provides for you. It has its problems, of course, but so does everything else.
- duncan-donuts 7y agoI lead the work of node APIs but have always worked on convincing people Lumen/Laravel/Rails would be a good choice because of the ecosystem and opinions. Even in the node/express world it’s insane how much rails does for you over express.
- zerkten 7y ago> I've been slowly working on a backend for a web app in Rust I'm interested in why you made the choice to use Rust for a web app? It feels like you love a good challenge, but there are obviously technical constraints for some apps. I look around and wonder if the options have really changed a whole lot since 2006? If you need productivity, choose Ruby or Python (or maybe JS.) Java and .NET exist if you have more exacting performance requirements (these platforms are somewhat more pleasant in 2019 and I see Go as joining their ranks.) Or, you choose to go really low-level with C/C++, or perhaps Rust in 2019. The latter never seemed like a viable option unless you had extreme performance concerns.
- faizshah 7y agoOr if you need both, Yehuda Katz's company Tilde made a library that can help you write code in Rust and use it in Ruby. So if there's a critical path in Rails that you need to speed up in Rust you can do that: https://www.youtube.com/watch?v=lBapt5YDDvg https://www.youtube.com/watch?v=lBapt5YDDvg https://github.com/tildeio/helix https://github.com/tildeio/helix
- AlchemistCamp 7y agoOr if you want productivity and a performant web server, try Elixir + Phoenix. Number crunching still has to be dished off to something else like C, Rust or Go, though.
- bjz_ 7y agoThe lack of a type system in Elixir is a productivity killer though :(
- Dangeranger 7y agoYou can annotate your types if you want and get a lot of editor benefits. Also, I don’t buy the “we need strong types for everything” argument, as optional typing in Clojure, JavaScript, and now Ruby gives you lots of benefits without having to think all the way through the app’s architecture.
- chessturk 7y agoCan you give me an example of this? I'm genuinely wondering if I've just dodged a pain point so far. My other strongest languages are Golang and JavaScript, so I'm used to (duck-)typed and untyped approaches, and I've never felt that Elixir was difficult to work with because of the lack of types. I've treated pattern-matching like type inference, and as long as you have guard clauses, the worst that can happen is a runtime error which you "let fail" anyway. I guess the guard clauses are a bit of boilerplate, but I feel like these complaints have a different root. I just don't see it yet.
- girishso 7y agoThere’s no type system in Ruby too!
- strzibny 7y agoI think combination of type annotations and pattern matching actually works pretty well. Yes, it's not Rust though:)
- simplify 7y agoAgreed. If Elixir had static typing then Phoenix would be my dream framework!
- geowwy 7y agoRuby and Python aren’t any more productive than C# or Java in my opinion. Especially when you consider the errors static typing helps you avoid.
- munmaek 7y agoI would say the productivity comes from the established community around Ruby, when it comes to web development. It's true that you end up running into certain types of bugs that a strongly typed language would've caught immediately, but in java/c#/rust you end up having to hand implement more stuff depending on what you're doing. Ideally I would use rust, but I also think Ruby can work quite well if defensive programming practices are followed, as well as running linters, static analyzers, etc. Most issues seem to stem from poor architecture or tightly coupled, dense code.
- munmaek 7y agoI just like using Rust. This is a small side project of mine so it's been more fun to experiment with using Rust to make a backend api than to stick with rails. I also recently dealt with maintaining / upgrading a large, not well architected rails app. Debugging mysterious issues in Rails (and asp.net webapi2) sucks compared to Rust. For a professional project I would largely go with rails, depending on the situation. asp.net isn't bad either.
- batiste 7y agoDid RoR people ever fixed their monolith inducing architecture?
- WillPostForFood 7y agoSometimes it is a feature, not bug?
- diveanon 7y agoWhat's there to fix?
- batiste 7y agoPrincipally the file organisation that pretty much forces you to stick all your controllers in one single directory. If you want to create a truly modular application (think microservices) RoR defaults seemed to work against you.
- diveanon 7y agoI understand what you mean, but that is one of the trade offs when using opinionated frameworks. I've found that a more effective way to achieve the same results as microservices is to deploy the monolith to multiple servers and have each one acting in a specialized capacity. This tends to make testing a lot more consistent and improves code reuse dramatically. If you really want to make it modular you could always package the functionality you want to share into gems.