15 ms·
Rails for everything
- phoronixrly 2y agoThe essential convention over configuration ideas still prevail when you want to pile on functionality quickly and without boilerplate.
- FigurativeVoid 2y agoI was going to write a bite more about convention over configuration in regards to AI, but it didn’t feel super tight. I think that the doctrine of convention over configuration leads to content that is much more legible to LLMs in training. I find querying Claude for Rails issues to be really helpful. I suspect would be very helpful to a novice.
- loktarogar 2y agoAi also works better with more mature frameworks that have a lot of examples/questions/posts on the internet where the API has been mostly the same for a while, like Rails
- krschacht 2y agoI too find Claude for Rails to be really helpful, except for some of the newer features in Rails 8 for which there is a lot less documentation. I use Claude within Cursor and it has the ability to at-mention documentation so any time I run into this I just follow up with “Can you please double check the @rails8 docs and try again.” (likewise for @stimulus and @hotwire docs)
- mosselman 2y agoIf you want to only use sqlite, I suggest looking into litestack: https://github.com/oldmoe/litestack https://github.com/oldmoe/litestack I've not used it myself, but I am going to rewrite one of my projects that I only use locally from postgres to litestack. The benchmarks are incredible! https://github.com/oldmoe/litestack/blob/master/BENCHMARKS.md https://github.com/oldmoe/litestack/blob/master/BENCHMARKS.m...
- jherdman 2y agoIs this really necessary given the advances with SQLite in Rails 8? What edge does this have over what’s included these days?
- adamtaylor_13 2y agoLitestack provides numerous benefits, but the largest is live replication to S3-compatible storage, which SQLite will not do by default.
- tillcarlos 2y agoAre you confusing it with Litestream, the backup solution? https://litestream.io https://litestream.io What they meant was https://github.com/oldmoe/litestack https://github.com/oldmoe/litestack which has a lot of things built on top of sqlite, like job queue and caches. Rails 8 now comes with most of them out of the box. My SaaS ran on litestack until rails 8 came out, then I switched without problems.
- adamtaylor_13 2y agoAhh, yeah you’re right. My bad. Litestream was what I was thinking of.
- mosselman 2y agoVery good question, I don't know. Ideally you'd stick with the most vanilla stack, being solid queue, etc. However after trying solid queue in my production environment with Postgres I was left very disappointed at the reliability and speed. This could've been some misconfiguration on my part though. Another thing that I noticed is that if you compare litestack's benchmarks to solid_cable (for example) litestack claims to outperform redis whereas the argument for solid_queue is that it is slower, but worth the simplicity of 'just using the database': https://github.com/rails/solid_cable?tab=readme-ov-file https://github.com/rails/solid_cable?tab=readme-ov-file All in all I would prefer 'the standard' solution, but I am interested in experimenting with litestack. After all that is what side projects are perfect for.
- ajmurmann 2y agoI've been building some apps with stacks lately that are supposed to be more modern and performant. Namely an app with Spring Boot and another with Micronaut. Both had a React frontend. It really made me appreciate Rails' omakase approach. Just having a form that shows validation errors from the backend and having something as simple as Rails' flash messages isn't solved by the frameworks themselves and requires you to build it yourself or find a third-party solution that might or might not do the basic thing you need or might or might not be well-supported. Rails truly solves the problems 90% of web apps share. It might not be in a way that's perfect for your specific project but it will likely work and you can swap it out one you've validated you app or feature.
- neeleshs 2y agoSpring boot has form validations pretty much out of the box, via validation annotations.
- ajmurmann 2y agoIt does have validations but the integration of then in Rails goes much further. In Rails you associate the form with the model and the validation errors somatically show up on the form.
- olavgg 2y agoThe biggest difference here is that Spring Boot has the errors in a seperate object BindingResult. If you use Thymeleaf, this is smoothly integrated and you just write: <p th:if="${#fields.hasErrors('comment')}">Invalid Comment</p> Grails Framework (Spring Framework more like Rails) integrates errors directly into the domain model, so if you have a domain class Person, it was extended with person.errors property.
- nesarkvechnep 2y agoI'm amazed that some people think that coupling your forms to your database models is a good practice.
- ethagnawl 2y agoInbuilt authentication is a very welcome addition. I've been using Django instead of Rails for the last 4-5 years (for business reasons) and that was one of the features Django provided which, upon reflection, seems like table stakes for a modern web app. The other glaring omission being an inbuilt admin interface -- which may have been added after I moved on.
- weaksauce 2y ago> The other glaring omission being an inbuilt admin interface -- which may have been added after I moved on. with scaffolding and other rails generators with custom templates is that really a big asset? might not look amazing out of the box but you can find css templates easy enough too. maybe they should make an admin generator but rails is king of crud and if you need it ootb you can use one of the many gems.
- ethagnawl 2y agoI think so. You could also make that same argument about the new authentication feature, ActionStorage/Jobs/whatever. Yes, of course, _there's a gem for that_ but after having used Django, it's really very nice to have those features included and not have to spend any time thinking/arguing about which Gem to choose and remembering/endeavoring to keep that Gem patched, etc.
- weaksauce 2y agothere's also administration-zero which is basically scaffolding for admin pages and would be similar to what they'd give you built in if they were to. they consider it outside the scope of rails' responsibility as scaffolding is so easy to make. administration zero doesn't do much other than install a few gems, and include a scaffold that you can use to generate admin pages akin to django but you do get pagination and search and filters added on top. no magic though just rails scaffolds. https://github.com/lazaronixon/administration-zero https://github.com/lazaronixon/administration-zero
- krschacht 2y ago
- Kerrick 2y agoSince Rails 8 I’ve even found myself using Rails + Sitepress over a static site generator. Kamal makes it really easy to run multiple lightweight sites on a cheap VPS writing even less configuration than Nginx, so it saves time up front. Plus, nearly every static site ends up with someone saying, “oh I wish I could ____, but it’s a static site.” Instead of needing to pick a client-side-only solution, use a third party service, or integrate with a cloud Functions as a Service provider, Rails and a production-ready database are right there ready to help.
- sroerick 2y ago> Kamal makes it really easy to run multiple lightweight sites on a cheap VPS writing even less configuration than Nginx, so it saves time up front. Save me from my free tier GitHub pages / Netlify / SaaS hell. This is the hottest tip in this thread imo
- lolc 2y ago> Save me from my free tier GitHub pages / Netlify / SaaS hell. Depends on how you like your hell: Now you're on the hook for security updates to the full stack.
- ezekg 2y agoAfter using SQLite in production for a little while, I don't think "SQLite is all you need." Migrations are a pain, so any long-lived app will eventually experience pain. As an example, SQLite doesn't have a way to add a NOT NULL constraint to an existing column; you have to rebuild the entire table using a temp table.
- FigurativeVoid 2y agoHuh. TIL. But in the rails context couldn’t you mostly manage with an ActiveRecord validation? I know it wouldn’t be ideal.
- cjk 2y agoThis is perhaps what you were hinting at when you said “wouldn’t be ideal”, but Active Record validations on their own are subject to race conditions with concurrent requests. The only truly safe way to ensure integrity of your data is to enforce validations/constraints at the database level. IME you usually want _both_ the Active Record validations, and the database-level validations, because you get better error messages from the former, and the latter is just a safeguard.
- FigurativeVoid 2y agoNo I agree. I always want a belt and suspenders with my data validations
- masklinn 2y ago> As an example, SQLite doesn't have a way to add a NOT NULL constraint to an existing column; you have to rebuild the entire table using a temp table. Or any other constraint for that matter, every few months I look for ADD CONSTRAINT again, only to rediscover there isn't anything. The lack of any sort of PL language (or even just trivial stored procs aliasing queries) also makes migrations more annoying, CTE can handle some of the load but the verbosity and limitations of basic SQL make that awkward, and needing to round-trip through the host language for everything is frustrating (even more so when the host language is statically typed and thus requires adaptation out).
- rich_sasha 2y agoAs someone who doesn't do enough web dev to justify learning Ruby just for Rails: how does it compare to Django? That's the only batteries-included web backend framework I'm familiar with... Asking out or curiosity.
- sethherr 2y agoOne place that I think there is a big difference in developer experience is in testing. Rails, as described in the article, comes with CI setup and corresponding tests are automatically generated when using rails generators.
- WD-42 2y agoThe biggest difference is python vs ruby. Python’s ecosystem is massive, so if you want to pull in any third party libs you have plenty of choices for whatever you may need. Django also has auth and the admin interface built in, both of which are very nice.
- tyre 2y agoRuby and rails’ ecosystems are also massive. Devise and ActiveAdmin are options for those two, though I haven’t used either in years. With much of the AI development happening in python and typescript, you might be right about those areas.
- WD-42 2y agoRoR's ecosystem is indeed massive - for web apps. But if you want to make an app that integrates with an existing domain, Python is just so far ahead. Numpy, SciPy, Pandas, basically the entire field of astronomy and biology, data science and FinTech... the list goes on. But if you are sticking to basic web/database stuff it's hard to go wrong with RoR.
- theonething 2y agoa best of both worlds solution might be to have a Rails web app and Python services. Of course if you like Django/Python better anyway, then just use those.
- block_dagger 2y agoAs a single developer of an open source Rails project that has grown to serve ~120k MAU, I can attest to this article’s claims. One tidbit to add: ActiveStorage, which provides file attachment features, is another excellent piece of the Rails family. I’ve been using Dokku but looking forward to trying Kamal. Rails keeps getting better, and Ruby keeps getting faster.
- schneems 2y agoIf you like dokku, have you seen Cloud Native Buildpacks? You can build an OCI image from them as a first class feature https://github.com/heroku/buildpacks/blob/main/docs/ruby/README.md https://github.com/heroku/buildpacks/blob/main/docs/ruby/REA...
- block_dagger 2y agoBuildpacks look cool, but Dokku is perfect for single-server projects with its plugin system. It has one-command setup for Postgres and Redis, auto-backups to S3, built-in nginx reverse proxying, and an easy Let's Encrypt plugin. My current server has an uptime of 1,912 days (~5.3 years) with near 100% app availability. With reliability like that, I plan to stick with Dokku when I upgrade to a new server next month. For multi-server setups, Buildpacks with orchestration tools probably make more sense though.
- josegonzalez 2y agoDokku uses heroku buildpacks by default and supports cloud native buildpacks by changing the builder to pack via builder:set.
- jilles 2y agoIf you replace the title with Django it still works. I’m doing the same as the author, but with Django.
- najarvg 2y agoNot hands on with Django (or other Python based frameworks) so pardon the basic question. How do the speed of the generated application compare with the speed of a generated rails application? I know the latter has made some strides recently..
- rednafi 2y agoPython is generally faster than Ruby, especially in the newer versions. That said, we’re still talking about two of the slowest languages out there, so the performance gap probably isn’t that big.
- ismailk 2y agoThis was generally true before the introduction of YJIT, but with YJIT, Ruby's performance has improved significantly and may even outpace Python in some scenarios[1]. [1]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- rednafi 2y agoYeah, Python 3.13 got some great performance improvements as well. But both languages are quite sluggish compared to something like Go and even Node. Also, while I like Ruby, other than RoR, I wouldn’t opt for it to build something.
- sroerick 2y agoI built a data app one time and one of my devs spent a lot of brain cycles trying to get data to process a little bit faster. We were getting data through a partner who restricted our data access through an API, where we were limited to 100 records per call. Turns out discussing Spark vs Duck DB isn’t helpful if 99.9% of your software latency is from having to make 750,000 HTTP calls every weekend to run your BI pipeline. For the record, that API was a Rails app - but it was certainly not the fault of the framework in that scenario. Point being, for web apps, I don’t think it matters unless you’re in the top 100 websites, and even then it probably doesn’t. Complaints about htmx efficiency always confused me for this reason. Your app isn’t slow because you rendered HTML instead of JSON. Sorry to digress, others may know better than I do but this one is just my experience. The only time I’ve run into computation speed bottlenecks in either was doing data analysis in Python, and you usually just bring in Python libraries that aren’t written in Python like polars or DuckDB. Sounds dumb, but it works pretty well. Standard practice has always been for me that long running tasks get sent to a job queue anyways. So ideally nothing in the UI is dependent on something that is long running. But again, in my own work any long running tasks is almost always limited by network latency.
- anthony_franco 2y agoI agree with everything except for Kamal. I'm happy to have someone else handle the server side maintenance. Maybe once my service grows so huge that handling it myself makes sense moneywise, but starting off that way is overkill when there's such affordable alternatives.
- Ocha 2y agoI thought 2024 was very underwhelming for Rails - not really big advancements besides Kamal and Kamal should not have been part of rails to start with. If rails team wants to work on docker deployment tool, they can - just don’t call it rails feature
- trevorhinesley 2y agoGenuinely, I don't understand this take. 2024 brought huge additions like Solid Cache, Solid Queue, and Solid Cable, the stable version of Strada (Hotwire Native) which completed the current vision for the Hotwire stack, in addition to Kamal (let's not sell that short, because whether you personally like it or not, it's a fairly robust tool for what it's meant for) and other niceties. Even if you don't like one/all of these, I don't understand seeing these as small advancements of the framework, particularly in a single year.
- sroerick 2y agoAnother thread just said basically the opposite, that it was easy to host multiple sites, and sold me on Kamal. I get not wanting to do it, but I just spent 10 minutes writing a basic HTML page and 90 minutes trying to get GitHub pages to do SSL and I’m still not sure I got it. So if I have to do a little brain damage to configure Kamal but then can push sites to it easily? I’m in
- jchw 2y agoDon't really know much about Rails because I wound up picking Django instead when faced with the choice many years ago. That said, honestly, my perspective of Ruby on Rails has been tainted by watching GitLab get pwned over and over and over. My distro can barely keep up with GitLab being pwned because by the time the security release hits stable channels there's already another CVE. I liked GitLab, but something is deeply wrong. Of course clearly not all apps are GitLab, but GitLab is the only Rails app I run, and must be one of the most problematic software I've ever deployed for security patching, and most of it seems to do with issues in the Ruby side of things. What makes GitLab so uniquely crap at security, and how do you avoid it as a Rails developer?
- _jss 2y agoAs a counter-point (and I know nothing about Gitlab), but GitHub and Shopify are both prominent Rails apps with pretty good security records. GitHub wrote about it last year: https://github.blog/engineering/architecture-optimization/building-github-with-ruby-and-rails/ https://github.blog/engineering/architecture-optimization/bu... I think the answer to your question is the same as any large application: pay attention to your supply chain, architect your systems well, if you don’t know how to do things securely go learn before building (or learn as you go, but that has consequences typically).
- jchw 2y agoOf course, it's definitely not impossible to write secure Rails apps, just like anything else; it's hard to know from the outside what that says about Rails in particular. For example, PHP had a lot of rough edges, but Facebook still managed to take it to the highest heights as far as websites go. I'm not arguing Rails is like PHP, but I see a commonality: - PHP had a really good developer experience (even with the rough edges, for the time), but building robust applications on PHP could prove quite challenging. It has gotten a lot better, but there are still remnants all over from the past. - Ruby, likewise, seems to have a really good developer experience, and indeed it seems Rails apps sometimes suffer with robustness and reliability. Not just GitLab, but also Twitter in the past, too. I think some people may read what I'm saying and think I'm just a hater, but not really. I actually just wonder if what I see with GitLab is telling us more about GitLab, or if it's telling us more about Ruby or Rails. Is it hard to make robust Rails software? > I think the answer to your question is the same as any large application: pay attention to your supply chain, architect your systems well, if you don’t know how to do things securely go learn before building (or learn as you go, but that has consequences typically). This is good general advice but I am aiming more specifically. I'm wondering if anyone with more expertise could answer to what classes of issues you have to work to avoid. I know Shopify was working on gradual static typing for Ruby: is dynamic typing a problem? That sort of thing. Of course, you can write both secure and insecure code in any programming language in many different ways, but some ecosystems make it easier and harder and I think that's more what I'm getting at. Frankly, even if it's true that it's tricky to make Rails apps secure, that wouldn't really dissuade me from still using it in some cases if it seemed like it could save me a lot of time and effort. That's pretty much exactly why I used Django to begin with; I definitely don't feel like Django was the most robust platform to write webapps in, just a very productive one (that was still decently robust in my experience, but you know, YMMV.)
- hk1337 2y agoI’m curious on others thoughts on whether or not to use Devise? With the recent Rails updates, even in Rails 7, Devise didn’t seem that useful and seemed to over complicate the user authentication, registration, lost password experience and also seemed like I had to do a lot of work overriding their views to fit with my application. It seemed easier to not use Devise? It had its usefulness in earlier versions of Rails but not so much now?
- loktarogar 2y agoDevise bakes in a lot of knowledge about auth. You probably don't need it for a simple app. As your needs grow, when you need things like social logins, Devise makes that easier. If you get really big you probably will have to build out something bespoke anyway. So Devise is sort of for the middle of the journey.
- Ocha 2y agoMy experience is opposite. Getting devise up and running is very easy. Adding OAuth for GitHub, google, and other providers is also very easy. Editing views is pretty straightforward - you can put your forms or whatever you want - just post the form data to devise endpoint and that’s it. All in probably will take 30 minutes to set it up.
- cjk 2y agoFor very simple username/password authentication, what Rails 8 provides is probably sufficient. But the moment you need other auth providers, 2FA, etc., Devise is very much still useful.
- hk1337 2y agoInteresting, I hadn’t really thought about using, or knew, it could handle that type of authentication. That’s good to know
- jwcooper 2y agoI figure if it's good enough for login.gov [1], it's good enough for my sites as well. I also find devise pretty simple to get setup and use. It's so easy to mess up some small thing while writing your own auth. I've always pretty much trusted myself to at least get devise setup properly. [1] https://github.com/18F/identity-idp/blob/main/Gemfile#L30 https://github.com/18F/identity-idp/blob/main/Gemfile#L30
- rglover 2y ago> Rails is not dead; It's better than ever. Try using it to make something new this year. I hope as an industry we can move away from this "___ is dead" talk. The OP shouldn't even need to say this. If something is being worked on (in any capacity) and has at least one user, it isn't "dead." "Is it dead" is groupthink questioning that leads to great ideas being swept under the rug because they're not perceived as popular enough. Think for yourself and use the tools that make sense to you.
- kuduebrahim 2y agoRight, I agree. But Perl is dead…
- fragmede 2y agoRaku's doing alright though
- rglover 2y agoIs it? https://jobs.perl.org/ https://jobs.perl.org/ I don't use it and you may not but it still has an active community and job listings. The last release was on December 20th [1]. This is what I'm talking about: it may not be popular in a "bleeding edge" sense, but it's still being used and developed. [1] https://dev.perl.org/perl5/news/ https://dev.perl.org/perl5/news/
- theonething 2y agouh, it's got a total of three jobs on there currently with two of them over a month old.
- bdcravens 2y ago"Dead" languages still have codebases that need to be maintained, and companies already invested that need new development may lean on the expertise the company already has, but this is more a sign of subsistence, not thriving life.
- deleted 2y ago[deleted]
- rednafi 2y agoRails 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.
- darksaints 2y ago> Rails is not dead; It's better than ever. Try using it to make something new this year. Apparently that's one of the few things you can do well with a rails app. As evidenced by all of the rails apps stuck behind 3+ major versions because refactoring or upgrading without breaking everything is damn near impossible.
- hatsix 2y agoI rant about rails, often, but this is just a full on garbage comment. Your evidence is "all of the rails apps stuck"... where exactly? like... you have a listing of these? Or are you just making things up? I've done a ton of rails upgrades in my career, they've all been easier than any other framework (except the current batch of js/ts frameworks that use codemods to update the majority of breaking changes). DHH has been making some pretty wild changes with non-Ruby parts of Rails, but Rails 8 still fully supports sprockets, their asset pipeline introduced 15 years ago. All of the other asset pipeline alternatives are still supported, even though Rails introduced "Propshaft" as a replacement. The only thing we've had trouble with upgrading has been when Rails added full support for read/write shards... it wasn't fully compatible with Aurora Serverless at launch, but we had wanted to migrate off that anyways. So.... try adding some signal instead of just noise. Cite specific issues, rather than just try to ride a bandwagon.
- dudeinjapan 2y agoI upgraded a large Rails app from 3 to 5 using a flag ENV["RAILS_NEXT"] everywhere in my code and a few monkey-patch shims here and there (easy to do in Ruby.) We ran with the ENV var set in staging for 3 months before flipping it in prod, it was fine. Upgrades since version 5 have been much easier.
- criddell 2y agoI manage a Redmine installation (a Rails-based issue tracking package that’s amazing). I’ve been upgrading it every year for close to ten years now and every upgrade has gone smoothly even though I know almost nothing about Rails or Ruby.
- Glyptodon 2y ago
- icameron 2y agoGlad to see Rails is looking better than ever! I've been supporting a few Rails web apps since the Rails 2.3 days -almost 12 years- and today's rails is quite different, like a fully evolved Pokémon. Thankfully the comprehensive Rails Upgrade Guides are solid and well documented. It was manageable to upgrade my apps one version at a time over the years without a major refactor. Rails embraces new developments in web tech, so it's never been backwards compatible, but at least their changes are well documented. ActiveStorage was a huge improvement over the 3rd party gems for file attachments, and came with cloud provider support. The toughest lift was the migration to Webpacker from Bundler for the javascript stuff, which we only finally did a couple years ago. But now it looks like that is all behind us with Import Maps support. I'm looking forward to upgrading these apps once again to 8.1 this year.
- samtheprogram 2y agoI took a pay -loss- to maintain a Rails app for a client with a small budget, about 4 years ago on an outdated app using Ruby 2.3. Super happy with the decision. It’s too easy to add features or upgrade the app and I love working in the codebase.
- sroerick 2y agoShot in the dark here, drupal dev?
- samtheprogram 2y agoHeh, no. Full Stack with a lot of NextJS/React/ReactNative these days. Sprinkle in a Spring Boot + Angular project and this Rails gig. I also spent a few years doing Obj-C/Swift iOS development. Rails was one of the first web frameworks I learned after PHP and it and Ruby were always favorites of mine. Closest I came to being a Drupal dev was shipping a small CodeIgniter app in around 2011 (right before picking up a Rails book).
- shermantanktop 2y agoThere’s a thing here that seems to separate people like the article author from…well, from me. They just have a deep, deep affection for Ruby and Rails. It makes everything great, and every new surprise is like discovering that your new special friend also knows how to juggle! And speaks Cantonese! How cool is that?? Oh, they’re afraid of spiders? How cute. But did you know they went to Ecuador in college? There’s a honeymoon effect that just never stops, whereas for me it never started. I’m actually jealous.
- Glyptodon 2y agoPersonally, I don't like a variety of things about Rails. Like its love for pluralization of everything. But every time I've wanted to have similar productivity with say, a Javascript backend, I find it basically impossible. At the same time, I am always shocked out how many people fight against Rails conventions when building in Rails. (Not that you've done this, but seriously, I take over a random code base and they'll have done something like written a worse version of Active Job from scratch for no real reason.)
- Lutger 2y agoVery accurate. Every programming language or framework has this kind of emotional attachment of enthusiastic users, to a certain extent. But nothing quite like Rails. Its in the culture.
- krschacht 2y agoI find this fascinating as well. And I think it’s because part of the ruby & rails cultures are to deliberate cultivate delightful touches in the language & framework. This creates a positive feedback loop that has kept the “honeymoon phase” alive much longer (at least for me) than many other technologies I’ve fallen in love with.
- thathoo 2y agoI 100% agree. I have been able to get started super quickly with small projects using Rails. Such a blessing!
- nomilk 2y ago> if you follow (the Rails Guides) start to finish, you'll have a Rails app in production. And it isn't just hello world. Your app will have authentication, caching, rich text, continuous integration, and a database. That's a real application. These features are great for established apps like GitHub and Airbnb, but if you're making a tiny startup, and want to test ideas quickly, I wouldn't spend time on CI, caching, Rails's authentication (use extremely feature rich Devise gem), Rails's 'turbo' features, and writing tests. These are all good things for medium or larger apps, or well-funded apps with a long run way, but are usually cost-benefit negative for small apps. Turbo saves a fraction of a second on many page loads, but can add days of development time for those not fluent in javascript when it causes some core functionality to not work (e.g. devise's Log out!). Testing is very important on large apps but for quickly flicking a few ideas together and getting it in front of users; unless you're a banking or healthcare app, they can probably be postponed until you have traction. Be mindful of your size and timelines and don't succumb to 'default bias' where you use things simply because they were there out of the box. Feel confident to say 'no, we don't need that (for now)'.
- yakshaving_jgt 2y agoI don’t agree with your position on tests. I find that writing tests even for small applications saves me time. And that’s even in a language with a sophisticated type system. I’m also not sure how much time you imagine one spends on setting up CI. In my case it’s just one file with about 20 lines in it, and I usually just copy and paste it from previous projects.
- nomilk 2y ago> I’m also not sure how much time you imagine one spends on setting up CI. In my case it’s just one file with about 20 lines in it, and I usually just copy and paste it from previous projects. The problem is when it breaks due to some versioning issue or some other easy-in-hindsight problem that saps 3-6 hours of time that could otherwise have been spent talking to users and discovering/building real features. I start to question "did I really need CI in the first place", I think the answer for non-critical apps (e.g. with a small number of users; not healthcare/banking/similar) is usually a hard "no". Other than autonomously running tests what value does CI offer?.. to me, nothing that I can think of. Not saying everyone should denounce it, just that it's very okay to say 'nope, don't need it (yet)'.
- 94b45eb4 2y agoRuby and Rails anre amazing. I love Rails and recommend it for most small to medium sized projects. What I find frustrating though is the constant hum of people using “Ruby is slow” as the excuse for every problem they have. Everyone I know using Rails is in the process of convincing everyone that they have outgrown its capabilities and need to move onto something “more mature”. I also see a lot of people using Rails but replacing its components with others. A. If part of what makes Rails powerful is that it comes with pretty much everything you need, replacing them without good reason (there usually isn’t one) erodes the value you get from Rails.
- patatero 2y agoTitle says "everything" but author didn't mention Android/iOS apps.
- mattl 2y agohttps://native.hotwired.dev/ https://native.hotwired.dev/ — I’m curious how well this works
- krschacht 2y agoAnd this just landed too: https://pragprog.com/titles/jmnative/hotwire-native-for-rails-developers https://pragprog.com/titles/jmnative/hotwire-native-for-rail... I’ve done one app with Hotwire Native and it’s a pretty interesting solution. However, just like a truly complex and dynamic web UI can reach a level of polish with React that is hard with Hotwire, a truly complex and dynamic mobile UI can reach a level of polish with Swift/Kotlin that is truly hard with Hotwire. It makes the vast majority of experiences much faster to build, but certain complex experiences are hard to get polished. However, Hotwire (web & native) can get you almost the full way there and you can just drop a React/Swift/Kotlin view in for parts of the app where you need it.
- cjohnson318 2y ago> There's a bit of hand waving around installing Ruby (which is still more difficult than it needs to be). For real. I put together a simple Jekyll blog, and figuring out gems and this and that after not looking at Ruby for 15 years was a real slog. A lot of that was my fault for being out of the Ruby loop, and being unfamiliar with Jekyll, but I feel like the process could have gone a little more smoothly. Anyway, this made me excited to try Ruby again.
- Alifatisk 2y ago> my fault for being out of the Ruby loop Nooo the setup should be easy no matter how experienced you are. I found jekyll quick to get started with, but that is because I already had Ruby and RubyGems installed.
- rootedbox 2y agoWith sqlite and docker.. rails apps are easy to share.. my last project is easy to install and use because of rails https://github.com/ThinkThinkAI/ThinkDB https://github.com/ThinkThinkAI/ThinkDB # change directory_on_your_machine_for_think_db_storage docker run -d --name thinkdb -p 3000:3000 -v directory_on_your_machine_for_think_db_storage:/app/storage thinkthinkai/think_db:latest TADA.. Rails is great.
- dzonga 2y agofor auth - instead of devise or the rails 8 auth - you can also opt for authentication-zero. what's hardly ever mentioned is how great hotwire is. it takes time getting used to, documentation is sparse but oh man oh man - hotwire is nice. you get to skip a majority of spa shenanigans.
- chooma 2y agoI am really struggling to get hotwire running to be honest. I now just postponed implementing it till after the launch. Any good ways of getting up to speed on hotwire and debugging it?
- ignurant 2y agoA lot of people seem to overcomplicate it by bringing their thoughts on how other modern js apps are written. It would be helpful to have a specific example of some of the things you need to work through. Reading through the [handbook](https://hotwired.dev/ https://hotwired.dev/) should get you most of the way there. One of my colleagues recently switched from mostly react to default full stack Rails. He was really struggling with how to filter things in a table. When I showed him how I would do it, his comment was along the lines of: “I can’t believe how simple this is. Modern JS just doesn’t work this simple any more. This is like how jquery used to work but way more organized”. I can’t say I know enough about modern js development to validate that comment. He noted something about expectations of how the dom managing things… So, if you’re coming with a certain mindset of how to do things, try to leave that behind a moment and read through the handbook. Especially if it involves making fetch requests to do things. That’s like, the number one “you probably shouldn’t do it like that” in Hotwire.
- dzonga 2y agothis is a nice tutorial too - https://www.hotrails.dev/turbo-rails https://www.hotrails.dev/turbo-rails. then this series on youtube - https://www.youtube.com/watch?v=b7dx1Yt3FzU&list=PLm8ctt9NhMNWy8fC-7g9OC1IJPkYQ_pI7&index=5 https://www.youtube.com/watch?v=b7dx1Yt3FzU&list=PLm8ctt9NhM... some things have changed a bit - so you just have to work through the kinks. one other thing though - since railsword conf - there was an announcement that certain things have simplified but I haven't found the docs or the new simplified api's.
- kissgyorgy 2y agoSame for Django+SQLite
- Syntaf 2y agoI’m building a member management platform [1] with Rails + Turbo + Stimulus and it continues to surprise me how easy it is to just… do things with rails. * Want to allow your users to write rich text? Easy just use ActionText * Storage and attachments? ActionStorage is easy to setup * Job queue, asynchronous work? No problem with ActiveJob Today I learned about Rails system tests and found it so cool. With almost no configuration I can write tests that interact with my app through a headless browser. Rails is the ultimate solo developer and hobby project tool for me [1] https://embolt.app https://embolt.app
- dewey 2y agoSame feeling, I’m usually a Go developer but all my side projects are in Rails. It’s just fun to work with and see how fast things are up and running. Using gorails.com and Copilot helped a lot too.
- lylo 2y agoRails is wonderful and I’m thankful for what the community (and DHH) has done over the years. My company (founded 2007) was built on Rails and that B2B app now has 200,000 customers… all on a Rails monolith, the same code base that has evolved with Rails over the years. It’s not just for side projects! That’s said, I run my current side project on Rails 8 and Postgres (I don’t get on with SQLite). You can do so much with so little code! Inspect the source code here if you like :) https://github.com/lylo/pagecord https://github.com/lylo/pagecord
- VeejayRampay 2y agoRuby and Ruby and Rails are really having a revival recently I guess the work on performance and tooling has paid off and people are starting to realize that if python can have the spotlight then ruby (overall a better language) might deserve it too
- nickjj 2y agoOne thing I don't get about the current Rails direction is pushing hard to use SQLite and removing external dependencies but at the same time also advocating to use Docker. Running Postgres and Redis in Docker is a matter of adding a few lines of YAML to a file once and never thinking about it again. I have done this for 10 years, it is painless. I'm all for reducing moving parts and would also choose the same strategy if there were no down sides but DHH is running their apps on dedicated hardware with some of the best performing SSDs you can get. Most VPS providers have a lot worse disk performance. There's also downsides to running your DB (SQLite or Postgres) directly on your single VPS when it comes to uptime. If your server is stateless then you can upgrade it with zero downtime. All you have to do is spin up a new server, provision it, add it to DNS, wait a day or 2 and then decommission the old one. This is nice for resizing instances or big OS updates in a zero risk way. You can just make a new server. That works because it doesn't matter if the old or new server is writing to your externally hosted DB. If your DB is directly on the host or using block storage that can only be connected to one instance at a time then you can't spin up a new server since one of the DBs will get out of date.
- wiseowise 2y ago> I have done this for 10 years > it is painless Huh, I wonder why.
- nickjj 2y ago> Huh, I wonder why. I didn't start with 10 years of experience if that's what you mean. A basic Redis config inside of Docker Compose could be: services: redis: image: "redis:7.4.1-bookworm" restart: "unless-stopped" volumes: - "redis:/data" volumes: redis: {} Now you have Redis running with your project and you can use "redis" as the hostname to connect from your app. It even persists to disk with a volume if needed. It's similar for Postgres except you'd also want to set the PG username and password with environment variables so your initial user and DB get set up with reasonable defaults. A working version of this is in my Rails starter app at: https://github.com/nickjj/docker-rails-example https://github.com/nickjj/docker-rails-example It sets a few more properties but those aren't essential to get going.
- dartos 2y agoFor those of you with a functional bend, check out elixir and phoenix. Elixir very similar to ruby in syntax and Phoenix very similar to rails in functionality. The creator of elixir (Jose Valim) was a core rails contributor back in the day IIRC
- cal85 2y agoAnyone know any good hosting options for little personal, experimental Rails apps that might not go anywhere (i.e. that I might well lose interest in but forget to cancel)? I’ve always liked Vercel’s approach for these kind of side-projects, as I don’t have to worry about cancelling anything if I stop using it. But I guess that is a perk of it being serverless, which precludes Rails. What’s the next best option, something suitable for small, database-driven Rails apps?
- softwaredoug 2y agoI just use Fly (http://fly.io http://fly.io) for toys... and it works pretty well. Have not tested at scale / reliability for a real thing.
- krschacht 2y agoRender is another good option. I too prefer Fly for my toy apps, but it has a little bit more of a learning curve than Render.
- azuanrb 2y agoYou're correct. You need a server, so Vercel approach with serverless are not applicable here. As for the hosting, any VPS should be fine. I host mine on Digital Ocean. You can use Kamal to setup for database too. Or if it's simple enough, sqlite is great.
- deleted 2y ago[deleted]
- wiseowise 2y agoI always read how great Ruby/Rails are, but learning language just for one thing (Rails) rubs me up the wrong way. Especially when alternative (Python) is so much more useful (on a surface) and Django can do the job of Rails (while not as good or nice as Rails (from what I gathered), but still). Kinda like learning Dart for Flutter. Those of you who struggled with the same dilemma, what did you do?
- jaynetics 2y agoAs others have pointed out, there are many use cases for ruby. It's probably the best choice for scripts (rake, optparse, fileutils, ...). There's embedded stuff (mruby), music (Sonic Pi), cross-platform GUI apps (e.g. glimmer), game development, and much more. But I'd be interested to know where Python is more useful, apart from science, data science, ML, AI, and such.
- wiseowise 2y agoI don't doubt there are many uses for Ruby. But if we're talking strictly about employment, there's literally nothing outside of Rails (quick search of Ruby vs Python in the Netherlands yields 762 vs 20k hits (many of those are garbage, but you get the idea)). Python also has far stronger typing story, it is used as a glue in many orgs (just look at Mozilla, Chrome and countless more codebases), there's also an order of magnitude more people using Python which means far more nicer LLM story. On the other hand Ruby evangelists swear by Ruby like it's the second coming, so there must be something that makes people so happy. I'm trying to understand if it matters enough to pay opportunity cost for switching to Ruby. And yes, I know that you can learn both, but becoming proficient in languages takes time and practice. Ruby isn't something that I'll be able to sell at my org, which means I'll have to invest into it in my own free time. On top of that you have to stay up to date with language developments if you want to stay relevant.
- jaynetics 2y agoI agree to all your points but the stat stands out in particular: > 762 vs 20k hits That's impressive! I guess the difference is smaller here in Berlin as we have a lot of rails shops, but internationally speaking, your stat might well be representative. There might also be less competition in the Ruby job market, but perhaps not to such a degree to offset the difference in job numbers. In the end, Python is probably the safer and more career friendly option, especially if you're interested in AI. However, if you enjoy coding, Ruby is IMHO the top choice to maximize this enjoyment. I don't think it's the second coming, but there's no other commonly used language where you can do things as easily and so without bending to any limits of the language. The downside of this power is that you're never done learning about it. Maybe people who are drawn to coding as a hobby are more likely to enjoy Ruby than those with more of a separation between work and private interests.