Live data from Hacker News

I Miss Rails

chanind.github.io

121–130 of 522 posts

Re: I Miss Rails

#121
post #4

Why miss it, come on back, the water's still warm and the dev is still as fast as ever in Rails. Honestly, the JS stacks all seem vastly more annoying on so many levels. It seems like the JS ecosystem changes so fast because it knows better is possible, so it just tries to reinvent itself over and over. The JavaScript world starts with this weird prototype based language with a syntax that looks like it might be some…

> It seems like the JS ecosystem changes so fast Does it tho? React, Webpack, Babel and TypeScript have been around for a while now, and I can't think about anything else more recent that had a similar impact on the JS ecosystem.

Vue? Yarn? Angular 2?

Re: I Miss Rails

#122
post #54

Earlier quoted context omitted.

> joys of static type checks combined with a unified front/back data model Would you mind elaborating on the specific benefits?

With TypeScript you can define a single set of interfaces shared by both your client side and server code. If you change an interface to return a different value or rename a member, you immediately know where it’s used and can update it in tandem. Static type checking let’s you know everywhere that something is used without a battery of tests running through your app. This takes 99% of the fear out of refactoring and…

I used Typescript from the get-go on a new project recently and it's slowed down both mine and my team's development velocity a lot. Time will tell if it's a smart decision but in terms of prototyping or spiking something, I'm picking Rails every time and I think based on my current experience I'd be apt to retrofit Typescript to an existing project rather than integrate it from the beginning. I don't suppose you could recommend any good resources for better learning Typescript? The docs are OK but if there's a book or anything you'd recommend, I'd certainly appreciate it.

Re: I Miss Rails

#123

Here's how i replace Rails with the "modern stack": - Compile Graphql schema into Typescript typings + Fragments for "Active Record" - React Hooks as controllers action. - React Suspense for HTML rendering. - Apollo for graphql caching - ExpressJS for middlewares. - @reach/router for routing. - @loadable/component for code splitting. - Serverless for API. I missed Rails, too. But i found that the "modern stack" is no…

This sounds exhausting! But I'm betting there's some pretty solid benefits or you wouldn't do it. Could you expand on why someone might pick this a little?

Re: I Miss Rails

#124
post #78
post #45

I personally don't missed Rails mostly because boilerplate doesn't really bother me. I'm more afraid of using the wrong abstraction. Rails (v4 was my last experience) was hard for me and I think my reasoning is as follow: - I like to dig deep into the framework I work with but Rails have so much meta programming (a.k.a magic) that I struggle real hard figuring out stuff. You often have to go into runtime, hit method…

> MVC is a 20 year old pattern More like 40; it's from late 70s Smalltalk.

Can confirm, I worked at a Smalltalk firm in 1995 and was taught MVC then, and was explained to how it was an old pattern.

Re: I Miss Rails

#125
post #27
post #7

What’s the harm in using rails purely as an API? You’ll still get a lot of functionality out of the box and maybe have to write just a little bit more glue code for the JS-backed front end than what rails provides out of the box.

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 is like that, and it's actually Devise which is in the unusual position of being a de-facto standardized way to do auth in the Rails world.

Re: I Miss Rails

#126
post #111

Earlier quoted context omitted.

> It seems like the JS ecosystem changes so fast Does it tho? React, Webpack, Babel and TypeScript have been around for a while now, and I can't think about anything else more recent that had a similar impact on the JS ecosystem.

Yeah, but I am quiet sure at least 12 new frontend frameworks were pushed to Github in the last 24 hours, plus 143+ NPM packages probably broke with the last Babel update

[deleted]

Re: I Miss Rails

#127

Every time I dip my toe into the node.js waters I recoil in horror at the complexity of the defaults.

I can fondly remember me trying out a Node-based framework back in the day and deciding it wasn't for me because I couldn't decipher an error that was halting the application.

Then, I decided to delete the folder.

I remember watching Windows building the list of about 1GB+ of files to delete. Only to have it try but couldn't complete the deletion process because some file names were too long because of the recursive nature of folders and dependencies in `node_module`.

Good times!

Re: I Miss Rails

#128
post #102

Earlier quoted context omitted.

I think what the OP meant by 'modern,' was an equivalent of Rails that uses the technologies demanded by the tech industry today. On the one hand, the industry went to Python because a ton of data science libraries were written in that. On the other hand, React ended up real dominant on the front-end because of all the sh*t code people put between HTML JavaScript tags. Another route, is any promising asynchronous and…

>demanded by the tech industry today. That attitude needs to get out of everyone's head. You are the tech industry. If you want to build something in Rails, a mature and capable framework that has tons of support and won't go away, just do it. Who's going to stop you? Applies to any other technology that's stable as well.

Yup - unless The Tech Industry is going to come in and rewrite all our code into Flavor Of The Month (and do that every 3 months forever) I don’t really care what they “demand” - I’m too busy providing value for my customers to be shaving that yak

Re: I Miss Rails

#129
post #47
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.

Why not Sinatra + ORM in that case?

I have seen this many times. You start with ActiveRecord, and before you know it, you are with a working with a Frankenstein of gems that resembles Rails, except it isn't done well.
Post reply on HN