DEV Community

Discussion on: Stop Building Your UI Components like this❌

 
rkallan profile image
RRKallan

I'm not totally agree with @deathshadow60 but turn off javascript in your browser and check the most web applications. Only a small part of the applications will work and still visitable as intend. As example try to buy and pay on e-commerce site. You will see it's not possible.
Also a simple check how bit crawlers will read your page / application.
Also a common mistake is to use only client-side checking when submitting forms, user can bypass these checks.

Part what I miss is user experience.

@toxictoast
Why is the comment shit? Based on your comment you don't care about the accessibility of your application and simplicity of code.
Example of Material ui toggle button (mui.com/components/toggle-button/).
On MUI there is is used a button which call a JS function on button click to set or remove class Mui-selected and to set attribute value of aria-pressed to true or false.
When clicking on the button the component will re-render because properties are changed.

This same could be reach without JS and with only HTML & CSS

<div class="checkbox-container">
    <input id="checkbox-1" name="checkbox-1" type="checkbox" />
    <label for="checkbox-1"><svg ... /></lable>
</div>
Enter fullscreen mode Exit fullscreen mode

and with the use of .checkbox-container input:checked + label you can change the look and feel. Less code no re-render of the component

An another example is the use of submitting a form. A common seeing approach is setting form element value on element value change to state. This state is used when submitting the form.
If form is submitted, with JS the values of all form elements are reachable with event.currentTarget.elements

Thread Thread
 
toxictoast profile image
ToxicToast

No you get me wrong
I am not willing to discuss stuff somebody doesn't want to know about and is biased by his opinion. That's why the comment is shit. Because no matter what anybody says and who is in the right or not... he will always have something to brag about 😀

I am caring about ux and my ui

Thread Thread
 
toxictoast profile image
ToxicToast

Ps: you can control the re-rendering in react components by using memo

Thread Thread
 
deathshadow60 profile image
deathshadow60 • Edited

And there it is folks, as easily predicted @toxictoast has given us the typical "wah wah is not, please shut up" response so common amongst cultists drinking too deeply of the tainted flavor-aid. Because how DARE anyone have an opinion that differs from his own. I mean if people start pointing out the BALD FACED LIES about how "great" React is, someone might actually stop using it in places where it's doing harm.

You can't maintain a an echo chamber of lies when people start speaking out. Hence your butthurt reaction screaming about a "shit post" because it DARES to contradict the delusional fairy tale that "JS is the solution to every blasted problem, who cares how many users it screws over!". @rkallan gave us a great example of that with the incompetent wreck that is Materials UI, where they use 5k of JavaScript and a form that doesn't work right scripting off, to do what HTML and CSS can do in a half dozen lines of code. All because the people who made MUI don't know enough HTML to be telling anyone how to build websites. Don't believe me, take a look at the markup any of their template examples vomit up. Broken stupid DIV soup with zero semantics, zero accessibility, and that's just the markup.

It's also comedy that I'm speaking out against how it screws over site owners and users, and you think I'm making it about me. Because nothing says a narcissistic "me me me" like saying how non-inclusive the result is, talking about accessibility failings, and how many people it leaves out to dry.

But sure, I'm making it about me. Of course I am... and I'm the one "biased by opinion" as I talk about actual issues and problems that apparently mean NOTHING to you. Thus why it's no surprise RRKallan thought you don't care about accessibility or simplicity of code, because that's what I'm talking about and defending.

Whilst you seem to be defending... well, your opinion to the exclusion of others, whilst omitting any facts. As I wrote over on Medium, stop contradicting, start refuting.

You could start by providing an example of something built in React that doesn't have accessibility failings, a lack of graceful degradation, etc, etc. But no, you'll just keep spewing unsupported propaganda, glittering generalities, and defense of the indefensible all to maintain that all-so-precious status quo that lets unqualified flim-flam snake-oil peddlers bamboozle, hoodwink, and otherwise sucker mark after mark.

Because again, apparently my caring about all the clients and users this stuff screws over is a "me me me" response.

Thread Thread
 
toxictoast profile image
ToxicToast • Edited

If you know so much about it and this and that is shit. Rewrite it then and make it better? What about that? That would be a Time used Best instead you use it to cry about what everybody should and shouldnt do.

You are so entitled to this shit that you turn into a Karen.

Thread Thread
 
deathshadow60 profile image
deathshadow60 • Edited

Ah yes, the "I failed to even understand the argument" response. What you seem to have failed to have grasped is that the alternative, the "better built" version ALREADY EXISTS. It's called vanilla code. I don't need to "rewrite it" because 80%+ (excuse me as I pull a percentage out my backside) of what it does is stuff plain jane HTML, CSS, and JS can do better without it, and the remainder amounts to nothing more than stuff nobody should be doing in the first place if you care in the slightest about usability and accessibility.

And if I'm talking about what others should and shouldn't do, it's because I'm parroting concepts from things like the specifications and guidelines of the underlying languages, instead of the nonsensical propaganda the framework fanboys cream their panties over as they tell usability, accessibility, specifications, guidelines, and the very intent under which all these technologies were created to sod off.

Though nice attempt at "moving the goalpost". But sure, I'm the Karen. Are you just going to keep crying "wah wah, is not" or do you have a rational counterargument about how great these systems are? I mean seriously, AGAIN, show me something built with this junk that doesn't have massive accessibility and usability failings, and that doesn't result in using two to ten times the code needed to do the exact same job!

You can't can you? That's why you're the one shit-posting since you've failed to make a single response that is anything more than the very thing you're complaining about. And then you want to talk about being "entitled"?

Tell me another one Josephine!

Thread Thread
 
rkallan profile image
RRKallan

@toxictoast

Ps: you can control the re-rendering in react components by using memo

I now about memo in React.
Why using memo when you can easily prevent?

I am not willing to discuss stuff somebody doesn't want to know about and is biased by his opinion. That's why the comment is shit.

If this is the only argument from you, then sorry. Because @deathshadow60 is giving arguments why and also provided an example. Based on my assumptions i placed example on the opinion of @deathshadow60 and to try to make his argument / opinion a little bit clear.
In our work there will be a lot of opinions. To grow we need to listen to each other, and give arguments.

The why you are reacting I personally dislikes and gives the feeling that you don't want to look out of your scope. I hope that i'm totally wrong about it.

To defend your reaction. It could be the why how @deathshadow60 reacts. The way of reaction could be more friendlier. But it could also be his way of communicate.

Thread Thread
 
toxictoast profile image
ToxicToast

Why should i use my precious time and proof you wrong? i can proof you wrong (not 100% but at least over 75%)
Some Things are better done without Frameworks and Libraries (the fact that you call react a Framework is the proof that you have no idea) i'll give you that.
But some things should be done easier for the dev.
End-Users doesnt care if its 100+ Lines Vanilla Code, or 30 Lines of React, Angular, Vuejs.

But yeah - keep on compel your opinion to others with wall of texts and texts.
Im done with you now. Keep on Commenting nonsense i wont react to it anymore (pun intended)

Thread Thread
 
deathshadow60 profile image
deathshadow60

@rkallan "his way of communication"

I'm a New Englander, by nature we're not a friendly people. There's an old joke:

In the deep south if you have a problem, everyone flashes you a smile, showers you in soothing-syrup platitudes, pats you on the back, and sends you packing with nothing more than the mental masturbation of "Thoughs and prayers"

In New England, we will berate and browbeat you, dissect every mistake you've ever made, call you a dumbass straight to your face... and then give you the shirt off our back if it actually helps.

Because you have to break things down to build them back better.

If I'm harsh on the topic, it's from seeing an endless stream of users being screwed over by these bad practices, and site owners getting equally bent over the log and told to "squeal like a pig" by the ignorant trash that are front-end frameworks.

But as @toxictoast seems to think, caring about other people is narcissism. Of course it is.

Thread Thread
 
deathshadow60 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
deathshadow60 • Edited

@toxictoast wow, the other predictable response common to the "wah wah is not", accusation of entitlement and ad-hominem... and now the Brave Sir Robin "run away, run away" because you're incapable of providing a rational counterpoint. As always with these types of "keep your opinion to yourself" twaddles, they can't defend their opposing opinion with facts, so they run away crying like a petulant five year old.

You even use the "end user doesn't care" argument. Is there a playbook those of you yumming up the lies about how great this manure is go by? An "Idiots guide to not defending your viewpoint" or something?

Here's a tip, end users do care when your bloated train wreck of code that's delivered doesn't gracefully degrade scripting off. They do care when it takes so long to load they say "screw this" and decide to go to another site. They do care when you have accessibility woes that sends them to a competitor, or worse into the legal system to sue the pants off you.

Just ask Domino's, Winn-Dixie, Beyoncé, Harvard U, Blue Apron, Nike and so forth about that. Or the banks, public utilities, medical facilities, and government organizations I've consulted at the past decade. But sure, "the user doesn't care about the code". Another of the fallacies people mindlessly parrot utterly devoid of fact.

Not that Domino's seems to care that their "JS for nothing" is so broken now, 90% of the time even non-disabled users can't order a freaking pizza. That HAS to be killing their bottom line.

"JS for nothing and your scripts for free. That ain't workin', that's not how you do it. Lemme tell ya, these guys ARE dumb."

Even more comical is the "AAAH, WALL OF TEXT" response so common to the poorly educated and gullible Twitter generation, who freak out over anything longer than a paragraph. All the more laughable on a website where people are posting ARTICLES. If you hate text so blasted much, why are you even here?

Keep digging that ditch pal.

Thread Thread
 
rkallan profile image
RRKallan

@deathshadow60
For me no need to defend your why of communication 😉 but as we now not every body understand likes each why if communication.

Personal I like the direct communication. Only what I want to try is that we come to a point to understand and listen to each arguments.