Rewrite it in Rails
The author developed a customs declaration app in Ruby on Rails, faced challenges rewriting it in Rust and SvelteKit, and ultimately returned to Rails for its rapid development benefits and collaboration.
Read original articleIn 2022, the author began developing a customs declaration application using Ruby on Rails after experimenting with various programming languages and frameworks. Despite initial intentions to rewrite the application in a different language, the Rails version quickly gained functionality and user approval. The author then attempted to create a "version 2" using Rust and SvelteKit, but faced challenges in feature completeness and development complexity. Over time, the Rails application continued to evolve, while the new stack struggled to deliver value to users. Eventually, the author recognized the need to revert to Rails for parts of the application, acknowledging the framework's strengths, including its mature ecosystem and ability to facilitate rapid development. The experience underscored the importance of making trade-offs in web application development and highlighted that no framework is perfect. The author concluded that returning to Rails allowed for increased productivity and collaboration with colleagues, while also emphasizing the value of learning from different programming languages and frameworks.
- The author initially chose Ruby on Rails for its familiarity and speed of development.
- Attempts to rewrite the application in Rust and SvelteKit faced significant challenges.
- The decision to revert to Rails was based on its strengths and the need for rapid feature delivery.
- The experience highlighted the importance of trade-offs in web development.
- Learning from various frameworks ultimately improved the author's programming skills.
Related
Rails Is Good Enough
Onur Ozer discusses the lasting significance of Ruby on Rails, highlighting its use by startups and large companies, its productivity, and its ability to simplify web application development over two decades.
I'm Back, Ruby on Rails
The author reassesses Ruby on Rails, praising its stability, built-in features, and supportive community, while highlighting its advantages for rapid development and deployment, making it suitable for startups.
Ruby on Rails continues to thrive
Ruby on Rails, established in 2005, remains a powerful web development framework favored for rapid project initiation, scalability, and strong community support, with major companies continuing to rely on it.
Rewrite It in Rails
The author developed a customs declaration app using Ruby on Rails for its speed, later attempted a rewrite in Rust and SvelteKit, but reverted to Rails due to user needs and challenges.
Ruby on (Guard)Rails
Mike McQuaid highlights Ruby on Rails' rapid development benefits and runtime error challenges, advocating for tools like Rubocop and RSpec, and promoting incremental improvements and type systems to enhance software quality.
> Does it turn into unmaintainable spaghetti code after a while? Only if you let it. It's typically caused by developers, not programming languages or frameworks.
After running a number of rails applications in production for going on a decade, this is really hard, and I find it to be one place where rails (really ruby) doesn't help much.
Of all the languages we work in (and it's quite a few), ruby has the worst support for modern language tools: the LSP implementations are weak, and don't play well with containerized development environments. Typing efforts are fractured, and the official way is... well.. it's bad. This is exacerbated by ruby's tendencies towards "fluent" interfaces, which is actually code for lots of methods that take undocumented hashes of arguments --- and hash access with strings and symbols? nightmare fuel.
But I still come back to rails. It's productive, it's fast enough, it scales just fine, and perhaps most importantly there's a "right" way to do just about everything your web application will ever need to do: background jobs, websockets, read-only database replicas.
All in all, its still my recommendation for new web projects going into 2025.
Best sentence in the article. I’ve worked in well-organized and reliable PHP apps, and giant buggy abortions in TypeScript. Lots of Rails apps with varying degrees of quality. Languages and frameworks can’t fix disorganization, poor architecture, laziness, or most of all, ignorance of how the Web should work (and why.)
The main predictor of how good your app will be technically, is the skill level of your worst developers + how much your best developers care (or are allowed to care, which necessarily varies with business conditions). Regardless of if you’re using trendy languages like Rust, TS, etc.
Of course, while as hackers we desperately wish for the app to be of very high quality, the sad truth is that companies who always obsess over the finest details under the hood don’t tend to perform as well financially as the ones who make compromises to get things to market faster and pivot more effectively, so I think that’s why most of us have rarely worked in commercial codebases where nothing is embarrassing.
So far rails has been my favorite to rediscover, I used it 10 years ago and boy has a lot changed!
I was hoping to like django more since I'm a professional python dev, but django felt like I was still clobbering together libraries (whitenoise, celery, etc) and it doesn't have a great front end story.
Laravel was super slick, but I just can't do PHP. I know it's come a long way but it's just not for me.
Rails really stuck for me the most and I really like the hotwire paradigm. As a dad with limited time for side projects Rails is going to be the tool for me now to spin up something quickly.
I'm actually porting over a current side project to rails and stumbled on this magical gem called "Brick"[0]. You just point it at your existing DB then it reads the current state of the database and makes active record models in memory for you to play with. You can then eject the models and controllers into your code base, and bam you have your model layer recreated in rails.
There's a huge amount of value in having an ecosystem of components that are designed to work together, and randomly choosing "oauth X" and "smtp Y" components and trying to string them together, vs using a battle-tested and supported stack, just invites a lot of hurt.
If you have a team of Java web app devs, having them build a web app in Rust or Go will be incredibly costly and inefficient. It seems very obvious to me, but I still get people that say "oh, it's not that hard - library X can do all of that other stuff"... but inevitably it can't. And the communities of people doing web app stuff in (Rust, Go, Scala, etc) just aren't big enough to provide the community support other frameworks provide.
Kudos to the author for their epiphany.
Actually, in recent Rails versions the mistakes of Webpacker have been replaced with much more flexible gems for building frontend assets with esbuild, vite, or any other build tool.
This gives the ability to seamlessly blend the nice pre packaged rails ecosystem with the nice ecosystem of react components or other modern frontend tooling most people are using.
I close this comment with mentioning: you still may not need all of that new stuff! What does your app actually do?
Rails' is what people are going for when they choose it, not Ruby (generally speaking... there are obviously people who like Ruby). Rails provides all of the tooling, conventions, and ecosystem needed to tackle a great deal of web development projects.
Rails is a great example of a killer application. People learned Ruby just so they could use Rails. Wanna make a bread-and-butter website, just build it in Rails. Three-quarters of what you need is available in the framework itself and most of everything else is a library that integrates seamlessly with the framework.
If you need to use a systems-level language to solve a technical problem, you'll know exactly why you need to go through the trouble. If you're using maxims to justify your choice, you have no idea. "Because it's blazingly fast," doesn't matter if -- as the TFA points out -- your most heavily-trafficked endpoint is serving a p90 of < 400ms, your team is delivering the features you need on time, and your users are happy.
I think there are lots of good reasons to use a Rust-based framework. I work in Haskell full time. I get it. But there are huge trade-offs. The most obvious one is that almost no SaaS or open-source components you use will ship Rust or Haskell SDKs. They will ship libraries that integrate with Rails.
I'm not a particular fan of Ruby itself but I can appreciate the value that Rails brings. The interview with DHH was quite interesting... DHH is not someone I find I've always agreed with but his opinions nonetheless always seem reasonable and thoughtful. It seems useful to have someone that Zigs when the rest of the industry Zags.
In my opinion the ionvestment is not so much in the code, than in the design.
I am working on an app that has a frontend in Django and the backend in Go and when I make changes to the Go side I just feel a lot more confident it'll all work as intended. Compared with Django I keep finding myself in the weeds debugging why some random dependency is misbehaving which is difficult because python allows you to do some really heinous stuff like instantiate classes that are chosen using runtime configuration.
Related
Rails Is Good Enough
Onur Ozer discusses the lasting significance of Ruby on Rails, highlighting its use by startups and large companies, its productivity, and its ability to simplify web application development over two decades.
I'm Back, Ruby on Rails
The author reassesses Ruby on Rails, praising its stability, built-in features, and supportive community, while highlighting its advantages for rapid development and deployment, making it suitable for startups.
Ruby on Rails continues to thrive
Ruby on Rails, established in 2005, remains a powerful web development framework favored for rapid project initiation, scalability, and strong community support, with major companies continuing to rely on it.
Rewrite It in Rails
The author developed a customs declaration app using Ruby on Rails for its speed, later attempted a rewrite in Rust and SvelteKit, but reverted to Rails due to user needs and challenges.
Ruby on (Guard)Rails
Mike McQuaid highlights Ruby on Rails' rapid development benefits and runtime error challenges, advocating for tools like Rubocop and RSpec, and promoting incremental improvements and type systems to enhance software quality.