Live data from Hacker News

I Miss Rails

chanind.github.io

441–450 of 522 posts

Re: I Miss Rails

#441
post #172
post #20

Earlier quoted context omitted.

What does this enterprise slur even mean ? Is it like saying a band sold out when they had a hit record? Do we only use undiscovered indie frameworks now?

When I started, Java and Spring were (still are..) enterprise (Ruby and Rails existed but were not popular in my area and network) and the major criticism in my mind was the difficulty faced as a beginner. Spring was humongous and had so many modules that I just couldn't grasp the purpose of each (I still don't) plus there was a lot of overlapping functionality. Senior devs would come to college and ramble out stuff…

"what and why were completely skipped, at times, in favour of how."

This is a great summary of much of the frustration of using Spring.

Re: I Miss Rails

#442
post #360
post #265

Earlier quoted context omitted.

I don't have a book recommendation for you (what helped me was the standard documentation and about a year of daily dev time), but an observation: Your team is likely using an overly restrictive tsconfig.json. No-implicit-any, for example. Make it less restrictive, and you then have typing and no penalty for punting on it until later. If using an IDE, the effort into defining types is immediately rewarded with autoco…

One more thing that IMO gets overlooked too often: TypeScript can typecheck your JSX markup. Compare that to any string-based templating engine, such as Knockout.js templates or jquery.tmpl, where you have to learn its snowflake DSL, you get no autocomplete, no checks for undefined variables or syntax errors… If I never have to explain vs again, I'll be a happy man.

This is the type of thing to which I was referring. A server interface is updated to return a different data type or renamed, the client shares the same interface, type checking for TSX (TypeScript JSX) catches the name or type of the property is invalid, and you can immediately fix it.

No more grepping an entire codebase to see all the places that something is referenced and praying that you updated all of them. (And praying that you updated them correctly!)

Re: I Miss Rails

#443
post #100
post #66

Earlier quoted context omitted.

Sails.js [1] is a good JS equivalent of rails. https://sailsjs.com/

I worked extensively with sails.js about three years ago and it was an unmitigated disaster. The ORM has about 1/8th of Rails' functionality and queries that would be trivial with Active Record were a nightmare. On top of that the community was a mess and around the end of that time, a lot of the core maintainers dropped out because there was so much in fighting. Unless there have been some major changes I highly adv…

The major stable version came with a lot of improvements. I'm not saying sails.js is the best option for a big project, but is pretty decent for prototypes and fast development.

Related: https://dev.to/imthedeveloper/comment/2615

Re: I Miss Rails

#444
post #72

Earlier quoted context omitted.

I should backtrack a tiny bit before I'm downvoted to oblivion. I'm not opposed to libraries to handle a lot of stuff (like auth, crypto, and file I/O). I think it's typically irresponsible to reinvent these things for any reason other than "it's a fun personal project". What I dislike about a lot of the frameworks is how locked-in I feel. There's (often) only one way to do things, and I don't always feel it's the be…

Sure, the framework's way might not always be the best way of doing things but I prefer to just accept it and move on. It saves spending time debating, deciding, experimenting with different ways of structuring code, when it probably doesn't really make that big of a difference in the end anyway. Most web applications are really not that different from each other. On top of that it prevents really bad coders from rol…

I overly simplified, but basically the issue came with having to figure out how the route was binding, then finding the class that was handling that binding, then finding the class the handled the parsing, etc.

It's not intrinsic to all frameworks I'm sure, but imposed structure like that does inherently lead to bureaucracy, which can make figuring stuff out difficult.

Re: I Miss Rails

#445
post #50

I'll take a mildly unpopular opinion and say that I really despise code-gen-style web frameworks, like Rails or ASP.NET MVC or Django, and would rather reinvent the wheel than use them. I definitely see the appeal of these frameworks, but I feel that a side effect of having them is that there's a metric ton of code generated and you really have no idea how it works. I remember spending almost 30 minutes digging throu…

I can't speak for the others but Django doesn't do any code generation. Are you talking about the templating system?

I threw Django in there, but I might have a false memory of it. My bad if that's the case.

Re: I Miss Rails

#446
post #338
post #55

Earlier quoted context omitted.

Rails auto generates very little these days unless you ask for it.

I very much appreciate the code generation. I hate having to make repetitive changes in 4 places to add a new file because nothing is wired up automatically.

But why should there be 4 places to change things to begin with? Why not use libraries to minimize the amount of surface-area entirely?

Re: I Miss Rails

#447
post #427
post #50

I'll take a mildly unpopular opinion and say that I really despise code-gen-style web frameworks, like Rails or ASP.NET MVC or Django, and would rather reinvent the wheel than use them. I definitely see the appeal of these frameworks, but I feel that a side effect of having them is that there's a metric ton of code generated and you really have no idea how it works. I remember spending almost 30 minutes digging throu…

You're completely right. Clojure enables an incredible amount of productivity. It lets an engineer compose just the things they need, quickly and powerfully, to ship something complete and functioning rapidly. With that said, might it also be possible that there could be some drawbacks? Having worked in and with Clojure, I found the ecosystem incredibly immature. It's somewhere beyond arrogant - reckless comes to min…

I threw Clojure in as an example, but my point is that if I avoid the ceremony, and stick to a few slightly-lower-level libraries, I end up with a lot less code that I feel was overall, easier to write and maintain.

Re: I Miss Rails

#448
post #427

Earlier quoted context omitted.

You're completely right. Clojure enables an incredible amount of productivity. It lets an engineer compose just the things they need, quickly and powerfully, to ship something complete and functioning rapidly. With that said, might it also be possible that there could be some drawbacks? Having worked in and with Clojure, I found the ecosystem incredibly immature. It's somewhere beyond arrogant - reckless comes to min…

I threw Clojure in as an example, but my point is that if I avoid the ceremony, and stick to a few slightly-lower-level libraries, I end up with a lot less code that I feel was overall, easier to write and maintain.

Again, you're completely right. You will get something easier to fit into your head.

Is it perhaps possible that there might be some room to question if the goal of something that fits neatly it one person's head is really the best one? For professional applications, some might opine that there could be other considerations. Certainly most of my comments about Clojure apply to any tools that work from the same mindset.

But perhaps I merely misunderstand an elegantly made point of yours - can you help me?

Re: I Miss Rails

#449

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

The magic stuff's awful. Any time you have to dig into a mothballed Rails codebase from a version either older or newer than what you're used to, or with a bunch of Railsy magic gems that aren't in your usual toolkit, it's hell. I'd rather let the computer tell me what stuff is and where it's defined than memorize a bunch of magic prefixes.

Re: I Miss Rails

#450

> 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…

>Django seem to have given up on integrating websockets

Given the insecurity without huge token authorization, I'm not entirely surprised.

They can try again when they figure out encrypted and variable token creation.

Post reply on HN