Live data from Hacker News

I Miss Rails

chanind.github.io

181–190 of 522 posts

Re: I Miss Rails

#181
I never liked Rails even when it was hip. Way too much bloat and magic behind the scenes, and also poor performance because of that.

I always preferred Flask, because it gave you a minimal framework, allowing you to cherry pick modules as needed. Sinatra looks similar if your preference is Ruby.

I cannot say that a Node stack is better though. Both Rails and Node are fairly awful, but for entirely different reasons.

Re: I Miss Rails

#182
post #29
post #25

Yep, 100%. In the process of converting a node/typescript API to rails. I'll never make this mistake again.

I'm de-Embering here and going to pure Rails. I'm gonna party like it's 2009!

To quote the ever popular HTTParty Ruby library: "When you HTTParty, you must party hard!".

Re: I Miss Rails

#183
post #148

Earlier quoted context omitted.

Honestly, I just wish Rails had some degree of static typing (a la TypeScript.) As a Rails code base grows and patterns are required beyond the basics, it becomes a nightmare to tell what comes from where. You'd probably gain some mileage from that in your React codebase.

Static-typing seems so at odds with Ruby/Rails that I can't even imagine what that would look like.

I'm waiting for a chance to try out Crystal/Amber, which is type-checked (not sure how safe?) and can be pre-compiled like Go apps. It looks really close to Rails:

https://github.com/ChangJoo-Park/amber-realworld-example-app...

(I couldn't find any code snippets on the official Amber framework page, I hope this is representative.)

Re: I Miss Rails

#184

First of all, you should use the right tool for the job. Having said that, Rails kept giving me the icky feeling. What you gain in speed of development, you lose in performance and server costs and all sorts of crazy gem meta-magic. My current middle-ground stack is Golang API (I use go-chi) + (LitElement front-end (web components) + Redux). I'm kinda happy, though my gripe is with Go sometimes, not the stack. To the…

I tend to describe my issues with Rails in a nutshell: it felt like everything was optimized for day 0 instead of day 30 or 300.

Devise was the ultimate example of this. `rails generate devise:install`. Instant authentication system with almost zero changes to your code base.

Yet now something as central and important as authentication is implemented outside of your application in some highly abstracted software. To do something as simple as figure out the name of the cookie it sets, you have to either dive into its internals or look at the actual cookie it sets instead of just reading code that should've existed in your code base.

Rails was the first "language" I learned so I was its best case subject. It was able to indoctrinate me in the beauty of metaprogramming and things like that. Yet that still wasn't enough to keep the light from shining through the veneer when working on a real world projects where you just want to know how something works by reading application or glue code, not daisy chaining through a bunch of library code or hoping you cache-hit the library's FAQ so you don't have to deep dive.

There seems to be a lot of "why is there no Rails in {JS,Go,Rust,Clojure,...}" lately and it's no surprise to me why there isn't. The same reason Ember and Meteor never took off to the degree that React did.

There was some sort of "glue code just isn't that bad" renaissance.

Re: I Miss Rails

#185
post #118

Earlier quoted context omitted.

... you had me up until "Serverless".

Actually, this stack is deployed as a serverless function ! "Serverless for API" means i could use any language to develop API. Serverless provides better scalability in my opinion.

Do you have any code samples for this? Sounds interesting.

Re: I Miss Rails

#186

The ecosystem around rails was incredible. Really wish we could get something equivalent with a static language

Static is my hope too.

We started with a Rails project two years ago. It's a bit slow, but dear god we get so much done with it. That being said, having Typescript on the frontend makes it so utterly clear how much better Rails would be with static typing.

Re: I Miss Rails

#187
I could never get into Rails because of all the magic. “It just works” doesn’t cut it for me, if I as an engineer, can’t understand exactly what’s going on under the hood.

Re: I Miss Rails

#188
post #27

Earlier quoted context omitted.

That's what we do. Rails mostly just a json api, with a React front end. Devise handles auth. Useful gems in models and services, sidekiq doing its thing... Happy with the setup.

As far as I know, there's no official way of using Devise over a REST API. It is designed with a server-side Rails app in mind. There's devise_token_auth and related client libraries, but I wish there was an official way for handling authentication for single-page apps. Every time I look into this issue, it seems like there isn't much going on in this space. Then again, maybe the entire authentication protocols space…

It's true that there isn't an official way to use Devise over REST, but then again Devise isn't even the official way to manage auth in Rails apps - it just happens to be the de facto one due to community support. That being said, by using something like devise_token_auth/simple_token_authentication and devise-two-factor you can have a token based auth system with MFA ready in a matter of minutes. Personally, I don't think there are really any back-end frameworks that have an official way to handle auth as it's always based more on community consensus.

Re: I Miss Rails

#189

> if the modern equivalent of Rails already exists, please let me know! You're in luck. Rails 5.2.3 was released 20 hours ago. More seriously, I feel rails is still excellent and I'm happy to work with it every day. I'd be interested to hear more about what makes rails not modern? I find it a very productive framework. EDIT: If you're talking about missing a JS equivalent of rails, do you know about Loopback? https:/…

I know this is the opposite of what you asked but I find Rails to be keeping pace with modernity much better than its conemporaries! Django seem to have given up on integrating websockets (ActionCable has been in Rails for literally years now), nor is there trivial integration for JS assets/asset pipeline functionality. I don't write much of either anymore, but I'd still reach for Rails the instant I need to get some…

I'm interested in hearing about applications successfully using ActionCable for what and how. It's unclear to me how much use it's getting, or how well it meets actual use cases.

Re: I Miss Rails

#190

I really have no horse in this race, but I would like to know what the argument FOR React+Redux+GraphQL is for developing apps in 2019. Is it that we need to offer offline clients to meet user expectations? Better raw performance on the front end? Cheaper server costs or easier to deploy serverlessly? For the progressive enhancement of your resume?

It’s really good at highly dynamic/interactive apps, such as browser versions of asana or slack, or other things where user actions are small but frequent. If you aren’t doing full page reloads and have a lot of changes, it’s much simpler than managing each individual state change in vanilla javascript.

I personally think React’s component model is much nicer than any templating system I’ve used as it supports composition as a first-class feature.

And if done well, yes you get better performance on the frontend. (If done poorly, you don’t.)

Post reply on HN