rails vs. nodejs

I am going to make an opinionated comment here. This is just my opinion and everyone has one.

I think rails is the best framework out there. But I think all these frameworks do not solve any actual problems. They just abstract problems to simpler forms. On the other hand nodejs actually created a new and revolutionary way to develop web applications easily. Almost like writing a simple script.

I am going to make an opinionated comment here. This is just my opinion and everyone has one.

o·pin·ion [uh-pin-yuhn] –noun 1. a belief or judgment that rests on grounds *insufficient to produce complete certainty*. (my emphases)

I think rails is the best framework out there. But I think all these frameworks do not solve any actual problems.

No? One problem they solve is to take the grind out of building web apps - all the repetitive stuff that you need to do with every new app. With that labour freed-up, the developer can now concentrate on the specific domain problems.

On the other hand nodejs actually created a new and revolutionary way to develop web applications easily. Almost like writing a simple script.

And what "problem" does that solve? Are you suggesting that the Ruby code in Rails is not simple? Or that in comparison, a developer can write more simple scripts in NodeJS than they can in Ruby?

I'm struggling to see the rationale for you "opinion". I certainly can't see any historical weight to your voice that would lend you any credence, and as such, you're really sounding like a troll.

Your biggest flaw (which is common in these "my dad vs. your dad" postures) is that you're not comparing apples to apples. NodeJS is an event-driven server scripting environment, which Rails is nothing of the kind. You might as well have said " I think all these frameworks do not solve any actual problems. On the other hand a crocodile has really big jaws." - It would have been more curious to read :-/

+1

It’s late 2018. Is Ruby still what managers are turning to for significant numbers of new web projects?

Are there sets of requirements that are so simple, that almost everyone with any experience would choose some other stack not involving the Ruby language? E. g. a web site requiring a CMS and a 'blog and little to nothing in the way of custom tables?

I’m not experienced with many kinds of projects on the Web, and so I have this maybe naive thought that with nodejs, at least people can use the same syntax for code that runs on the server and code that runs in the browser. Doesn’t having that single syntax reduce the intellectual burden somewhat? If Ruby is still getting a lot of traction for new projects, what are said to be the benefits that outweigh the drawback of using two languages and so having to keep mentally changing gears?

It's late 2018. Is Ruby still what managers are turning to for significant numbers of new web projects?

Are there sets of requirements that are so simple, that almost everyone with any experience would choose some other stack not involving the Ruby language? E. g. a web site requiring a CMS and a 'blog and little to nothing in the way of custom tables?

I'm not experienced with many kinds of projects on the Web, and so I have this maybe naive thought that with nodejs, at least people can use the same syntax for code that runs on the server and code that runs in the browser. Doesn't having that single syntax reduce the intellectual burden somewhat? If Ruby is still getting a lot of traction for new projects, what are said to be the benefits that outweigh the drawback of using two languages and so having to keep mentally changing gears?

The kinds of JS you would write for the front-end are markedly different than the kinds of JS you would write for the back-end. They have different concerns, and so they are expressed differently in code. The language you choose is akin to the alphabet, the words and sentences you need to compose with that alphabet are fundamentally different depending on the task at hand, and the head-space you occupy as a developer when writing must be as well. Those conceptual differences are far more important than the syntax and libraries you use to express them in code, so they should drive the choice of language and framework.

The "same code in server and browser" has always felt like a false syllogism to me. You wouldn't use the same vehicle to haul a load of bricks to the dump as you would to win a road race, would you? Ruby has a settled, mature standard library and rich and expressive tooling for Web applications in Rails. If you wanted to build a SPA, you might choose Node or Ember or Vue.js, backed with an API in Sinatra. If you wanted to build a vanilla-standard blog, you might reach for Wordpress. In other words, use the best tool for the job.

"Consistency is the hobgoblin of simple minds."

Walter

I mostly agree with Walter, but:

The kinds of JS (ES6, React, Vue) you would write for the front-end are markedly different than the kinds of JS (Express, SQL/JSON DB) you would write for the back-end.

is just like

The kinds of Ruby (controllers/ERB/templating/stimulus) you would write for the front-end are markedly different than the kinds of Ruby (Rails Models/ActiveRecord) you would write for the back-end.

At the end of the day, they are more similar than they are different. What you really need to go to the “lot” and test drive the “car”:

Ruby on Rails (stock): https://repl.it/@jakeNiemiec/RecursiveResponsibleOperatingsystem

“Node.js” (express + sqllite): https://glitch.com/edit/#!/smiling-thing?path=server.js:1:0

Above are 2 different sandbox platforms that you can test out the ergonomics of the frameworks. At the end of the day, they both “abstract” away concepts like:

  • Given “route” /, render or send ‘index.html’
  • Given “resource” /some_resource, build a SQL query to query the DB and render/send it back as JSON Just steer clear of anything that claims “zero-configuration”. Abstraction comes at a cost and you are bound to the choices that the framework/library author made. Generally, both Rails and Node.js are very liberal in this way.

All that being said, it all comes down to: features vs cost. Rails is more expensive to host & more expensive to develop for, but that expense is negligible if you need a complex app. If you are just making a CMS I would take a look at this table: https://www.gatsbyjs.org/features/ (compares features/links from multiple cms tools)

Citation?

I’ve been a professional web developer for 16 years now. “Professional” as in “receiving money for pushing buttons on the computer with a varying degree of purposefulness”.

After 3 years of working exclusively with nodejs on the server- as well the client side, I landed a Rails job again. And I have to say one thing: Nothing, and I mean NOTHING could separate me from the Ruby and Rails community EVER again. The Ruby and Rails communities are the most welcoming, loving people you will ever find. The only likewise welcoming community in the javascript world (in my opinion) is the Vue / Nuxt.js community. And with webpacker, you can now have literally the best of both worlds.

Also, using ActiveRecord on the backend is still second-to-none in terms of ease of use. Good luck with ACID guarantees in all these NoSQL databases and transactions entangled in a labyrinth of asynchronous javascript.

What I want to say is: I love Rails.

what kind of websites were you developing 16 years ago? where did you connect using a dial up modem? 56k?

Be kind to your elders. I built my first site for money for an ad agency in 1997. That was 21 years ago. It was entirely static HTML except for a CGI contact form and some sort of "interactive quiz" thing that was meant to siphon in the clients. Tons of inline JS rollovers, because we were very modern. At home I had a 56K modem, to be sure, but at work we had a T1.

Walter

I’m with Stefan. I started out with php,mySQL. now i’m moving to Rails. You can build a very crude website with a database with lines of code. Bet that using any thing else.

Cheers Dave

what kind of websites were you developing 16 years ago? where did you connect using a dial up modem? 56k?

Crappy browser-based multiplayer games. No, 16 years ago we already had DSL.

I think rails is the best framework out there. But I think all these

frameworks do not solve any actual problems. They just abstract

problems to simpler forms.

Can I assume you’ll be going back to writing assembly then?

Or will you be sticking with pure machine code?

Hassan: Citation?

How about DHH himself?: “The reason you shouldn’t use Rails is that the community is full of experienced, senior developers who might have families and therefore are EXPENSIVE.” https://twitter.com/dhh/status/1034481397430251521

Don’t get me wrong, Rails is a pleasure to work with…there are just a bunch of cheap, cost effective options that rails simply can’t compete with (and that’s OK). Take the Glitch.com link above, they give you a lot for free and people host microservices like forum bots there all the time (plus it’s made by the StackOverflow team).

Joe: what kind of websites were you developing 16 years ago? where did you connect using a dial up modem? 56k?

I remember back when I switched to a faster dial-up number (my down was half a kilobit), but then the phone company charged me for long distance.

Stefan: And I have to say one thing: Nothing, and I mean NOTHING could separate me from the Ruby and Rails community EVER again. I am right there with you, I have even convinced a few nodejs people to give rails a chance. But Jack’s original question included: “…web site requiring a CMS and a ‘blog and little to nothing in the way of custom tables?”. Let’s not kid ourselves, Rails is not the best tool for the uninitiated to make static sites. Hence why I linked Gatsby, Jekyll, Squarespace and Wordpress. If there was the need for custom DB work or if Jack didn’t mind the learning curve, it would be Rails all the way.

I started two project scheduled for next three months last week. I chose Rails. The project is technically complete. With some UI overhauling we can present to client. That’s the power of Rails.