this post was submitted on 21 Aug 2023
1021 points (98.1% liked)

Programmer Humor

18961 readers
372 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 101 points 1 year ago (6 children)

I feel bad because while I don't reach for react (I usually pick Vue or vanilla), people's comments about react is really depressing.

There's a LOT of shitty react code. And when you see beautiful react implementation, it's like a work of art.

Unfortunately, react projects have been given to by bootcamps grads with 6 months of experience and it's like the blind leading the blind...

I wonder if it's like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

[–] [email protected] 36 points 1 year ago (1 children)

PHP is great for building APIs to use with React or Vue. I’m happy I have so much back end experience with both good and bad code.

My motto: if a Junior dev can’t figure out what I’m doing after two weeks of training, I’ve failed.

[–] [email protected] 4 points 1 year ago

I'll put that to my soul.

[–] [email protected] 27 points 1 year ago

I wonder if it's like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

You can apply this reasoning to any [web] technology. The reason it's so visible for react, and previously PHP, is simply popularity.

[–] [email protected] 9 points 1 year ago (4 children)

Yep, finding people who understand React is hard. The majority of people who say they're an expert in React are either coding bootcamp fresh grads or someone who's entrenched in writing shitty React so by having them join there's basically no difference in skill with a fresh grade hire or a fourth year college student intern.

load more comments (4 replies)
[–] [email protected] 8 points 1 year ago

The problem with some of the comments here is that even "properly" written React CAN hit a performance bump, and optimization is a rather rare skill no matter the programming context (kinda due to little time given to it, so everyone is out of practice).

But I don't know which ones are the ones talking about that, and which ones are just people annoyed at anything Node in general.

[–] [email protected] 7 points 1 year ago (1 children)

I find react stupid because of JSX, Vue is much cleaner easier.

ofc you can create a mess with any tool or framework

[–] [email protected] 3 points 1 year ago

When I started my programming journey, JSX was what made me stay sane.

load more comments (1 replies)
[–] [email protected] 85 points 1 year ago (3 children)

Took him two days to figure out a hello world in react?

[–] [email protected] 34 points 1 year ago

ChatGPT helped.

[–] [email protected] 30 points 1 year ago

They've got really slow internet so it took that long for the Google results to populate with the answer.

load more comments (1 replies)
[–] [email protected] 64 points 1 year ago

React definition: React (also known as React.js or ReactJS) is a free and open-source front-end JavaScript library for building user interfaces based on components.

Guys, I've learned React in 1 minute!

[–] [email protected] 56 points 1 year ago (6 children)

Tbf, "learned a language" is a hard thing to pin down in any case.

I've been building enterprise software with python for almost a decade now. I still occasionally find stuff in the stdlibs that I didn't know about, or even sometimes some subtle feature of the language that I never had reason to explore until now.

If someone asks me if I "learned" python, id say hell yeah - but there's always still plenty to learn

That being said, no reasonable definition of learned includes what you could do in 2 days, even as an experienced dev lol

[–] [email protected] 16 points 1 year ago (1 children)

Exactly. I’m 20 years in and I’m still like “I had no idea this was a feature… cool!”

[–] [email protected] 20 points 1 year ago (1 children)

"cool": that sinking feeling that there's so much you could go back and optimize, but that you probably will never have the time to...

[–] [email protected] 12 points 1 year ago

Yeah… stuff from last week too 🙃

[–] [email protected] 7 points 1 year ago (2 children)

It' basically the Dunning-Krugger curve - you're well enough into the last part of it so you are well aware of how much there is to learn about it and how you will never know all of it, thus you don't have and never will have the same kind of cocksure belief that "I know this shit" as somebody who knows just a bit but not yet enough to understand how much there is to know.

It's all perfectly normal, IMHO.

load more comments (2 replies)
load more comments (4 replies)
[–] [email protected] 34 points 1 year ago

Dude’s training for his spelling bee. Let’s not over_react_.

[–] [email protected] 32 points 1 year ago* (last edited 1 year ago) (1 children)
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
	<div>
		<h1>My Site</h1>
		<p>Welcome to my cool site. 😎</p>
	</div>,
	document.getElementById('root')
);

Me too. I'll take my salary now, please.

Edit: Lemmy stripped out my rickroll. :(

[–] [email protected] 9 points 1 year ago

Sucks that your rick roll got taken from you. I understand how hard it must feel, so please know that I'm never gonna give you up, never gonna let you down, never gonna run around and desert you

[–] [email protected] 31 points 1 year ago

I didn’t take me more than a day to learn (I don’t understand) React.

[–] [email protected] 19 points 1 year ago* (last edited 1 year ago) (5 children)

React is a library, when do you consider a library "learned"? If they already knew JavaScript why couldn't they "learn" React in two days?

I've been using Python regularly for a decade and I'm continuously using new libraries and learning new things, I can't think of when I would have considered Python "learned".

[–] [email protected] 28 points 1 year ago (1 children)

“Learned” means you can make code for production that other people won’t go “wtf are they doing, this isn’t how react works”

[–] [email protected] 20 points 1 year ago* (last edited 1 year ago) (1 children)

That's just how we look at eachothers' code, and even our own code that we forgot we wrote lol.

[–] [email protected] 8 points 1 year ago (5 children)

Whenever I have to dredge up an old project to make a change or just to check something, I'm hit with the temptation to rewrite the entire thing. I'm constantly learning, and I subscribe to the notion that there are endless ways to do something and none of them are right. Hell, I've brought 3 fairly large Vue projects to term and all of them were done the "right way" at the time, but completely differently. There's what, 3 different approaches in Typescript for components?

load more comments (5 replies)
[–] [email protected] 11 points 1 year ago (1 children)

Because anyone worth their salt knows that the superficial hello world example covers the tip of the iceberg. So to say you learned it in two days means you either don't get that you barely scratched the surface or you dont get what other developers really need when they hire someone with knowledge in a specific framework.

[–] [email protected] 5 points 1 year ago (5 children)

Why is it taking you two days to print "hello world"?

[–] [email protected] 4 points 1 year ago

Because React doesn't have a learning curve, it has a learning wall.

[–] [email protected] 3 points 1 year ago (1 children)

You mean print “hello world”; doesn’t work in JavaScript? Well whatever, I bought the book I can put it on my resume right?

load more comments (1 replies)
load more comments (3 replies)
[–] [email protected] 7 points 1 year ago (15 children)

React, Vue, Solid, ... are a lot more complex than your average JavaScript library, because they contain so many abstractions and basically require a separate "way of thinking" in addition to what you know from JS itself. There's a separate state and UI model, hooks are a foreign concept at first, and component memoization and re-rendering takes some getting used to as well.

Now, I only have two years of experience with React, but ten in JavaScript overall, and I will say that using React/JSX required the biggest "mental model shift" for me. That's not to say that it's difficult to work with or particularly hard to learn, but it takes time to understand and really internalize this language-within-a-language library.

The way you're asking that question seems to imply that because the API of some Python libraries can be learned in two days, the same must be possible for React, and that seems rather dismissive.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

This post got the issue exactly. To use either React or Vue, the first thing you (should) learn from them is about the render mechanisms, which are introduced under the concept of component lifecycles, which only exist because both render things using a Virtual DOM. This is NOT hard, not even close, but it's also non-trivial and it's not immediately learnable with just hands-on code experience. It's also boring to go through it first, so "first thing" has a ton of quotation marks most of the ways you learn it. It's the kind of stuff that explains why the code is the way it is, and it makes sense of the thing, but can be new and weird.

I think a better way to relate to the issue is to ask people to recall how they learned git, specially those who tried to learn by doing. I've known SVN before I learned git, so when I had to sit down and actually understand it, some of the concepts were transferrable. But I've seen many, many people try to learn it and completely fumble to understand what the hell they were doing until they were presented with some visual representation such as https://user-images.githubusercontent.com/1256329/117236177-33599100-adf6-11eb-967c-5ef7898b55dc.png A diagram such as that is basically a shorthand to learning the mechanics of git, a sense-maker.

load more comments (14 replies)
load more comments (2 replies)
[–] [email protected] 12 points 1 year ago (2 children)

I learned about how much I didn't understand react on my 2nd dev job. I had like 2yoe with react previously. There's a lot about it. Mostly tricks. hacks and work arounds for it's abysmal performance.

[–] [email protected] 4 points 1 year ago (1 children)

What were you doing that was getting poor performance?

[–] [email protected] 7 points 1 year ago (1 children)

There many ways of doing things in react and some are faster than others. I would abuse state and use effect at my old job but at this job my sr dev doesn't allow me to use useffect unless the situation warrants it.

[–] [email protected] 3 points 1 year ago (1 children)

Ahh yes, abusing state can be temping. Just a little tweak here, it’s ok… no one is looking… oh crap!

load more comments (1 replies)
[–] [email protected] 3 points 1 year ago (1 children)

I'm not at all a React fan, and prefer vanilla or Vue.

But what is happening where you're hitting abysmal performance?

Are you blaming the implementation or the tools because while I can achieve faster performance with vanilla... In no way is abysmal a word I'd used.

[–] [email protected] 4 points 1 year ago (1 children)

Just exaggerating. React can be slow. Look up form performance in react with multiple inputs.

load more comments (1 replies)
[–] [email protected] 7 points 1 year ago

Based on a lot of the React apps out there, they're probably about average.

[–] [email protected] 5 points 1 year ago

I remember building with hooks was a bit tricky.

[–] [email protected] 5 points 1 year ago (3 children)

Does anyone else read this and think "goddamn I hate my career choice" and simultaneously think "goddamn there isn't a lot you could pay me to do"

[–] [email protected] 7 points 1 year ago

I'm just happy I'm not a frontend developer

[–] [email protected] 4 points 1 year ago

Yeah. I wish I had another career at this point, but every other job I’d just be like “I can write this entire job in a python script in under a week”

load more comments (1 replies)
[–] [email protected] 4 points 1 year ago

I have worked on a few React web apps now and I can't say that I have learned it fr

load more comments
view more: next ›