Live data from Hacker News

I Miss Rails

chanind.github.io

241–250 of 522 posts

Re: I Miss Rails

#241

Earlier quoted context omitted.

I don't mean the syntax, I mean the abuse (ostensibly a language feature) of method_missing that's incumbent in the ecosystem. What would be the type signature of Active Record?

Aren't your ActiveRecord models basically the only place in a Rails app where you do specify the types of your properties?

I'm referring to things like dynamic find_by_* messages since more people might be familiar with that.

But I don't know why you'd say that. ActiveRecord models are one of the main places you'll see a bunch of `use SomeGem::Thing` that introduce a bunch of magic methods on model instances.

And my point is that we aren't talking about method composition here that you can statically analyze with a bolted-on type system. Ruby's metaprogramming runs so deep that it's a substantially bigger challenge than other dynamically-typed languages.

One clue is that humans even have a hard time with it. The first shock that people have with Ruby is when you see a method or identifier and grep shows up with zero results.

Aside, I can kinda tell that Ruby is entering Perl territory when there are no beginners around to chime in with their gripes.

Re: I Miss Rails

#242

Earlier quoted context omitted.

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.)

Kemal is great, too. Though, IIRC, it's more akin to Sinatra.

Re: I Miss Rails

#243
post #148

Earlier quoted context omitted.

Rails is FANTASTIC! I work on a hybrid React-on-Rails application and working on the React portions is so. fucking. painful. Seriously the shit people come up with with this "tool" makes corporate-hack Java programmers look good. I am always taking the backend Rails-y tickets if I have the chance

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.

I've been meaning to revisit Kotlin's web framework offerings. I've used it in small doses for Android and AWS Lambda functions and, IMO, it seems to potentially be the best of both worlds; strict where it needs to be and flexible where it doesn't. I'm currently supporting a few Python Lambda functions at work and they feel very slapdash in comparison.

Re: I Miss Rails

#244
Seriously, do people like writing boilerplate or something? Whenever I write a non Rails backend, I keep on thinking about how easy, how fast this would be done in Rails. Like I'm writing a backend right now in Rust, and while Rust is an excellent language with lots of ergonomic features, it's not a tenth as fast or fun as Rails. It's quite depressing to be writing a bunch of Rust code only to remember that this would be done in a few minutes with Rails (albeit with half the safety).

For instance, let's take writing a simple RESTful API. With Rust and Rocket, I need to build up the file structure, start writing controllers to fetch the different resources using diesel, figure out connection pools and how they link with Rocket fairings, then find I need rocket_contrib in order to automatically serialize to Json, then write out all the same routes (/ GET/POST, /:id GET/DELETE/UPDATE, etc.). Meanwhile in Rails I type `rails generate scaffold article title:string content:string`. Boom. Done.

Several times I've found myself thinking about ways of making my development experience better in Rust. Maybe I could write some macros that fix my problems. But then I'd just be reinventing Rails' metaprogramming. Ah well. I guess sometimes we need to reinvent the wheel.

Re: I Miss Rails

#245
post #179

Earlier quoted context omitted.

I don't understand. One is server application development, one is client development. They are two vastly different things. From this hot take on JS, I'd think people are suggesting that the development experience of all the other available clients are a lot better, but then I became an Android and iOS developer and that's not true either. Swift isn't bad, but the language isn't the only thing that dictates how hard…

I think we're diverging. The mental model of a Rails developers is well formed and if you're a beginner then you can rely on a very strong community for opinions, best practices and conventions to follow. This greatly decreases cognitive load and immensely improves productivity. When you make a jump to a JS stack (whether client side or server side) you have a lot of options but no best practices or conventions to fo…

Rails was somewhat unique at its birth with its opinionated-ness. Outside of that world, in "respectable" programming environments with smart people who were good at algorithms and O(n) notation and all that (which was not me) it was rare that I encountered the kind of insanity that I seem to run into daily with PHP and later JS.

Re: I Miss Rails

#246
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.

Have you tried elixir?

Re: I Miss Rails

#247
post #38

For those in the JVM world, is grails good to look into?

I maintain a legacy Grails app, it's memory hungry and brittle. A bug one place brings down all parts of it.

I hate it but I'm no Java expert.

Re: I Miss Rails

#248
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.

I've been meaning to revisit Kotlin's web framework offerings. I've used it in small doses for Android and AWS Lambda functions and, IMO, it seems to potentially be the best of both worlds; strict where it needs to be and flexible where it doesn't. I'm currently supporting a few Python Lambda functions at work and they feel very slapdash in comparison.

The biggest problem with Kotlin is also it's biggest strength: excellent interop with Java. This means that you can use all of the Java libraries...but that also makes writing new libraries in idiomatic Kotlin unnecessary, so you're going to get less of them, and have to use a lot of crummy old Java APIs.

Re: I Miss Rails

#249
post #179

Earlier quoted context omitted.

I don't understand. One is server application development, one is client development. They are two vastly different things. From this hot take on JS, I'd think people are suggesting that the development experience of all the other available clients are a lot better, but then I became an Android and iOS developer and that's not true either. Swift isn't bad, but the language isn't the only thing that dictates how hard…

I think we're diverging. The mental model of a Rails developers is well formed and if you're a beginner then you can rely on a very strong community for opinions, best practices and conventions to follow. This greatly decreases cognitive load and immensely improves productivity. When you make a jump to a JS stack (whether client side or server side) you have a lot of options but no best practices or conventions to fo…

Ah, I see your point. I definitely was that beginner that was originally compelled by the ease of Rails. I would watch RailsCasts for fun and be amazed at how much you could do with so little. I thought it was the ultimate developer experience back then.

These days I prefer building something up from microframeworks and I like to take the opposite side of the trade-offs you mention in your comment. There are a lot of aspects of Rails I ended up really disliking over time.

But at the same time, I still find myself thinking back to some of the pleasantries that Rails gives you and wishing I had them in my bespoke applications. Even just things like being able to enumerate your routes from the CLI or seeing your SQL queries and query response time in the terminal during development. If it's something you have to implement yourself, you just tend to not do it at all. And there's a lot a framework can do for you with some opinionatedness.

I think the classic example of this realization is when you deep dive on microframeworks, accumulate them in production, and encounter things like performance issues but realize you don't even have the tools to debug them because you didn't build them.

Re: I Miss Rails

#250

Earlier quoted context omitted.

Aren't your ActiveRecord models basically the only place in a Rails app where you do specify the types of your properties?

I'm referring to things like dynamic find_by_* messages since more people might be familiar with that. But I don't know why you'd say that. ActiveRecord models are one of the main places you'll see a bunch of `use SomeGem::Thing` that introduce a bunch of magic methods on model instances. And my point is that we aren't talking about method composition here that you can statically analyze with a bolted-on type system.…

I only say that because it seems like low-hanging fruit. If I have a class with a random @ivar that's added inside a random method, there's nothing up-front to check against. An ActiveRecord subclass at least has a database schema to validate against.
Post reply on HN