96 ms·
From Node to Ruby on Rails
- rglover 5y agoFor those looking for a legit Rails-like experience in Node: https://github.com/cheatcode/joystick https://github.com/cheatcode/joystick
- vrodic 5y agoIf there was only a good Ruby in browser implementation, I'd be more than happy to go Ruby everywhere. New Rails with turbo streams is great, but often times it's desirable to do data processing on the client, and then getting back to JS feels like a step down.
- johntdaly 5y agoDid you try opal? https://opalrb.com/ https://opalrb.com/ If yes, what was your opinion? I never tried it since I'd rather just work in two languages.
- ilrwbwrkhv 5y agoMaybe try a full stack framework like blitz js?
- udbhavs 5y agoHow mature is blitz? Is it common to run into missing features that you would probably find third party modules for in other ecosystems?
- purplerabbit 5y agosecond this. If you want a better rails than rails, check out blitz.
- andrew_ 5y agoOodles of anecdotes and hyperbole. As someone who moved from Ruby/Rails to Node, my happiness index has been steadily higher. Why is it that we get a rise out of bashing one ecosystem to favor another?
- lta 5y agoIt's a bit different for JavaScript. If you don't like python or ruby or php, you can just decide not use them. JavaScript is much harder to avoid because there's isn't really a native alternative in the browser. JavaScript is forced down our throats, liking it or not. So yes, I personally resent js and its community for it. And I feel extremely pissed when I'm told how supposedly awesome this technology is, because I'm having an indigestion. It's not about getting a rise out of bashing, it's just the expression of an immense fatigue about this ubiquitous stack. So there's the light trolling of other stacks, and there's js. :)
- andrew_ 5y agodamn. I've probably worked with 20 languages over the course of a career in as many years and I can't ever recall that kind of seething hatred for something as inanimate as a programming language. I'd suggest your rage is misguided and misplaced. Perhaps redirect that energy towards moving to a sector of the tech industry that doesn't lean on JS.
- lta 5y agoSo... Maybe you were right about the hyperbole part. If you felt it was hatred I probably went a bit to strong haha. But I certainly don't like when you have limited or no choices about something. Also it's not an inanimate thing, there's a community of actual people building and expanding the thing, I blame them for my sufferings :p I'm an entrepreneur of sorts so there are stuff that I can't really avoid because no one else will do them for me. Doing frontend work is part of that list. I also do a bit of "devops" freelancing and it's hard to avoid to have to fiddle with npm there as well. The size of the part of the industry where you can avoid js is shrinking by the day
- johnnymonster 5y agoHow is this #3 on the front page… no comments and 23 points…
- globular-toast 5y agoWait until you try Django.
- chiyc 5y agoWhat does Django offer that you feel is an improvement over Rails? I'm asking out of curiosity because I have very little experience with either.
- m_ke 5y ago+ Python (larger user base, more libraries, especially for scientific computing / ML) + Less Magic + Better Migrations + Better ORM + Django Rest Framework + Admin Interface + Great Documentation - Less Packages
- cure 5y agoYou forgot a very important one - Python package management (a raging dumpster fire)
- m_ke 5y agoVery true but with conda and docker it's not as bad for production as it used to be. Most of the packaging issues that I run into these days are related to CUDA / C++ libraries, plain python dependencies are not really an issue.
- abledon 5y agoi always found gem bundle stuff with rvm more obtuse than pip and site packages... python with virtualenvs seemed more straightforward
- sigzero 5y agoIs Ruby any better in that category? Just asking. I really have no idea and what to know.
- 5y ago
- chiyc 5y agoI was similarly motivated to go with PHP and Laravel instead of Node for a personal project recently. Does anyone with experience in both Laravel and Rails have thoughts on how they compare? Both the frameworks themselves and the surrounding ecosystem?
- bliteben 5y agoI can comment vs Django: Laravel: - no admin (although there are good free projects like filament admin) - not well defined models + queues builtin + task scheduling builtin + livewire builtin + webpack builtin (this saves a ton of time as if you have a problem someone else likely has had it as well) + builtin relatively sane api framework (although the inertia integration for things like Vue, seems to almost encourage exposing more data than you mean to, I see this a potential data leak vector with unexperienced developers) + composer is way better than poetry/pip/pipenv/ whatever + first party support for many things you'll need (Payments, Browser testing, Hosting, Docker development, etc) + cheaper developers + Laravels facades such as Collection, Arr, Str remove many of the warts of PHP and in some cases can make some manipulations almost as concise and readable as Python + Laravel seems to monetize things better which imo is a path to sustainability. + Encourages use of modern css frameworks / javascript frontends. Django: + admin (although dated looking and very hard to sell for client facing admin stuff, as it will never look like they want it to), honestly maybe the best admin out there for speed of setting up etc. + better models with db columns defined in model, could use typing though. + way better documentation + python's better more concise syntax on most things + fully automatic migrations (although you will eventually run into issues here, with good practices can work very well) - python packaging in a horrible state - too many basically essential packages not in core (api, queues (even database based queues)) + python packages for basically anything out there somewhere - Django rest framework (this project was okay for its time, but it is seriously dated, and takes the air out of some better projects such as django-ninja)
- midrus 5y agoHaving some experience with both, agree with everything you said. I'd also add Django is great if you're building only a backend with it (and you have no frontend and/or it's an external SPA). For full stack development, Laravel all the way. Just it's templating system (blade) is a joy to use compared to Django's templating system which feels stuck in the 90s.
- dncornholio 5y agoIs Rails really a thing of the past or are people just not talking / posting about it much?
- dacur 5y agoAs a Rails dev, based on the number of LI messages and emails I'm getting these days, I can tell you Rails is absolutely NOT a thing of the past.
- nobleach 5y agoI'm seeing the very same. Because I had some Rails experience in the 2.3/3.x days, I get recruiters constantly bombarding me to come work with their Rails monoliths. The few companies that I've actually spoken with are all trying to get AWAY from those massive Rails apps. They're moving to Elixir "microservices". My read on this is that many of these apps were begun as PoCs/MVPs and as the original engineers have tried to scale, they've lost interest. So we have a large amount of 5-10 year old code bases that are looking for maintainers. One friend in particular contacted me and asked if I knew anyone who'd be willing to contract with his firm to upgrade a Rails 5.x app. This tells me, they had no one on staff that could do so. So yes, the need for Rails devs is large. The popularity of it? At least in my area... not so much.
- LanceH 5y agoAll those successful efforts with Rails over the last ten years -- many are moving on to other tech, many are just getting bigger with Rails. I thought I had moved away from Rails into Go (I find the two very complementary), but I got pulled back into some solid, meaningful projects using Rails. People complain about the tech, but I would rather have a bad tech stack on a product/app with a chance than the perfect tech stack making the next twitter for dogs.
- petepete 5y agoThe latter. Rails isn't cool but you see it used in so many places. I'm currently contracting with a UK Government dept and Rails is one of the two approved stacks, it's used on basically all externally facing projects.
- johntdaly 5y agoThe cool think about rails is not just that you don’t have to take care of the “pluming” (you get that from any halfway decent framework and could stick with JavaScript and nestjs for example to get that benefit) but the libraries that exist to get you going quickly for login, third party apis and so on. That is the bigger benefit of rails. In other languages there might be multiple frameworks and multiple libs all of which might do none of just part of what you need and if you find a lib you might not find an integration into your framework and need to build that yourself. Rails was so big and the community was/is cooperative enough that you usually get fewer libs that are more complete and more likely to fit you needs and come with rails integration. No need to test 10 or more libs to find out all of them sort of suck and then do it yourself or chose the least sucky one and integrate it yourself. THAT is what maid Rails productive and at times frustrating (you often only deep dive the components once something goes wrong). Long term it will be interesting to see how many companies run with setups that are Node.js heavy in comparison to not just Rails but also Python, PHP and even Java, .NET and Perl (yes old but not dead). Perl was one of the early languages and I don’t think there will be as many projects in it as there are in PHP. Python has a good amount of stuff and they didn’t really have a time of heavy hype (like PHP, Ruby on Rails or Node.js enjoyed) and Java and .NET are going to be more heavily traditional corporate than the rest. Would be nice if somebody knows a link or two to explore this a little bit better.
- robin_reala 5y agoThe unofficial slogan of the Ruby community is “Matz Is Nice And So We Are Nice”. The cooperative nature was designed in.
- johntdaly 5y agoYup, but there is more. I think overall we as a community appear to show good taste in what we do (this is opinionated) and if we do something it tries to be as complete as possible. When I think of all the half backed JS projects I’ve looked at when searching for a solution and compare that with Ruby, there is a difference.
- 5y ago
- friedman23 5y agoThis seems like this is mostly based on their choice of technology > Building the web app in Rails took me 2 days – the same thing in Node would have taken 2 weeks This is ridiculous, you are comparing a language framework with a runtime. Anyway, my problem with rails and other template based server side rendered frameworks is that the output looks decidedly un-modern and extending it to add the interactivity you can get from modern JS frameworks is hard. I have worked with code bases that were django or rails that bolted on react and other javascript frameworks and the result was not pretty. For my personal projects today what I do is the following, I use nextjs to build the frontend and I use nestjs with prisma for the api (a lot of the plumbing you were talking about is autogenerated here). I probably can't get up and running in 2 days but I can do it in under a week and adding new features is painless.
- bdcravens 5y agoWhen I hear someone say "Node", I implicitly understand that they mean an application with the libraries that go with. The same way I assess React with the libraries that go with. Perhaps the difference isn't "framework vs library", but rather, "explicit framework vs implicit framework"
- tomc1985 5y agoYou'd be surprised what you can get out of nothing more than Rails + Turbolinks. As long as your site idea follows a "pages" analogy it is pretty much instantaneous. Anything more than that and you're trying to make an SPA > the output looks decidedly un-modern You could say that about anything. The output styles to how you style it. Also since when is modernness more important than content?
- friedman23 5y ago>Also since when is modernness more important than content? Design is just as important as content. Design in terms of how nice the site looks and design in terms of ux and usability. If people ignore your site because it looks cheap then the content is pointless. Most users really expect SPAs, they don't expect having to reload the entire site to see new content. Then you get into usability and many react component libraries really work well with you there. Accessibility for the visually impaired is baked into the library and the popular libraries follow modern UI conventions.
- l0rn 5y agoYeah it's funny... Now 10 years+ in the web dev business. I occasionally got drawn by the hype, dug myself considerably deep into express based frameworks, sails.js, koa.js, nest.js... But in the end i had to conclude, my first go-to framework django always came out superior in terms of developer productivity. It even eventually covered the bases where i still thought node was superior like async/websocket communication. Imho Django and similar batteries-included frameworks are as state-of-the-art as they've ever been.
- oaiey 5y agoI have the same feelings about ASP.NET Core. I think everyone trends back to his reasonable sized home.
- antoniuschan99 5y agoAt my first job we were migrating from Coldfusion to Java. This Middle Aged Sri Lankan guy refused and only worked on ASP.NET. Much respect to him! He knew what he was comfortable with - and most likely looked at Java in disgust the same way Java folk would look at ASP.NET :P
- airstrike 5y agoIt's called "the web framework for perfectionists with deadlines" for a reason!
- sergioisidoro 5y agoEspecially if you couple it with HTMX / Alpine.js you get a really good stack that covers all the dynamic page updates people are getting used to, without adopting massive frameworks. I just started with HTMX and so far I think it's really promising. Similar things happening with Rails and Hotwire. It took a while for these frameworks to accept that JS and the frontend are also important aspects of the stacks, and hard to avoid if you want to build modern applications. But now that they're picking up, heavy JS frameworks start making less sense.
- 5y ago
- mmikeff 5y agoWhilst I don't have and direct experience of Rails I get the frustration with how the JS ecosystem can force me to spend a lot of time learning and deciding about things very unrelated to the core of the product I am trying to build. I am quite excited to try out Redwood JS though which is approaching a 1.0 release and aims to bring that same opinionated ethos that Rails has to JS. Clearly it is not going to be as mature as RoR for a long time, but as someone who knows enough JS to be dangerous it looks like an appealing option, especially when faced with having to learn an entirely new language.
- AlchemistCamp 5y agoRuby is a much easier language to learn than JavaScript.
- machiaweliczny 5y agoRuby has more syntax and lots of sugar. It's easy to use but not learn or implement.
- AlchemistCamp 5y agoRuby is extremely consistent in that everything in it is a class and it's thoroughly OO. I'll admit it's added some new things in the past decade, but nothing close to to the decades of accumulated cruft JS has. The really amazing part of JS cruft is how constructs that should have been dead for 20 years just keep coming back. E.g., the keyword "with" is a footgun for hiding object scopes that mostly disappeared before I learned JS, but then it showed up in Vue of all places! Variables are scoped either to blocks or their enclosing functions, depending on how they're declared. Functions either create a context for the keyword "this" or not, depending on how they're declared. Both of these traits are maddening for learner. JS uses a prototype chain and prototypical inheritance, but now also has a classical-looking class-based syntax as well. There are half a dozen ways to create an object and it's a much bigger hurdle for people to learn than Ruby's more or less mainstream choices. Building larger apps in JS on the back-end also means spending a lot more time thinking in callbacks, promises or async than working with Rails would, too. Sometimes it's inevitable but it's a hurdle for learners.
- kderbyma 5y agoI would have enjoyed an example or two. The author didn't really make their case... They made vague statements that to me seemed laughable without examples. 2 weeks in expressJs? doing what? 2 days in ruby? again....what? is the author bad at bootstrapping perhaps? do they overcomplicate it.? I need examples to appreciate their insights. otherwise I cannot fathom Hello world taking two hours in modern node.
- progx 5y agoFound this funny too. Used a saas service, finished in 2 Minutes, Rails tsss ;-)
- TheRealDunkirk 5y agoI've been doing web programming for about 25 years, starting with PHP and MySQL in, oh, about 1997. I wound up doing a LOT of PHP work, some ASP, and then lots and lots of Rails. What I'm trying to say is that I am INTIMATELY familiar with everything that a web app does, in every layer. A few years ago, in a previous role, I was forced to use Java to start a new web app. I spent a couple months reading up on things, and trying to find a comprehensive example of a CRUD app in Java/Spring/React. I finally admitted defeat, and corresponded directly with the author of JHipster, and he pointed me to an example he had on GitHub, which had never come up in searches, but, unfortunately, was so out of it date, the code wouldn't work in modern versions of the stack. However, I finally cobbled together a working "show" page with nested objects, as ANY real-world web app will need to do. At this point, I again got stuck at trying to figure out how to update nested objects in a form. As a mental exercise, I rewrote everything I had done in 6 months in Java/JS in Rails in 2 days. These 2 lines of Rails... class BankAccount < ApplicationRecord self.table_name = 'offer' belongs_to :owner end ... represented over 250 lines of Java/Spring/JS. A lot of people around here hate that Rails is "doing so much for you," but do I really care to write every line of code required to define the relationship between BankAccount and Owner to the compiler, when it's a simple many-to-many connection implied by a foreign key? I found another job. P.S. There's a lot of talk on this forum about Typescript and how great it is, but very often in my months of trying to write this application, I couldn't get the types to line up through the stack, and just had to use generics.
- alifaziz 5y agoComparing node vs rails is weird. Rails might have been designed with productivity first approach. Are there any node.js based framework that has similar productivity speed with Rails?
- slantyyz 5y agoI've been using Sveltekit, which offers a back end server if you use their `node-adapter`. Sveltekit uses an intuitive file based routing system, so for side projects at least, you can build out an app/POC very quickly. Personally, I like Sveltekit's back end server better than Rails (to be fair, I haven't used Rails heavily since v3/v4) and Express. Having said that, I'm not sure Sveltekit's node adapter has been proven to scale yet. Rails has a lot of nice stuff baked in though. So in terms of the many other moving parts of making an app, such as migrations, db connectivity, I think that's where a lot of time can be added on the Node side, especially if you don't already have a shortlist of go-to libraries for the core functionality you want/need.
- imilk 5y agoBeing able to deploy Sveltekit to Cloudflare Pages is pretty amazing. And with their new auto-adapter, you don't even have to change anything from the basic init setup and it just works.
- proxyon 5y agoAdonisJS Laravel Prisma NextJS Django the weird part about this post is it compares a framework to a runtime. that's weird and dishonest. a more realistic comparison is ruby to javascript.
- KingOfCoders 5y ago"Building the web app in Rails took me 2 days – the same thing in Node would have taken 2 weeks" From my experience with Rails and Node, I could not believe a Node framework, e.g. Nestjs takes 5x more effort than Rails (nothing against Rails, it's a perfectly fine choice today for projects).
- udbhavs 5y agoYes, the author also mentioned login and NestJS has built in PassportJS integration, which in turn has a supported OAuth2 module so the end result is you can hook up authentication for most major providers in 20 minutes (with working sessions too).
- recursivedoubts 5y agoPrediction: the big move in the next few years is going to be "back to hypermedia" People are realizing that you can accomplish quite a bit more with hypermedia than you could in the past, and that the complexity of javascript stacks isn't worth it in many cases. Older, mature hypermedia-based technologies like rails, django, and even PHP, will experience a resurgence and a lot of older lessons and techniques in web development (caching, SQL tuning, etc.) will be rediscovered. I have a dog in this fight, w/ htmx, but I think we are increasingly seeing evidence for this move.
- stevefan1999 5y agoIt already happened with SSR
- allendoerfer 5y agoWe might see a combination of both. The biggest CMS of one of the biggest languages is moving away from the approach you call hypermedia by implementing a JS-based editor and REST apis. Effectively they are building a headless version on top of their legacy platform, which can be used like a JavaScript stack. This can be used as an argument for the hypermedia approach: "Let's just use this thing for now, we can always implement our SPA inside it later, if we need to."
- recursivedoubts 5y agoI think that's a trailing indicator, a reaction by Wordpress to the current "right way" to build web software.
- gwright 5y ago> The biggest CMS of one of the biggest languages Which CMS is this?
- ankit70 5y agoWordPress
- 5y ago
- z5h 5y ago20+ years of experience here, including a decade of Rails in the middle. And Ruby/Rails have certainly caused me enough headaches. And as a proponent of pure fp, I’m not fully convinced anyone should be using a dynamic language if they have a reasonable way to avoid it. Still… I will admit, you can get a lot done quickly with Rails. And if I had to build a db-backed CRUD-ish website/API, Rails would be on my list of choices. AND AND, as a fan and believer in SQL, I still actually like ActiveRecord.
- hnuser847 5y agoThe years when Rails monoliths were the de facto web stack were some of the best of my career. As I progressed in my career and the popular tech stack shifted to things like microservices, document DBs, serverless functions, Node, importing tiny nom packages for everything, docker containers, React, and GraphQL, the sheer cognitive overhead of getting a simple app up and running gradually took all the fun out of the job for me. The fast, satisfying feedback loop of writing a feature in Rails was replaced with weeks-long coordination efforts between independent microservices, constant discussions about tooling, and doubts over whether or not we had chosen the “right” flavor-of-the-week framework or library for our product. Every time I started a new project or a joined a new company, we had the reinvent the wheel for our bespoke Node/serverless stack and have the same tiring conversations about naming conventions, logging, data consistency, validation, build scripts, etc., all of which Rails gives you by default. I ended up spending more time on tooling setup than actual business logic. I eventually gave up and switched to a semi-technical product management role.
- callmekatootie 5y ago> I eventually gave up and switched to a semi-technical product management role. Could you let me know what your job title is - I am looking for something similar where I would like to work on some semi technical stuff and at the same time manage developers but not sure what title I am supposed to look for.
- zxcq544 5y agoSearch for "Project managment". There is "Product management" which sounds similar but it's a bit different: project manager talks with developers and manages task complition while product manager talks to product owner(and other business people) and team lead and manages product money making and overall future strategy.
- iamphilrae 5y ago“Solution Architect” is normally the role that lies between Product Owners and the Dev team. It’s somewhat technical, especially if you don’t have a Technical Architect counterpart.
- caspii 5y agoI firmly hope that javascript has peaked. The complexity of the tooling has increased by a factor of 10 in the last 10 years with subjectively very little to show for it. Anyone starting out with backend webdev should learn Python Flask. There is no gentler and more thorough way of learning web fundamentals, whilst still being productive from day 1.
- marcosdumay 5y agoIt's funny that at the same time the language evolved so things got much easier without any dependency. Yes, almost every other language is still more productive, but all that tooling gives you less and less each year.
- cracell 5y agoI wouldn't say that. My team uses a Rails backend and React apps on top. For us, React apps compared to Rails views just about cut our feature delivery time in half. Of course, it depends on what domain you are working in. Dynamic frontends on Rails are a pain compared to React and probably some other front-end JS. That said, on the backend Rails is a very mature framework that is hard to beat on most things.
- toastercat 5y agoI personally think Bottle.py is simpler and gentler than Flask.
- redleader55 5y agoI am curious why are you saying that. I know Flask well and while I never wrote something with bottle.py, it seems ~90% similar, at least in the basics.
- toastercat 5y agoFor me, a big one is that Bottle.py has zero dependencies; the entirety of the framework, including the template engine, lives inside the single `bottle.py` Python script. That means it's simple to use even without pip or a virtual environment: just pop the bottle.py file in your project, import from it, run `python my_script.py` in your terminal, and you server is up and running. From my experience with Flask (albeit, this was years ago), it was a bit more complex and ending up with circular dependencies was common.
- papito 5y agoWhat is happening? The two trending posts are about monoliths and "stable" languages? Are we finally breaking from the madness of unnecessary complexity, evangelized by the FAANG disciples? I resurrected a Python project of mine after 7 years. Upgraded the dependency management to Poetry, upgraded the major version of Flask. Boom. Back in business. Try that with a modern Node project after 7 months.
- spmurrayzzz 5y agoRespectfully, I really think that "modern Node project" bucket is too large to be a useful descriptor. I do this with Node frequently with no issues (across roughly 140+ distributed systems, most using hapi & mongodb, but also some more low-level services using the core node UDP/TCP APIs). I'm sure there are modern projects that can make this painful, but if you're judicious about dependency management and staying on the LTS version of node, its rare you see any major headaches in our stack. Even for super old / legacy services (ones without automated dependency mgmt through CI), it takes maybe 15-30m to get everything up to date.
- pogorniy 5y agoHow did python2 python3 (in)compatibility work for you?
- papito 5y agoIn most cases, I just updated a few exception handling statements.
- deleted 5y ago[deleted]
- nickjj 5y agoI had a similar situation to the person you replied to and it wasn't bad. I took a project with ~20 top level dependencies and around 5k lines of Python / Flask (plus a lot of tests). I YOLO'd upgrading everything to their latest versions in 1 shot including Python 2.7 to Python 3.7, Stripe API versions and everything. I did that around 2.5 years ago and it took around 45 minutes. The app was using SQLAlchemy, Celery and had a bunch of things you'd expect to see in a SAAS app (users, custom admin, payments, custom CLI commands, migrations, etc.).
- progx 5y agoI switched from Ruby on Rails on my side project to PHP. Building the web app in PHP took me 2 hours – the same thing in Rails would have taken 2 days. Now i have time to read HN.
- lunfard00 5y agodont worry, php destroys ruby performance wise [1]. Kinda fun that even javascript is faster, apparently performance is only a factor to circlejerk against js [1]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-php.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- alifaziz 5y agoSimilarly to Rails, I believe you're using PHP framework?
- progx 5y agoNo, only PHP. The Author uses only Node too. Why should i use a Framework?
- johnchristopher 5y agoIt'd be more interesting to see how you replaced rails framework stuff that need 2 days to build your project with vanilla PHP code that takes 2 hours.
- flippinburgers 5y agoThis just doesn't ring true to me. Rails is very simple and fast to develop in.
- 65 5y ago> I decided to try Rails after writing boilerplate in Node for two hours with Express, Postgres, EJS, Knex, etc and having a simple ‘hello world’ to show for it. Well there's your problem. If you were to `npx create-next-app` you'd have most of what you want already done for you.
- ankit70 5y agoI think AdonisJS comes quite close to overcome this.
- proxyon 5y agoYep. OP is comparing apples to oranges.
- regularfry 5y agoYes, but imagine you've existed on a diet of nothing but oranges for your entire life, frankly you're bored of having to peel the damn things and the bitter pith left behind is, truthfully, frustrating as hell. Someone throws you an apple - what is this food that you can eat without peeling? Think of all the time you can save not peeling fruit! Surely you must tell all your orange-peeling friends the good news?
- chaostheory 5y agoimo https://blitzjs.com/ https://blitzjs.com/ is an even better apples to apples comparison
- sheunl 5y agoI have observed this but with Laravel/PHP. If you are a specialist NodeJS is not bad. But if you are a generalist with deadline and business logic to implement a more mature development ecosystem is advisable, in my opinion.
- midrus 5y agoTHIS! I've worked many years with Django (doing old style MVC), then moved to do all the SPA stuff (worked with React mostly and some Vue). Now I'm back to MVC using Laravel and Livewire and it is simply awesome. If the decision is on me, I'm not going back. Laravel is awesome, and current day PHP is not 10 years ago's PHP the same current day JavaScript is not 10 years ago's JavaScript
- Toutouxc 5y agoFor me it actually boils down to the language. I hate almost everything about JavaScript, its syntax, the decisions made and steps taken in its development, and writing Ruby, any Ruby, not just the Rails flavored kind, feels like a breath of fresh air after suffocating in the JS dungeon. My productivity takes a huge hit each time I have to work on a JS codebase, because my brain just doesn't enjoy thinking in JavaScript. (Yeah I know this post isn't terribly informative, but neither is the article, so I'm expecting some light-hearted posts)
- tebbers 5y agoFor sure, the Ruby standard library is so much better than JS and Rails adds even more great helper methods on top of that.
- jhgb 5y ago> I hate almost everything about JavaScript, its syntax, the decisions made and steps taken in its development Well, one of them was done in ten days by a guy who liked Java and the other one was done in a few years by a guy who liked Smalltalk, so...
- regularfry 5y agoWhat he liked was Scheme, not Java. You can catch a whiff of it every now and then. He got told to give it a Java-like syntax by a PHB so they could ride on Sun's marketing coat-tails. And that's part of the problem: if what we'd started with was Java--, we might not have quite such a mess today.
- qudat 5y agoThat's really interesting because I feel like ruby/rails is suffocating. There's virtually no static analysis tooling, it's difficult to find function/method definitions, and the language supports meta-programming to such a degree that things become too dynamic. I open a file and I feel completely lost.
- baja_blast 5y ago
- smitty1e 5y agoMy experience of light tinkering with frameworks in the Rails/Django mode is that they are outstanding if the task at hand falls withing their paradigm. If one has a requirements shift, and is told to integrate some other prior art, then deep exptertise on both the language and the framework are needful. That is: the silver bullet is mainly available at the gun range.
- shafyy 5y agoI've said this before on here, but the Rails philosophy really clicks with me. Working with Rails is just more fun than with any other language/framework, especially JavaScript. I understand that this is subjective, but it's good that different choices, including Rails, exist. Rails is opiniated, and I love that: https://rubyonrails.org/doctrine/ https://rubyonrails.org/doctrine/ Edit: Oops, looks like the new website they release somehow fudged the doctrine page. Here's the Wayback Machine link: https://web.archive.org/web/20211126010919/https://rubyonrails.org/doctrine/ https://web.archive.org/web/20211126010919/https://rubyonrai... Update: Oh, they changed the link, here you go: https://rubyonrails.org/doctrine/en https://rubyonrails.org/doctrine/en
- deleted 5y ago[deleted]
- SavantIdiot 5y agoPHP clicked with me for 15 years. I was extremely reluctant to use Node/Express because it required me to be more nuts-and-boltsy, I liked how PHP just did everything (like multi file uploads from forms). What one me over about node was that PHP never forced me to develop with module patterns, it was just brute force, spray code everywhere and walk away (we all did that, actually, which made support a nightmare). It also came with robust CI/CD testing (Jest is a big deal once you get over the step-function). Perhaps PHP has all of this integration and testing, but I'm so into node now that I don't really want to go back. And I see very little reason to pick Rails over PHP over Django over Node! Whatever works for your team is what matters. I bet you could find a Fortune 500 company that uses any one (or all) of those.
- RangerScience 5y agoI can't speak to PHP, but I can speak to the others. Node's easy, as it's technology, not a framework, so you'd pick Rails over it if you wanted a lot out of the box. JS also "thinks" differently than Ruby (callbacks, and now async, pretty much everywhere). PS - If you haven't played with lots of curried functions in JS, it's fantastic (IMHO). If I wanted a more same-same comparison, the choice is between Sinatra and Node, and IMHO that's a lot more even (and for me, broken by one of them being in Ruby ;) ) Django's more subjective, but my experience with it was very not-great. There's a lot of decisions in Django that look good on the surface (apps, for example) that then don't pan out (apps all end up blurred together, for example). Particularly compared to Rails, I found Django waaay more boiler-plate and frictiony (particularly the migrations), but that's fitting for a language (Python) that's actually more lower-level than expected. Python (and Django) are opinionated where Ruby (and Rails) are welcoming, IMHO.
- _wldu 5y agoIMPO, the only significant advantage of micro services and JS is client-side rendering. If you need to publish content to hundreds of millions or billions of clients, then that makes sense. But for most systems, a Linode VPS running Rails, PHP or whatever (with a CDN in front of it) is more than adequate.
- ankit70 5y agoI built a project with Express, custom authentication, Turbolinks/StimulusJS, Mongoose and ended up using the similar approach to Rails anyway. Rails with Hotwired seems to be the ultimate one person framework DHH wrote about today - https://world.hey.com/dhh/the-one-person-framework-711e6318 https://world.hey.com/dhh/the-one-person-framework-711e6318. Really want to try and use Rails for future projects but the magic is just too much for someone new to Ruby/Rails. I had to rewrite the routes with brackets in Rails to understand the working.
- dncornholio 5y agoIf it has too much magic, try Laravel, it's PHP but it offers the same paradigm
- petems 5y agoI think the coolest thing about Rails is actually the great amount of high quality Ruby gems for Rails. For instance, you can bootstrap a powerful Admin panel for your Rails project in no time with https://github.com/motor-admin/motor-admin-rails https://github.com/motor-admin/motor-admin-rails gem.
- otrahuevada 5y agoThis is kinda sorta equivalent to "from Apache HTTP Server to Phoenix Framework" though. Like, yes of course an actual RAD framework has more things built into it than a server runtime. That's kind of why they exist. Your programming environment should more or less reflect your requirements, strengths, and priorities, and starting with plain Node makes sense for a development style that OP just doesn't seem to want to follow, so he's spending a ton of time building 'boilerplate' to try and shim his process into his tools when the tools should be the ones doing the work for him. Like, all that stuff about CRUD and auth. Just use Prisma and Passport?. No need to twist yourself into a knot building the same abstractions over and over by hand, the things exist and are there.
- vishal_new 5y agoWhen I started my web dev career. I have to say Rails was the easiest to get into(It was Rails 4 then). You need to give into the magic in the beginning. I still love it and is main goto thing unless scalability is millions of requests per second. Some problems I had - Upgrade from Rails 4 to 5 was a pain - Memory was a big problem in some apps
- dangerface 5y agoComparing a language like node to a framework like rails is like comparing a language like C++ to a database like H2 they both have different goals and use cases. Sure you can build a database like H2 in C++ and yes doing so will take ages which I think is why most people don't do that and just use MySQL instead of reinventing the wheel. Does this mean we should switch from C++ to H2? Obviously not, what am I missing? Wouldn't a more useful comparison be something like Node vs Ruby or Rails vs Sails
- croes 5y agoNode is a language runtime not a language.
- dangerface 5y agoOk replace c++ with GCC the comparison still doesn't make sense.
- hank-biteline 5y agoSupabase (or similar) is going to change all of this very soon. I can't wait for open source technologies like postgrest and typescript RPC to mature. No more boilerplate HTTP code, no more boilerplate database endpoints. Need a backend function? Just define the interface, and boom you are writing backend code that you can call directly from your frontend. Really really exciting stuff is right around the corner IMO.
- bliteben 5y agofeels like the js ecosystem has been in this state for 5 years
- hu3 5y agoCan you recommend resources about TypeScript RPC?
- config_yml 5y agoRemix.run has this figured out. Basically your backend is just a loader/hook that is colocated in the same js file. It would be great to have this idea in Rails view layer, for more complex UX cases.
- tbonesteaks 5y agoYes. I was reading through wondering if someone was going to mention Supabase. Not a web developer by day. I do telecom stuff. I’ve been bouncing around trying different frameworks because I want to build a website, and once I found postgREST and then Supabase I loved it. Supabase has a a lot of components, but all specific and exactly what you might need. I am documenting my process of building my first web app here: http://tbonesteaks.gitlab.io/blog/ http://tbonesteaks.gitlab.io/blog/. Just started it today, so it’s rusty.
- hank-biteline 5y agoWith Svelte too, nice
- lnxg33k1 5y agoI think learning new things is always good, if anything I have worked along the years primarily with Symfony/PHP, but as a freelance you try to get projects regardless of tech stack, I've worked on projects using ASP.NET MVC, Phoenix, I've done iOS with ObjC/CocoaTouch back in the days, or Django, and I have the impression that being exposed to different kind of solutions is always enriching and you can bring back to your main stack some fresh ideas/approaches
- JackFr 5y agoMy takeaway from this is that it’s extraordinarily important to try different tech stacks. I’ve primarily worked as a Java dev for the past 20 years, but I’ve got significant time doing python and one non-trivial Rails app. The funny thing is I’m most comfortable and I believe most productive in the Java ecosystem, but only because of the time spent working in other languages. Coming back to Java after python, one gets a better feel for what’s essential and what’s cruft. Similarly, when Rails first came out, it can’t be understated how revolutionary it was with respect to web development. Coming from the J2EE universe it was like the true essence of web development had been hidden from us with servlets, JSPs, wars and ears. That being said - I’m happy being a Java - well JVM at least - developer. The ecosystem is alway changing and often improving, but I assure you it wouldn’t if not for the evolutionary pressures of things like JS & Node, Ruby & Rails and Python & Django.
- abraxas 5y agoThe Java space though unloved but the younger crowd is still super strong and Spring Boot gives all those competing platforms a run for their money leveraging the enormous JVM ecosystem. Java may not be the most concise of languages but I think many people would be surprised by how little boilerplate there is in modern Java and Spring.
- noisy_boy 5y agoSpring is pretty lean as long as your use case is typical and common - you can practically setup most of the foundation just via config. However, anytime you have to deviate from the typical, the complexity of the Spring framework underneath starts to show and the beans and boilerplate start to grow pretty fast - not unmanageable but not exactly lean either. Fully agree about the ecosystem.
- __jem 5y agoAt the same time, this flexibility is a core feature of Spring. In most other frameworks, when you have a use case that isn't supported, you're entirely on your own. Or, worse, end up with in-house patches and hacks to the framework itself. Spring is an integration framework, and so closer to a framework for building frameworks. It just so happens to have a bunch of well supported ecosystem defaults.
- maxdo 5y agonot worth reading , Summary: baseless claims I love <X> and it much better compares to mainstream <Y>
- awb 5y agoOr: How building and maintaining large production apps in <X> isn’t fun, but building small prototypes in 2 days in <Y> is amazing
- pyrrhotech 5y agoComparing Rails to Express is not apples to apples. You should compare Rails to something like Next.js that has a lot of the magic and plumbing taken care of for you on both the front end and the back end. I agree that for side projects, underfunded startups and especially for product/business-focused founders, using the quickest magical prototyping framework is definitely the best idea so I agree with the overall sentiment of the post, just not the specific conclusion that Rails is the best way to go in 2021. I still believe strongly that having the same language on the front end and backend is paramount to developer productivity.
- leodriesch 5y agoNext.js is cool but the framework part of it just applies to the frontend. The backend is as raw as it gets, it is very comparable to Express.js. No authentication built in, no ORM, no ActiveStorage, ActionMailer, no nothing really there.
- midrus 5y agoNext.js is extremely limited compared to Rails, so you're still not comparing apples to apples. Add to next.js a librarydatabase access, background jobs, csrf and related security stuff, migrations, server side caching of data, *validation*, email sending, email receiving, testing, and I could spend an entire day listing things Rails gives you that Next.js won't give you. Web development is not just rendering html, unless you're building just landing pages, there's a lot more going on.
- jerrygoyal 5y agoNot next.js, but nest.js is a better opponent for rails
- midrus 5y agoHow to do an unique validation in a full stack framework (Laravel): https://laravel.com/docs/8.x/validation#rule-unique https://laravel.com/docs/8.x/validation#rule-unique How to do a unique validation in nestjs (didn't find it in the docs, so had to Google it): https://gist.github.com/zarv1k/3ce359af1a3b2a7f1d99b4f66a17f1bc https://gist.github.com/zarv1k/3ce359af1a3b2a7f1d99b4f66a17f... No thanks. This is still apples vs molecules to mount your own apples.
- streamofdigits 5y agoI think it really matters whether the core of added value of your solution is on the client side or the backend processing. For example (in a parallel but similar universe to ruby) you have python, django and vast sea of data science / machine learning "plugins" you can just pull into your project. Add to that that the idea of creating "desktop like" experiences in the browser seems to go against the grain of what the web is and we may indeed have reached "peak javascript" Maybe the success of vue and the emergence of htmx point to this underlying reality
- morphicpro 5y agoNo one tell them that most of us rails devs moved on to elixir/phoenix
- charlieyu1 5y agoI don’t like all the webpacker, but Rails 7 is released 15 hours ago maybe I can enjoy it now
- jjice 5y agoThe biggest thing holding me back from moving to Djagno or Rails is the DB interaction. As someone who is comfortable and prefers raw SQL, do I just have to man up and embrace the ORM for everything but situations where I _need_ to make raw queries? I've also grown like sqlx (both the Rust and Go versions, despite them not being related as far as I know). The methods for mapping directly to structs work really well and captures one of the biggest issues I've had (literally the object-relational mismatch). I feel like I'm in a state of decision fatigue with web frameworks. I've used many shallowly, but I just never know if I'm making the right decision. It's probably safe to assume the best bet is the one I choose and stick to though...
- csisnett 5y agoHave you heard of Ecto? You can run raw sql, and even if you use the library methods they're similar to sql
- sparker72678 5y agoIf you've never really gotten over the hump of going all-in with an ORM, I think it's worth giving it a shot. It's a different way of thinking than always-raw-SQL, and it can be uncomfortable at first, but I've found it ultimately freeing to be able to offload nearly all the SQL I had to write back in the day. YMMV.
- m_ke 5y agoYou can use raw sql in django where it matters and let the ORM handle standard CRUD operations (https://docs.djangoproject.com/en/4.0/topics/db/sql/ https://docs.djangoproject.com/en/4.0/topics/db/sql/). I usually start with the ORM and if I need to do something complex or if there's a slow query I just rewrite it in SQL when it becomes an issue. Also if you'd like to manage the tables with SQL there's an easy way to generate the models from the database schema (https://docs.djangoproject.com/en/3.2/howto/legacy-databases/ https://docs.djangoproject.com/en/3.2/howto/legacy-databases...). I've used it before at a startup to migrate from hand coded schemas and migrations in SQL that only one person was brave enough to touch (they had no way to run things locally) to a full consistent REST API for like 20 tables ready in 2 days. I'm also managing an SQLite db on a mobile app that uses hand written SQL (with 20ish tables and a few 100 queries) and any changes to the database end up being a nightmare of manually editing raw strings.
- ingend88 5y agoWhat is the best place to learn Rails now ?
- dimitrisnl 5y agoGoRails (https://gorails.com/ https://gorails.com/) is pretty updated
- danvoell 5y ago"I feel like I’ve struck on a magical treasure from the past" - dang I feel old. Recently got to dig into a MERN stack application. Seemed really easy to build but I still have no idea how the plumbing works. I'm using 5 applications where I used to use 2.
- gjmacd 5y agothen he gets more than 10 users on it...
- janglezz 5y agoUm... https://twitter.com/ShopifyEng/status/1465806691543531525 https://twitter.com/ShopifyEng/status/1465806691543531525
- qnsi 5y agoOne thing I want people to consider when choosing new tech stack is what startups are using. At the beginning of december I analyzed random 39 startups from last 3 years in YC. This is what they recruit people for (backend technologies) node 15 python 15 java 2 C++ 1 Java 2 ruby 2 go 1 elixir 1
- maxdo 5y agoruby is mostly picked by people who developed in 00s
- bovermyer 5y agoI don't pay much attention to what startups - or anyone else, for that matter - are using when choosing a tech stack for a project. What's popular is not necessarily what's right for the project.
- peruvian 5y agoStartups use whatever is easier to hire for to get stuff out the door ASAP, unless the founders have a specific technical taste. That's why now it's JS and 10-15~ years ago it was Rails.
- truth_seeker 5y agoHere we go again. ;) This issue is not about choosing RoR vs NodeJS, this is about Framework Vs Libraries or more technically speaking being lazy and choosing what other people say Vs doing proper research what best suits your project needs.
- cushychicken 5y agoThis is validating as hell to read. I built the site I'm currently working on in Python (Flask) based purely on the fact that I knew it best. I've been toying with the idea of adding a React/Vue frontend for months but I can't bring myself to do it because, well, it's complicated. I barely know where to start. It's not a 1:1 comparison to Rails (I'd love to try it someday), but I feel a lot of what the author is talking about. Boring, well developed, well proven tech makes rapid featured development a breeze.
- machiaweliczny 5y agoIf tou aren't in business of building SPAs then React makes little sense, except that with JSX you get full typesafety in client logic which is super branchy due to edgecases.
- rbosinger 5y agoI can see this. I worked with Rails for years and recently switched to an all JS stack (serverless, React). I have fun with it in general. TypeScript and the intellisense I get with that in VSCode is great, but overall I feel like I've gone way down in productivity. At first I thought it was due to my being new to this ecosystem but it has been a while now and I've concluded that there definitely is some extra burden with this modern stack. Perhaps it will turn out that the extra work and headache will lead to a more performant and maintainable codebase than we might have achieved with Rails. Time will tell for that one but at the moment it feels like we drown a lot of developer time on tooling, strange issues, and reinventing things that have come with battery-included frameworks like Rails.
- Zababa 5y agoI'm interested in the opinion of people that have experience in both the "classic MVC" frameworks (Rails, Django, Laravel, Spring) and in the "frontend first" frameworks (React, Vue, Angular). If you had to build a web app that's a subset of Excel, sold as SaaS, as a solo developer, what would you pick and why? I know that you can use both together, but I worry that by doing so you lose part of the productivity that's associated with MVC frameworks.
- midrus 5y ago> as a solo developer MVC all the way, because otherwise you're never going to finish it. Doing a separate backend + SPA is an insane amount of work compared to a traditional full stack framework. Just thinking about validations (both server and client) make my brain hurt. Also you'll have to rewrite the frontend before even finishing it given how fast the landscape changes. And even being a small team and not just yourself, I'd only think of an SPA if 1) You need an offline first experience, or 2) You don't have full stack engineers at hand and you only have backend people which don't want to touch JavaScript and frontend people which only want to work with JavaScript..... but this is more of a people problem than technical one. I've done a lot of Django in the past, then a lot of SPAs for the last 6 ~ 8 years, and now I'm back to Laravel + Livewire and I'm living in a dream right now. Everything is so easy that I feel I've been cheated the last few years.... so much time and money (from my employers) wasted...
- confidantlake 5y agoI have spent a lot of time with node(express), Java(Spring) and rails. I see a lot of complaints about node, but node with typescript has been a joy to work with. It is lightweight and has a type system. I know where every piece of code is coming from, there is no magic involved. I either wrote the function in that file, I am importing it, or it is a method on a js object. I only have know one language for both front end and back end. A better standard library would be nice. Rails is nice in terms of getting the project set up, not bikeshedding about the tooling, and working with the db. But the actual coding has been painful for me. I really dislike working with a non typed language. I dislike optional parans in function calls and optional braces for hashes. I dislike all the magic of rails. I never know what is going on because there is some functionality that inherits from a rails class or some other part of the code base. I would rather write a bit more code for a bit more clarity. Maybe if python were typed I would like Django? But python has all of that nonsense around virtualenv. Spring has been ok, but not great. Too much bloated abstract factory creator nonsense. Dependency injection never really clicked for me. All of these annotations. I quite liked plain Java but Spring just felt like this monster. All in all node(express) has been the nicest for me.
- megaman821 5y agoExpress isn't really like Spring, Rails or Django. Express is very simple and may be good for someone learning the basics, but how is a novice web developer supposed to know what is missing? There concerns from security, authorization, sessions, and many more that Express doesn't handle out-of-the-box.
- confidantlake 5y agoWhen I said rails was nice for project setup, it was things like what you mentioned. Definitely easier to do those things in rails. In express there are packages for those things, ie https://www.npmjs.com/package/express-session https://www.npmjs.com/package/express-session. Agree it would have been nice as part of the express library.
- mjlawson 5y ago> ... how is a novice web developer supposed to know what is missing? That is a great question. Is it the job of the tooling to prevent a novice developer from shooting themselves in their foot? Do we need higher-level abstractions in our frameworks that are analogous to memory safety in programming languages? Perhaps. Alternatively, I don't think that security practices are particularly hidden. Anyone who's used the web knows has used a login form. I would give most novice developers the benefit of the doubt that they're going to be curious and look into that. I would argue that it is, in part, their responsibility to learn these things. It's our responsibility perhaps as stewards of the secure web to teach and enforce best practices. I don't think baking in these best practices into frameworks does these developers any favors, except that it allows them to focus on something else.
- leodriesch 5y agoI really want to start learning Rails, does somebody know a great course or interactive site?
- correlator 5y agoIMHO this is the de-facto tutorial: https://www.railstutorial.org/ https://www.railstutorial.org/
- winrid 5y agoBlaming Node is like giving pros to Ruby instead of Rails in this case. You're comparing a framework to a runtime with poorly chosen frameworks. I bet rails is very productive. But getting a SSR hello world up with Node should take two minutes. Express, EJS, done. Most of the admin pages on fastcomments are server rendered and we add features pretty quickly (IMO).
- pocketsand 5y agoWhat Rails has done with HotWire and the Laravel community has done with Livewire is the sweet spot for me. Everything is in one place, very little doing things twice -- like validation -- in the front-end and back-end, one router, HTML over the wire, a single auth layer, cost-effective and straightforward infrastructure (db, cache, queue, load balancer, app), and well-defined idioms/conventions to do just about everything. Never looking back.
- IceDane 5y ago> Building the web app in Rails took me 2 days – the same thing in Node would have taken 2 weeks. I’ve also included things I wouldn’t have attempted to build on Node/Express until I proved the idea out (editing a profile? Psht please - I’ll wait till someone requests that I would love to hear more about what you are doing, and perhaps more importantly, how you are doing it if everything is so incredibly difficult for you. Ruby only has one thing going for it, and it's not a very unique thing and you can get the same thing in a lot of other places: it has batteries included(and then some). This can make you very productive from the start, yes, but it can also constrain you to work in exactly the way the authors intended and otherwise make your life difficult if you have needs that just fall slightly outside of the garden path. With node, you have nearly an infinite number of choices. But if you pick a stack, and you set it up properly, there is nothing preventing you from moving at speeds similar or surpassing RoR, and usually without any of the same limitations. I am currently building a full-stack application in TypeScript using React and GraphQL on top of Next.js. It is easily the most productive stack I have ever tried, even though it took some work to get there. I can change a database model and the change will propagate through my entire stack all the way to the frontend, giving me type errors in every place I need to change anything, and things like that. There are great "plugins" for nextjs like next-auth which make auth laughably simple, and then you can pick between whatever ORM you want(We are using Prisma, which has been great). With that said, if RoR fits your use case and meets your performance demands and it makes you more productive.. well, that's great news. Seems like a no-brainer to go with it then.
- ptrwis 5y agoNext.js will be to JavaScript what RoR is to Ruby, it only needs some time to mature.
- mikotodomo 5y agoI am looking into learning app development with no programming experience. Should I learn Node.js or Ruby on Rails? I hear opinions like Ruby on Rails is obsolete and then other people say it's better because it's more traditional. If it really is obsolete then how are people still using it? But then is Node.js easier and more useful?
- erichocean 5y ago25 year vet who knows both well: learn Ruby on Rails, the on-ramp is very gradual and you probably won't need anything else if all you want to build are SaaS-like web apps.
- janglezz 5y agoPeople who say rails is dead or obsolete have no idea what they are talking about. Rails is better than ever, the core community has stayed strong even while everyone hopped on the javascript hell bandwagon. Enjoy your life, learn Rails.
- machiaweliczny 5y agoLearn Sinatra/Express and then whatever you feel like. Sinatra is simple and good for learning. Node.js isn't easier but it's more useful in practice IMO. Learn Next.js after sinatra/express and you are good for 80% of jobs.
- overton 5y agoRails is unquestionably better now than when it was new and cool. Before, the ecosystem and core framework were evolving at a rapid pace, leading to some suboptimal patterns and sometimes making maintenance a bit of a nightmare. Now there's a pretty settled solution for most things. If you want to get started building apps without much fuss, there's no better way.
- montblanc 5y agoWill JS/Node become further fragmented by Typescript/Deno? That could make it a bit nasty to build with JS.
- bern4444 5y agoI've been using Remix a bit and absolutely love it as a framework. It has a great mechanism of separating server and client side code where you can colocate server side code that only applies to a given route on your page. This makes it trivial to write awesome web apps that don't need any JS on the client to work. Of course if JS is enabled client side you can do a lot more but this way the app is good to go without needing to parse any client side JS. All data can easily be fetched on the server and passed down to the client for any route.
- atlantageek 5y agoOne thing that often gets ignored is the importance of getting new developers up to speed. You go to an existing C# ,node.js or Java app and its painful to twist your mind around the architecture. Ruby on Rails helps you with that. Oh db change well lets jump in to models. Oh the business logic change well jump into the controllers. Its easy to get up to speed when joining an existing project.
- clairity 5y agoi love rails, but i’d point out that business logic exists all over the place in a rails app, not just in the controllers. that’s because rails has no standard solution for compound requests (those involving many models and/or multiple actions) that go beyond the simple semantics of http verbs (which i totally appreciate for what they are). some might say that’s a design issue to be worked out depending on the situation, but sometimes, you just need to do lots of different stuff in a single request context. rails doesn’t cope with that issue very well (some suggest a command or strategy pattern, others service objects, etc.), which is one of the only major criticisms i have with rails. node/npm dependency was another big criticism, but they’re fixing that with rails 7. =)
- janglezz 5y agoI like creating a service/coordination layer between controllers and models to put the business logic. Controllers call the services or coordinators which can interact with models, kick off jobs, or call other services. Easy to test and change and keeps controller and model code more manageable. For smaller apps you can get away with shoving all your business logic in the models but that can become a little tough to manage as the logic becomes more complex.
- TheDesolate0 5y agoEw! Ick! Nope. RIIR.
- cblconfederate 5y agoI d like to see a sociological analysis of this. It seems to me that the JavaScript fad (which is fading now) came from a generation of developers who have different priorities. While RoR came at a time when developers wanted to ship working websites fast, it seems javascript serves other priorities, like showing off your colorful code to investors or impressing your superiors in Megacorp Inc with your new 11 level abstraction that is perpetually compiling. In the end people always get what they incentivize
- antoniuschan99 5y agoI’ve come to learn that technology is both cyclical and fashion, but driven mainly from advancement if course. Is this Rails version still a monolith? Because the way Web3 is trending and with decentralization, microservices should remain the dominant architecture.
- xutopia 5y agoI'm reminded of this all the time whenever I want to do a side project. I think to myself I should checkout a new framework or language and aside from Phoenix/Elixir and Rails/Ruby I have not found any that use conventions that allow you to concentrate on features and your product decisions as much. Node is a clusterfuck of technical decision making at every step in comparison.
- overgard 5y agoI think Rails is great (although some of the "magic" tends to concern me), but I gotta say Typescript is the biggest factor for me sticking with node. I just really love type annotations even if the underlying runtime is dynamic.
- tomerbd 5y agowait until you find out about vaadin
- arbuge 5y agoThis is probably going to generate a lot of controversy around these parts, but I'd argue that PHP is an equally good option to try these days if you're coming from the Node world and want to try something "new". If you keep an open mind, I think you'll be pleasantly surprised, and end up being able to build actual products much faster, as the author here did with Rails.
- jaredcwhite 5y agoIt feels really good to be in a "post-justification" phase now for Rails. With the release of Rails 7, the successful marketing of Hotwire, the resurgance of Ruby (don't call it a comeback!) with v3 and beyond, and the amazing vitality of web-scale platforms built on top of Ruby/Rails like GitHub and Shopify, we're way past the point of having to "justify" why someone should pick Rails for their web stack. We're here to stay and kicking ass. There are plenty of stacks out there to build web software with, and everyone has a favorite, but Rails is a solid choice—arguably the best choice in certain categories—and there's no need to explain why you've picked Rails for a project. It continues to be one of the most productive and rewarding frameworks in the business.
- gmaster1440 5y agoComparing Node to Ruby on Rails seems misguided, wouldn't a more apt comparison be something like Next.js or Svelte Kit to Ruby on Rails? Ruby has its fair share of minimalist[1] web libraries and small gems that aren't very different from Node web servers and npm packages. [1] http://sinatrarb.com/ http://sinatrarb.com/ Edit: I've noticed at the bottom the author mentions that they use "Node" to mean Node web frameworks, but still I think there's something lost to not mention the new wave of frameworks like Next and Svelte Kit.
- chaostheory 5y agoYou're right, but frameworks like Blitzjs (built on top of Nextjs) and NestJS are probably better comparisons. I went in the opposite direction from Ruby to Node land, and it's just as easy and quick to build an app now just like Rails. The issue with nodejs is the paradox of choice. Just like in Java, there are so many full stack frameworks to choose from that it's easy to get decision paralysis, where as there's only really one choice in both Ruby and Python.
- nahtnam 5y agoI fully agree with this post but it's missing one important (to me) factor. With TypeScript I can reduce the number of tests I have to write and I can be significantly more confident when writing code solo. So I'm more than happy to spend 2 weeks (more like a day) to set up the boilerplate.
- andrei_says_ 5y agoMy issue with boilerplate code is that I have to read it over and over again.
- janglezz 5y agoRails just keeps getting better and better. It’s an exciting time to be a Rails dev.
- jkaplan 5y agoThis comparison feels like it's less about Node vs Rails and more just about "batteries-included framework" vs not. (Although, perhaps there isn't really a Django/Rails equivalent in Node yet? I'm not definitively sure.) >I’ve always found it hard to climb out of the plumbing, forget about it. This is the crux it of it, and it's true for any web project not relying on "magic" frameworks. And of course, it comes with tradeoffs. Namely, frameworks can be inflexible, and they can be difficult to understand/debug under the hood. There is no escaping these tradeoffs, with any framework or language. More magic means less plumbing and more initial speed, but less flexibility and potential issues as complexity/scale increases. It's all about trying to choose the best tool for the job.
- mdoms 5y agoI guess things are different in the USA market but at my current gig we cannot hire Rails devs for love nor money. We offer competitive rates and we will even train up non-Rails folks on our dime, but in my country Rails is considered an obsolete joke by most developers and there is no interest in pursuing it as a career. Going forward we are writing new parts of the system in other stacks partly as a hedge against the impossibility of hiring for Rails.
- czhu12 5y agoJust to throw my hat in the ring, Currently CTO /founding engineer of health tech company that runs a Rails backend that serves about 150QPS. I hear over and over that rails doesn’t “scale”. Performance wise, we have never had a problem scaling rails itself. The issues were always at the database level. Most slow endpoints (1.5s+) are 10% Ruby, 90% Postgres. Even if Ruby was magically infinitely fast, these endpoints would go from 1.5s -> 1.35s. Optimizing data infrastructure gets 10x returns compared to the application code. Maintenance wise, it’s a bit harder, Rails loves to put everything in the global namespace. This comes down to your team being conscious of properly namespacing different logical parts of your app.
- jasonhansel 5y agoAgreed. Scaling application servers is "easy" since they can be scaled horizontally; in other words, you can just throw more hardware at the problem. Scaling databases is "hard" because of CAP/PACELC-type issues in maintaining consistency, and because some DBs (like Postgres) don't have good support for horizontal scaling.
- stepbeek 5y agoI’ve found DDD’s insistence that cross-aggregate aggregation be done through IDs to be helpful here. It makes transitioning to other persistence implementations easier.
- ylhert 5y agoPreach! I do not understand this criticism at all. Rails scales just fine, in a web app it's the DB that's the bottleneck 99% of the time. Sure, the ORM can get you into hot water easily if you do dumb things (or just don't pay enough attention to N+1's etc), but one should be using the ORM wisely and deliberately, rather than living ignorantly of what's happening behind the scenes.
- lab14 5y agoHaving built a Rails app with my team that handles ~76k rpm on peak days (99% of responses within 90ms), I've learned that you scale your architecture, not your framework. Rails is just fine.
- hwers 5y agoIn my eyes this kind of feels like another sign that things have stagnated in tech (on the fundamental innovations front, not the 'people are doing things' front). There was a massive explosion of thing happening a decade ago but today not so much, even to the point that you can get away with using years old tools without really much disadvantage.
- dvogel 5y agoThis is a pattern I've noticed throughout history. I really wish there was a popular science book that tried to answer the question: why do humans seem to make so much progress with each initial invention? It seems like everything from bridges to antibiotics, the initial inventions have lasting power because they address 80% of the problem. The track record of success inventing an 80% solution as the first entrance is astounding but it is clouded by our focus on the exceptions like flight where we were stumped for a long time. Surely there's some survivorship bias too. We don't remember the bridge designs that failed immediately, but I'm focused less on that. Why are _any_ of the initial designs in so many fields still around? Why are fundamental shifts that completely upend our understanding of fields so rare?
- abvdasker 5y agoI've also noticed this trend, but I never see it discussed or talked about within tech or without. It feels like the second renaissance in computing brought on by the smartphone is petering out. Maybe it's because I'm cynical about cryptocurrency, which is where people say most of the "innovation" is right now.
- didip 5y agoBut why? Seriously though, the performance degradation and the "too much magic" problems are not worth it. You could use one of many project bootstrapping tools to quickly spin up web applications in Node, Go, or Rust. If you still insist on using a dynamic language, then at least try the Phoenix framework in Elixir. It offers so many more good ideas.
- janglezz 5y agoIt's totally worth it imo. The performance degradation for 99% of web app use cases is negligible compared to the productivity increases. My team switched from a node/react environment to a full stack rails monolith with stimulusjs and we're shipping faster with less bugs. What do you consider "too much magic"?
- lab14 5y agoI've come to realize with the years that "too much magic" usually means "I don't really understand how this piece works".
- haolez 5y agoCan someone with experience in both Rails and Nest.js compare the two?
- robertwt7 5y agoCurious how the comparison of "battery-included" frameworks instead of un-opinionated like express. I think Rails would be comparable to something like NestJS in node. Probably it will take both 2 days? However different experience for sure.
- deleted 5y ago[deleted]
- mfrye0 5y agoWhile I get the argument for Rails, I find I'm much more productive when working in one language (Javascript) across both the frontend / backend. As to the low level nature of Node/Express vs something like Rails or Django, I've tried SailsJS and Loopback, which are probably the closest comparisons in Node, and ending up regretting it. Every time I chose a high level API framework / ORM, I felt like I was fighting it or trying to find a workaround for the simplest things. I now choose Express or Koa for most projects.
- moneywoes 5y agoWhat about Django vs Rails?
- shanghaikid 5y agoVery nice article, thanks. Does anyone has some performance report about node and ruby in 2021?
- unixhero 5y agoRuby on rails is simply amazing to work with.
- cryptos 5y agoAfter trying ruby on rails some years back I didn't really liked the framework. I see the benefit of the "batteries included approach", but I didn't like several design choices and back than also the configuration of rails was not fun. I'd prefer Spring, Quarkus, or Micronaut with Kotlin, because I think these frameworks have better APIs and the performance is better. I also enjoy static typing with a modern language like Kotlin.
- josefrichter 5y agoI keep saying, half-jokingly: write it in Rails, if you hit Rails limits, it means you've made it! There are very few projects that need something else than Rails from the very beginning.
- infologics 5y agoI really like reading through a post that can make people think. Also, many thanks for permitting me to comment! http://infocampus.co.in/ui-development-training-in-bangalore.html http://infocampus.co.in/ui-development-training-in-bangalore... https://www.firstenquiry.com/ui-development-training-in-bangalore https://www.firstenquiry.com/ui-development-training-in-bang... http://infocampus.co.in/web-designing-training-in-bangalore.html http://infocampus.co.in/web-designing-training-in-bangalore.... http://infocampus.co.in/web-development-training-in-bangalore.html http://infocampus.co.in/web-development-training-in-bangalor...