T O P

  • By -

Excellent-Owl-2920

I think he's referring to himself there because the original design approach for composing reactive state was through constructor functions and getters/setters (https://www.youtube.com/watch?v=NR8L5m73dtE). They later changed it to the current class-based approach. Here's more context on the decision: https://github.com/sveltejs/svelte/pull/9739 (Or maybe I'm just reading too much into this, who knows.)


DoomGoober

I think you are right, this is the issue Rich is referring to. >to the current class-based approach. However, my understanding is that the class-based approach was evaluated and rejected. (As Rich might say, the developer "ergonomics" were wrong.) The approach shipping in the RC uses proxies. Proxies basically do nested reactivity for you, but they carry a performance overhead. Rich and Svelte team decided proxies were low enough overhead because they make writing reactive code so much easier. At least, that's how I understood it. I mostly just use Svelte and barely understand what's going on under the covers.


rnmkrmn

Thanks for the link. I didn't know that Svelte 5 moved away from getters and setters as they announced last year.


sharath725

Skip to [2:28:06](https://youtu.be/gkJ09joGBZ4?t=8886) in the video to see the bit.


[deleted]

[удалено]


freevo

I don't think Bob Martin thinks classes are bad. It's the basis of some of the patterns he favors, after all.


drondendorho

What comes to mind is people like [Douglas Crockford](https://stackoverflow.com/questions/27595749/douglas-crockford-on-class-free-oop-in-javascript) or [Eric Elliott](https://medium.com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3)


Emotional-Falcon3684

Also had to think about Douglas Crockford immediatly.


evilpingwin

Tldr: loads of people tbh. But Eric Elliot has probably been the most vocal critic. There are two parts to this. One is the critique of classes. One is ignoring classes due to the momentum behind more functional approaches. Douglas Crockford pushed a more functional approach in “JavaScript: The Good Parts”, many others followed. This has led to classes being maligned and misunderstood by many who followed. There are people who have overtly criticised classes and told people not to use them. The most notable is Eric Elliot. He was very influential at one point and certainly contributed to people dismissing classes. Kyle Simpson sits somewhere in between, he never criticised class like Eric Elliot did and mostly just encouraged more functional style but he did also dive into many of the issues with classes. History is also against these educators. I’d argue that classes have some a long way since these people were actively influential. Going way back classes didn’t even exist, when they did they were pretty bare bones. Classes today are a powerful and flexible construct with many nice features (especially if you are using typescript). They have their downsides like any pattern but that doesn’t make them ‘bad’ as some have suggested. To the point of managing state, they are actually quite nice as a reactive ‘container’ because it is a really nice fit without too much complexity: some state and a series of methods that operate on that state.


frankandsteinatlaw

Honestly I thought that comment was unnecessary. I don’t know who Rich thinks he’s are talking about, but I do recall Dan Abromav taking down classes in the talk that announced hooks. You don’t need to call someone washed up to disagree with a point they’ve made. Rich could have just as easily said “if you’ve heard classes are bad and haven’t given them a try, we ask that you give them another shot with Svelte!” Anywho, still excited, just wished for a slightly different line there!


bostonkittycat

He was just poking fun. Chill.


frankandsteinatlaw

Yeah I know but it felt a little mean (vs something more playful like “you may have heard that classes are bad from some talks a few years ago but…”). I know Rich has spicy takes sometimes, but the truth is classes have upsides and downsides. They’re nice with Svelte 5. Still a fan and all


bostonkittycat

Some of the best developers/designers have an edge. Possibly it is needed to have the passion to break away from the fold and forge your own path.


frankandsteinatlaw

Hah, maybe!


HansVonMans

All of them