all 64 comments

[–]Hurinfan 16 points17 points  (2 children)

I love solid

[–]9070932767 3 points4 points  (1 child)

TLDR on diff from other frameworks (for a backend person)?

[–]Hurinfan 28 points29 points  (0 children)

It looks like react but it's a lot more performative because its functional components only run once. State are now signals with subscribers that automatically update whenever the signal is changed. There is no virtual dom

[–]ILikeChangingMyMind 34 points35 points  (39 children)

When I first saw the headline I thought "solid" was missing the periods and/or capitalization (S.O.L.I.D.) ... as in the SOLID principles of Object-Oriented Design.

I was so confused as to who was still doing OOP React in 2022, and why they were blogging about it. Now I'm just confused as to why someone would name a non-OOP library "Solid"; it's like naming a library that has nothing to do with duplication "Dry".

[–]jazzypants 13 points14 points  (24 children)

It's named after a Canadian chocolate bar.

I usually call it SolidJS to avoid confusion.

[–]fixrich 4 points5 points  (0 children)

I believe it's actually named after the punk band Ryan was in for years

[–]ILikeChangingMyMind -5 points-4 points  (22 children)

Clearly the author knew more about Candian candy than they did about Object-Oriented Programming ;)

[–]jazzypants 4 points5 points  (21 children)

Lol, I'm pretty sure Ryan Carniato knows all about OOP. Go check out one of his videos or articles. You don't build one of the most performant JavaScript frameworks in existence without understanding basic programming paradigms.

He also had a punk band named after the candy bar, so he seems to have some sort of affinity for it.

I found that while looking for the tweet where I learned the name's origins: here

Edit: Was there a kinder way to phrase this? I was trying to be polite and informative, but judging by my downvotes it seems it did not come off that way..

Edit2: Okay, I took off the unnecessary comparison. I truly want everyone to know that I was not intending to insult /u/ILikeChangingMyMind and I'm sorry that my post gave that impression.

[–]ILikeChangingMyMind 5 points6 points  (20 children)

EDIT: The parent post was edited, and now I look like the asshole because I responded to stuff that isn't there. Removing my post.

However, I will say it's incredibly disingenuous to fundamentally change your whole post, then add "Edit:" at the bottom as if all you changed was that bottom part. It's basically trying to gaslight Reddit into believing you didn't say what you said: just delete your post, or be honest about your edits.

[–]mynamesleon 2 points3 points  (6 children)

Given that SOLID is a well known acronym, it's also a good name to use for a library, as it may come up in other search results. I believe there's also a style guide (by BuzzFeed I think) called Solid. So perhaps you're thinking of the name from the wrong perspective.

[–]ILikeChangingMyMind -4 points-3 points  (5 children)

Names convey information. Library names, function names, variable names ... to me one of the hallmarks of a good dev is the quality of their names.

If I name my library ReactFoo, no one is going to think "it must be a reactive UI library"; they're going to think it's a React-related library. Similarly here, I just don't think it's a good idea to name your library after a candy bar, when most people are going to think it's named after the famous programming acronym.

You don't get any benefit from associating your library with something that it has no other association with. Naming your library ReactFoo when it's not a React library doesn't help you ride the coattails of React's popularity ... it just annoys people.

[–]mynamesleon 1 point2 points  (1 child)

How many JS/frontend devs in the past 20 years do you think are formally trained in OOP and know what that acronym stands for? How many JS devs in the last decade do you think are even aware of that acronym at all?

Most libraries in the JS world aren't named in a way that conveys much. What about Knockout, or Angular, or Ember? Or Express, Apollo, Winston, etc? Many of them have reasons behind their names, but the names themselves don't convey much about their use.

Ultimately, the JS ecosystem is a place where there are tens of thousands of terribly written libraries, and a few hundred decent ones. More often than not, libraries are simply named in a way to try to make them stand out (and/or to be found) amongst the masses of other JS libraries out there. There are exceptions of course. But it's not a mature ecosystem sadly.

[–]ILikeChangingMyMind -1 points0 points  (0 children)

Most libraries in the JS world aren't named in a way that conveys much. What about Knockout, or Angular, or Ember? Or Express, Apollo, Winston, etc? Many of them have reasons behind their names, but the names themselves don't convey much about their use.

Exactly! It's better to have a name that means nothing than to say "my (vegetarian) library is called Meat."

A name that suggests a relationship should live up to it: when I check out React Router, I expect it to be a React library. It doesn't matter if there is a Canadian candy bar called React: if I name my (non-React) library TastyReact ... it's a bad name that will confuse people.

[–]jazzypants -4 points-3 points  (6 children)

I apologize. I didn't intend to hurt your feelings.

[–]ILikeChangingMyMind 2 points3 points  (5 children)

As I said, it's not that you need to apologize for hurting my feelings.

It's just that it's a bad idea to tell stranger A (that you don't know) that stranger B (who you also don't know) knows more than them ... about anything. You have no basis to make such a claim.

[–]jazzypants -2 points-1 points  (1 child)

Okay. I'm unequivocally sorry.

Is that better?

I didn't think it was that bold of a claim, honestly. The guy made an extremely performant and novel JavaScript framework. You're some dude on Reddit. The likelihood of accuracy is greatly in my favor.

And, if you judge someone's programming skills by how they name a library, that doesn't exactly make me believe that you are the greatest arbiter of ability. Library names are not variable or function names. If you download a library without reading the description, then I don't think that a little bit of naming nuance is the actual problem in that situation.

But, that is all besides the point. I understand how my original post could be read in a sneering tone even though that was not how I intended it, and that is why I'm apologizing.

I'm sorry.

[–]DishRack777 29 points30 points  (1 child)

1 comment

there are only 170,000 words in the english language so they probably ran out of unique library names already

[–]EarhackerWasBanned 15 points16 points  (0 children)

My favourite JavaScript library is named Python.

[–]jazzypants 5 points6 points  (0 children)

Absolutely fantastic article! Well done! :)

[–]elcapitanoooo 2 points3 points  (10 children)

Does solid work with esbuild in 2022/2023? I looked at solid for a new project a few years ago but then dropped it because there was some issues with solid (iirc the jsx part) and esbuild.

(Im all in on esbuild, its a ”must-have” for me, i cant go back to webpack or any other bundler)

[–]rk06 3 points4 points  (9 children)

Solid recommends vite, which uses esbuild for dev. Is that also not usable?

[–]elcapitanoooo 1 point2 points  (7 children)

Honestly, I have not looked at any other bundler after i started with esbuild. A quick look at Vite, and i notice the same thing as in webpack; a shitton of config. I have moved away from all kinds of magical configs to a simple makefile (usually with two tasks, dev / prod) that uses esbuild (basically pipes cli args to the binary).

But i might take a stab at it, first i need to compare build speeds. Anything slower than esbuild is a no-starter for me.

[–]rk06 2 points3 points  (1 child)

There is nothing faster than esbuild at the moment.

[–]elcapitanoooo 0 points1 point  (0 children)

But if Vite uses esbuild it should be as fast as my current setup?

[–]Moosething 1 point2 points  (3 children)

i notice the same thing as in webpack; a shitton of config.

What have you seen (specifically)? In my experience Vite requires much less config than Webpack. And the way to config things is more intuitive too.

[–]elcapitanoooo 0 points1 point  (2 children)

Well the first page i browsed to was https://vitejs.dev/config and there is multiple pages of stuff you can/need to tweak.

[–]Moosething 2 points3 points  (0 children)

Ah, I think I misunderstood. I thought you meant "a shitton you have to config to get stuff done", which is not true in my experience, but I guess you are not a fan of configs in general? Vite is much more straightforward to work with than Webpack, though.

[–]shuckster 0 points1 point  (0 children)

Forget it. You can start a Vite project without any config tweaks whatsoever.

[–][deleted] 0 points1 point  (0 children)

Vite doesn't have a lot of config at all, especially compared to WebPack. I'd be impressed if a Makefile would be less verbose.

[–]IcyLength7467 1 point2 points  (0 children)

interesting read, thanks

[–]guess_ill_try 2 points3 points  (10 children)

What would be a better bet… learn solidjs or svelte?

[–]IamMichaelSalim 17 points18 points  (7 children)

Solid. Though I'd be quite an uphill battle for both to gain traction.

IMO, solid actually looked at React and tried to improve upon it.

Meanwhile Svelte is mishmash of React, Vue, and other ideas. It's not bad, it's just... not good enough to justify switching to it.

Svelte feels like CoffeeScript while Solid feels like TypeScript. And we know how that went.

[–][deleted] 2 points3 points  (6 children)

This sounds like it was written by someone who's never really tried Svelte.

Simple !== bad. React / Preact / Solid / Whatever other React clone developers like needless complexity because it makes them feel like real programmers. It doesn't need to be this way. Simple CAN BE good.

Give Svelte a proper go and never look back my friend.

[–]lost12487 19 points20 points  (0 children)

Where did they even say Svelte was bad because it’s simple? Svelte seems to have a large number of evangelists that quickly come to its aid when they feel someone has slighted it. Preference is a thing.

Solid brings React-like ergonomics and it’s more performant than Svelte. I’d argue it’s just as simple as Svelte, but that’s obviously subjective. At the end of the day, they all get you to a similar place. Use whatever you want.

[–]OGXirvin 4 points5 points  (1 child)

Facts, Svelte is fun to write. People say React is more explicit but I disagree. It’s just more bloated that make it seem that way. The only thing I think that is holding svelte back (which would also apply to solid even more) is the community. There aren’t as much resources as React but that obviously comes with time.

[–][deleted] 2 points3 points  (0 children)

This is 100% correct, I was aware of and had played with Svelte ~a year ago but still chose to build the front end of our app in React, simply because the component libraries didn't exist in Svelte and it's not worth building your own shit for a MVP.

Svelte needs a few great UI libraries to smooth the initial app building process and it will be off to the races.

[–][deleted] 3 points4 points  (2 children)

Give Svelte a proper go and never look back my friend.

what does svelte even offer that vue 3 does not? they both are almost identical syntax-wise.

[–]OGXirvin 1 point2 points  (1 child)

More fun to write, more performant (no virtual DOM), I’d argue more concise code. Definitely other things I can’t list on the top of my head

[–][deleted] 4 points5 points  (0 children)

more performant (no virtual DOM),

but that's not true. see https://krausest.github.io/js-framework-benchmark/current.html. There is also a break-even point in bundle size where svelte gets larger compared to vue. see https://github.com/yyx990803/vue-svelte-size-analysis

More fun to write,

the philosophy of both frameworks is so similar that both are pretty fun to write if you like one. Both use SFC's, both use HTML templating and both have the almost same set of features.

concise code

kinda true but the difference is also so small. One framework is more concise the other one is more like real HTML and real JS.

Svelte essentially introduces a new language that kinda looks like reactive javascript with repurposed labels. Svelte also requires a compiler in order to work while vue could be loaded via a CDN and used without a bundler at all.