(no title)
afloatboat | 1 year ago
Can’t tell you how many times I’ve had to tell experienced developers they should use anchors to link to other pages and not an onClick. Those same people are much better in architecting then I will ever be, yet technically we have the same job description.
beretguy|1 year ago
That's beyond bizarre.
afloatboat|1 year ago
I started around 2000, when people were still using tables for layout and CSS was pretty new. If you wanted interactivity you relied on the built-in tools on the web because there was no other choice (apart from something more extreme like Java applets or Flash).
Today’s web developer starts with something like React, learns JSX instead of HTML and doesn’t need the form tag or checkboxes/radiobuttions/select because they have useState, onClick and className to highlight whatever they think is active. I’ve been working as a React consultant for +6 years now, and every PR I see has the same issues.
I wish I was lying about the onClick on anchor tags, and for primary navigation it’s usually done right. But once they see a block link that contains multiple components (a “card”) the mind always seems to jump to onClicks that call navigate.
A more advanced error is when something is an anchor, they correctly implement the a tag with an onClick and preventDedault, but they forget to check if the user is holding down shift, hyper or control or if they pressed any other than the primary mouse button to try and open the link in a different tab/window.
Semantics in general is a lost art as well. A Text component that only returns p or spans is used for titles, they don’t consider hierarchy at all.
To be fair, there is so much logic in the client now that I understand that people with different ambitions have taken an interest in it. The only problem is that companies just blindly hire for front end developers without considering the different expertises.
I think this is the root cause for a lot of the complaints HN has about JS. I want to build good UI and UX, but there’s so much other work and configuration that I’m expected to work on, in a limited timeframe to not ruin my velocity that I just never get to it.