Earlier quoted context omitted.
Other people have mentioned "dynamic typing" as being the reason for this, but that's not actually true. The real reason is two Ruby features: `define_method` and `method_missing`. If you have a class `Customer` with a field `roles` that is an array of strings, you can write code like this class Customer ROLES = ["superadmin", "admin", "user"] ROLES.each do |role| define_method("is_#{role}?") do roles.include?(role)…
To add, the above code is a pretty near approximation of the literal code inside the devise codebase, which is a very standard Ruby auth system. See here: https://github.com/heartcombo/devise/blob/main/lib/devise/co... def self.define_helpers(mapping) #:nodoc: mapping = mapping.name class_eval That code is *literally* calling class_eval with a multi-line string parameter, where it inlines the helper name (like admin,…
We fell out of love with Next.js and back in love with Ruby on Rails
391–400 of 533 posts
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#392Great that it's working for them, but for the end user the feel of the site nearly unusable. There's 1s+ of delay on every interaction - pressing "home" button from explore tab takes 1,85 seconds (on a gigabit connection) before home view comes active, without any other feedback to the end user except for "Home" icon becoming active. You cannot just blindly trust the page speed metric but it should be impossible to m…
I don't have this delay personally. Probably the page speed metric is more accurate because it smooths out anecdotes like ours.
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#393Earlier quoted context omitted.
So you make incrementing a counter a full page reload?
You don't need an SPA to handle incrementing a counter. If a page needs dynamic behavior you add JS to it, whether it's just adding an in-memory counter or an API call to store and retrieve some data. It's not difficult to write JavaScript. The problem with SPAs is that they force having to maintain a JS-driven system on every single page, even those that don't have dynamic behavior.
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#394Great that it's working for them, but for the end user the feel of the site nearly unusable. There's 1s+ of delay on every interaction - pressing "home" button from explore tab takes 1,85 seconds (on a gigabit connection) before home view comes active, without any other feedback to the end user except for "Home" icon becoming active. You cannot just blindly trust the page speed metric but it should be impossible to m…
I've been saying this forever and this is a great reminder for those React-hating folks here on HN: usually it's the developer's fault his web is slow, not the framework's.
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#395I truly wonder what people do when they want JS full stack both frontend an backend especially with a DB involved. ORM situation looks pretty fragmented or you write pure sql. And then you still have to decide on the backend. Going raw with express? Next.js, well known, but with a questionable agenda (, Remix, Astro, TanStack, and so on. It's a mess, because you always have to recalibrate and re-evaluate what to use.…
Just use Gel [1] and you won't have to deal with ORMs (plus you get other great features).
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#396Earlier quoted context omitted.
It is fine, though.
No, it’s footgunny and riddled with bugs. Most JS barely works and edge cases just aren’t addressed. I’ve seen undefined make it all the way to the backend and get persisted in the DB. As a string. JS as a language just isn’t robust enough and it requires a level of defensive programming that’s inconvenient at best and a productivity sink at worst. Much like C++, it’s doable, but things are bound to slip through the…
This is where I know that, some people, are not actually programming in either of these languages, but just writing meme driven posts.
JS has a few footguns. Certainly not so many that it's difficult to keep in your head, and not nearly as complex as C++, which is a laughable statement.
You've "seen null make it to the database," but haven't seen the exact same thing in C++? Worse, seen a corrupted heap?
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#397Earlier quoted context omitted.
I think the DX is significantly better as well with fast reload… As a user, the typical SPA offers a worse experience. Frequent empty pages with progress bars spinning before some small amount of text is rendered.
> As a user, the typical SPA offers a worse experience. Your typical SPA has loads of pointless roundtrips. SSR has no excess roundtrips by definition, but there's probably ways to build a 'SPA' experience that avoids these too. (E.g. the "HTML swap" approach others mentioned ITT tends to work quite well for that.) The high compute overhead of typical 'vDOM diffing' approaches is also an issue of course, but at least…
SSR also has excess round trips by nature. Without Javascript, posting a form or clicking a like button refreshes the whole page even though a single changed from a "12 likes" to "13 likes".
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#398I truly wonder what people do when they want JS full stack both frontend an backend especially with a DB involved. ORM situation looks pretty fragmented or you write pure sql. And then you still have to decide on the backend. Going raw with express? Next.js, well known, but with a questionable agenda (, Remix, Astro, TanStack, and so on. It's a mess, because you always have to recalibrate and re-evaluate what to use.…
Why is that a mess? From my experience you have to recalibrate your project constantly . the framework that's hip and new will be phased out in 5 years. I don't mean that rewrite hell is a permanent state, but you will always be rewriting parts of your project. I'd rather choose an ecosystem where the friction for rewriting is minimal.
Choose boring tech that doesnt change since its already mature and battle tested and because it is not beholden to the whims of some VC money or whatever.
React itself (not Next.js) doesnt change a lot and will let you run your app for the next decade at least.
Same with any boring PHP, Ruby, Python, Java, dotnet framework out there.
You might need to upgrade versions, but there will very seldom be breaking changes whete you have yo rewrite a lot.
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#399What's the closest thing to Rails in a language with a sound static type system?
Unironically, if you want something as mature as Rails, with batteries included, and static typing, the closest in my mind is aspnet core. It’s honestly a really underrated framework, smartly designed, with probably the best ORM that exists and a great ecosystem. Unfortunately, the documentation is painfully bad and the Getting Started guides are really boring compared to Rails or Django. There may also be Laravel bu…
I have complaints about Laravel, but I think it's a lot easier to find examples, and modern PHP has static typing improvements. But I would much rather use C#
Re: We fell out of love with Next.js and back in love with Ruby on Rails
#400Earlier quoted context omitted.
No, it’s footgunny and riddled with bugs. Most JS barely works and edge cases just aren’t addressed. I’ve seen undefined make it all the way to the backend and get persisted in the DB. As a string. JS as a language just isn’t robust enough and it requires a level of defensive programming that’s inconvenient at best and a productivity sink at worst. Much like C++, it’s doable, but things are bound to slip through the…
> I would actually say overall C++ is much more reasonable. This is where I know that, some people, are not actually programming in either of these languages, but just writing meme driven posts. JS has a few footguns. Certainly not so many that it's difficult to keep in your head, and not nearly as complex as C++, which is a laughable statement. You've "seen null make it to the database," but haven't seen the exact s…
It's like people just talk in memes or something.
This is how a lot of discourse feels these days. People living in very different realities.
Though in this case, seeing the most complex C++ app they've built would illuminate what's going on in theirs.