DEV Community

Discussion on: The Problem with Web Components

Collapse
 
dannyengelman profile image
Danny Engelman • Edited

The real problem with Web Components is simple

You fall into the same trap, you explain Web Components
by explaining its technology.

Every Web Components course teaches about "the car"
by explainining how the engine works.

I haven't seen a Web Components course yet that starts with the WHY

A car is about the journey you can take.

Similar, a Web Components course should begin with
10 distinct examples what Web Components can do.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

If the intended audience is people who are already using component frameworks, then that's kind of like selling a car to someone who already owns a bicycle: they know what they'd want it for, they just aren't convinced that it's gonna be better at it than what they already have.

Boring people with examples of why they would want a thing they're already using is only going to make them stop reading before they get to the part that matters.

Collapse
 
dannyengelman profile image
Danny Engelman • Edited

If the intended audience is people who are already using component frameworks, then that's kind of like selling a car to someone who already owns a bicycle: they know what they'd want it for, they just aren't convinced that it's gonna be better at it than what they already have.

Put the cyclist in the Ford Mustang driver seat.
Give them only 7 lines of code they can immediatly play with
I was sold on HTML in 1994 with only <H1> (I was a Gopher developer)

You don't sell Web Components to useEffect nerds by showing them MutationObserver.
You don't sell Web Components by showing MutationObserver.

Boring people with examples of why they would want a thing they're already using is only going to make them stop reading before they get to the part that matters.

Totally true.
If Web Component teachers can't come up with those 7 lines of code, the technology or them teachers suck.

Where is the Mustang?

And yes, because "Web Components" encompass multiple technologies, the teacher probably needs to come up with multiple scenarios.
But still max 7 lines, for lets say, 7 scenarios.

Thread Thread
 
besworks profile image
Besworks • Edited

Where is the Mustang?

You're analogy of car vs engine is flawed. If I were discussing the engine I would be describing the implementation details of how browsers make these features work.

What I have done here is hand over the keys to a car and showed the basics of starting the engine. Nothing more. You don't head straight onto the highway when first getting behind the wheel.

In the previous article I discussed some well established component libraries. If experienced readers want to jump right in and get rolling they have options to do so. The rest of this series will be for those who want to learn the core concepts behind this set of tools in order to fully master them.

Thread Thread
 
dannyengelman profile image
Danny Engelman • Edited

Here in NL you will be on the highway in your first lesson at 16.
BUT, there is a certified instructor in the car, who has double controls.

Same can be done online for Web Components
<html-textarea>, <css-textarea>, <javascript-textarea> that drive a resulting <iframe>
Entries monitored, layered feedback, maybe some AI?

I get the message, I have to put my money where my mouth is....

just waiting for Codex to do the work:
"Create a Web Component Tutor with 0 dependencies, only Web Components"

Collapse
 
besworks profile image
Besworks • Edited

I haven't seen a Web Components course yet that starts with the WHY

@dannyengelman You know this is Part 3 in the series. You have commented on both previous parts. I have already covered the "why" aspect, quite thoroughly.

Boring people with examples of why they would want a thing they're already using is only going to make them stop reading before they get to the part that matters.

@darkwiiplayer Exactly. This is meant to be a practical tutorial for those who are already interested. Part 1 was a total hot-take which weeded out those who are not and enticed those who may have been on-the-fence.

Some comments have been hidden by the post's author - find out more