7 ms·
One of my goals for 2022 is to write my first real web app. I want to understand things like authentication, creating an API, and security. My initial impressio
by bachmeier 5y ago
One of my goals for 2022 is to write my first real web app. I want to understand things like authentication, creating an API, and security. My initial impression is that the JS/Node world is miserable. Rails looks 1000 times more pleasant.
- tjpnz 5y agoDefinitely consider Python with FastAPI too. I got a simple API up and running in a few hours with OAuth2. Auth comes batteries included and wasn't nearly as complex as I feared.
- matwood 5y agoI don't know about miserable, but definitely easier to get side tracked deciding what libs to use. Rails tends to push users down a path that works for most things. This makes it much easier for new users. JS leaves it up to the developer to pick and choose what libs which is not new user friendly.
- tyre 5y agoRails is quite pleasant. There is a reason it became so popular. I’d recommend using rails without any front-end framework initially so you understand the HTTP calls going on. Just return HTML from your controllers (classes that run specific code when you hit an endpoint.) Build up from there and you’ll get the hang of it while understanding what’s happening underneath.
- ascendantlogic 5y agoRails and Django are both very pleasant and have enormous ecosystems where every imaginable problem has been encountered and "solved". It's been a while since i was writing Rails but from what I gather Rails 7 is a homerun release and has a lot of buzz around it.
- midrus 5y agoI'd also add Laravel here. Regarding Django, my problem with it is that it is not a "full stack" framework anymore. Both Rails and Laravel provide a very good frontend solution. Rails with hotwire, etc and Laravel with livewire. Just the fact that django has no official way to compile/build assets, and the templating language is really arcane and limited for today's needs. Just compare that with Blade (Laravel's templates) which allow you to build components out of the box.
- charcircuit 5y agoHaving tried both Node and Rails, Rails was a horrible experience. I hated every minute of it and will ignore any job listings including it. Your whole project is in a billion files and everything works by "magic." There is so much complexity and different flies that it sucks to work with. Meanwhile with Node you can start with a simple index.js and work your way up.
- troxwalt 5y agoNode and Rails aren't close to the same thing. I would think a better comparison would be Node - Sinatra.
- cutler 5y agoEven that's a bit apples to oranges. Raw Node is very low level so comparable to Rack in Ruby.
- fourseventy 5y agoSo you come from the Node ecosystem and your main complain about Rails is that the project has a lot of dependencies and files? lol
- NoSorryCannot 5y agoI hear your point but the quantity of files produced by initializing a new rails project is very large, larger than an equivalent node project with server and framework. These aren't transient build artifacts either, they will live in the repo and may occasionally need attention.
- syspec 5y agoExcept with node you have to roll everything yourself, so jumping between different projects is a nightmare (each one a snowflake) Roll your own session management, auth, ORM, db migrations, html templating, CORS, cross site scripting protection, the list goes on and on.
- ReleaseCandidat 5y agoElixir with Phoenix and Liveview.
- Toutouxc 5y agoI'm a Rails dev at $JOB, currently flirting with Phoenix, and while I think that both Elixir and Phoenix are really solid and even quite enchanting, I don't think they're the best choice for someone's first contact with webdev. Most people are more comfortable with imperative languages and Elixir only adds to the initial friction of not knowing the proper webdev lingo and concepts.
- dnautics 5y ago> Most people are more comfortable with imperative languages Unscientific poll with possibly a biased sample: more people find functional easier to work with. But telling, the difference is more pronounced among bootcampers and informally educated programmers than formally educated programmers https://twitter.com/DNAutics/status/1459348334007787526 https://twitter.com/DNAutics/status/1459348334007787526. Not to mention that Elixir is basically "mostly functional but you don't have to faff around with monads or anything to do imperative".
- revscat 5y ago> My initial impression is that the JS/Node world is miserable. Rails looks 1000 times more pleasant. God, yes. Especially with Hotwire [1], which advertises being able to do modern web apps with a minimum of JS. I've played around with it, and for me it completely eliminates the need for AngularJS/React/whatever. [1] https://hotwired.dev https://hotwired.dev
- cutler 5y agoYes but Node's built-in async will scale a lot better especially if you're calling 3rd party services.
- billyruffian 5y agoThe Async gem and Ruby 3+ is an incredible piece of work. If you need to coordinate 3rd party services, it's the way to go in ruby and it just reads beautifully.
- clairity 5y agoruby and rails is a much nicer, more complete, more consistent, and easier to learn ecosystem relative to js/node. and node is just the js server, so you need need a framework on top of it, like react/angular/vue/ember, to be equivalent. for most use cases, i really can't recommend the js-heavy route now that rails comes with hotwire (a transparent js framework for live/async html transfer, rather than json). for authentication/authorization/security, it's great to learn by writing those from scratch, but unless you want that to be your career focus, you'd really be much better off to defer to battle-hardened libraries in those areas for any commercially-/publicly-oriented web app.
- cutler 5y agoComparing Rails/Hotwire to plain Node or Express is apples to oranges. Try Next.js or Redwood.
- Mikeb85 5y agoRails is shockingly easy, especially Rails 7. Strait up, use Rails with all the defaults (ImportMap, Hotwire) but use Postgres and maybe Tailwind (`rails new myapp --database=postgresql --css=tailwind`). No extra gems are needed really (if anything, they add more complexity as not all are updated to be compatible with Rails 7).
- jebronie 5y agoWhen you learn Rails, you mostly just learn Rails. If you want to learn the nitty gritty details I think a different language might be better suited. I think Go strikes a nice balance between "doing everything yourself" and "just putting pieces together" If you constrain yourself to the standard library.
- cutler 5y agoLanguage elegance is not the reason Node is chosen over Ruby. Async and performance is. If I want my app to call a couple of services without using a ton of memory Node is the better option.