Live data from Hacker News

Don't make me think, or why I switched to Rails from JavaScript SPAs

reviewbunny.app

341–350 of 490 posts

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#341
post #4

I used to write Rails professionally for many years This comparison isn't a good one. Rails is an all-encompasing framework. If you compare Rails to something like Nest.js, there's not much you're missing. Nest is one of the best application frameworks I've used in any language, and it comes with all this stuff you say JS doesn't have. --- EDIT: To clarify (because it is confusingly named), NestJS is a framework mode…

Interesting, why is Nestjs used by so many online casinos? Is that random or is there some specific feature or approach used that is particularly valuable for that use case?

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#342

If you can easily switch to a framework like Rails from a SPA, it's probably a sign your app shouldn't have been a SPA. There's too much "defaultism" in our industry.

This and my sibling nailed it. Defaulting to a SPA is a terrible way to start web projects you would like to complete on time. But wait! Now your company has "front end devs" who you can't trust to touch your back end - better use React again to give these people something to do since JS is all they know.

My approach is Rails until the last possible moment. I'm no Rails maximalist - I did recently spin out a major part of our application into an Express service, as the Node library for a specific task was the best in breed. But I'm very defensive against signing my name on a complexity mortgage.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#344

Earlier quoted context omitted.

PHP hasn't been madness for a long time. One could argue Laravel (a RoR inspired framework) has become better than RoR.

I came here to say that, as someone who's used both Rails and Laravel. Basically it comes down to magical behavior, and the fact that Rails has way too much of it. Syntactic sugar and DSLs are maybe fine for rolling out new projects, but become burdensome on large codebases. I was on a large project and found myself in goto hell where I literally couldn't trace through the code. It was relying on every magic trick in…

So what do you like then?

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#345
post #228

Earlier quoted context omitted.

As someone who came from other MVC frameworks outside of Ruby, learning Rails has been a cluster-f of searching through documentation circa 2013. The whole rails “convention over configuration makes it easier” is a load of bologna, because the only way to know the “convention” is to either have gone to a rails boot camp, reading the docs top to bottom, or maybe watching rails casts. The best way to work on rails is t…

"Reading docs top to bottom" is the answer to this frustration. It's strange that people don't think this is something they should do.

[deleted]

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#346

This is exactly the problem I am facing now! I thought picking up and building things with Vue should be a breeze but boy what a nightmare its turning out to be. There is so much room for improvement in the JS ecosystem.

Have you looked at Svelte? We've been migrating over to it from Redux/React, and it's so far been a great experience. It's greatly simplified a lot of our code, and eliminated a whole lot of redux/state boilerplate.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#347
post #275

Earlier quoted context omitted.

If you want to make an app from scratch, you must first understand the universe. This is a ludicrous approach for most. Sure, if you learn from reading and love to read technical manuals, go for it. But to imply this is the best way for most to learn is completely ridiculous.

"Best way to learn" seems too vague to have a productive conversation about. If your goal is to become proficient with a framework, then reading the docs top to bottom is probably a great thing to do, but if you merely want to hack together a one-off project over a weekend then it's probably not worth investing the time to exhaustively learn about all the features and paradigms of that framework.

Did you learn English by reading the dictionary top to bottom? I’m gonna go ahead and guess that no, you didn’t. You learned English by being surrounded in it and practicing.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#348

What I've gathered, over the years, is that the people who dislike Rails because it makes a lot of decisions for them think they're just too cool for that. It insults their programming ability. OK, I can see that. So, go ahead; have it your way. But while you're still writing thousands of lines of boilerplate in both the front and back ends, and getting your types sorted out, I'm done with my app, and moving on to th…

Ok I'll bite - what else have you tried and what made rails so more productive?

My experience with big web frameworks - though I can't speak to rails in particular - is that everything is sunshine and rainbows until I veer a little bit off the standard path (or rail) and then it all becomes a nightmare. Where as if I'd done a little bit more myself up front, the thing is more resilient and can easily go where I want it.

Really happy to be wrong here, would love it if rails became my secret weapon. I'm a big ruby fan. But I'm sceptical.

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#349

The `create-react-app` project has existed for years, and gives you a standardized stack the bundles and boots with a single command. Rails 7 has abandoned JS bundling in favor of using somebody else's CDN. Have fun with that.

> Rails 7 has abandoned JS bundling in favor of using somebody else's CDN. Have fun with that.

This isn't true. You can vendor your JS libraries and Rails will bundle them for you. It uses jsbundling-rails[1] to handle that.

https://youtu.be/mpWFrUwAN88?t=772

[1]https://github.com/rails/jsbundling-rails

Re: Don't make me think, or why I switched to Rails from JavaScript SPAs

#350

Earlier quoted context omitted.

There are a lot of solutions out there where you can share your datatypes between the client and server now though, and it's great!

This comment would be more helpful with some examples. I’m personally very curious what the leading solutions are. I’ve worked with one involving GraphQL but that’s about it.

I can't speak to leading solutions, but in the .net world, there's Blazor[0] which is C# for the whole stack. There's also Fable[1] which is F# the whole way down.

[0]: https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz...

[1]: https://fable.io/

Post reply on HN