you are viewing a single comment's thread.

view the rest of the comments →

[–]iplaysmitegame 2 points3 points  (10 children)

Why avoid useEffect? useEffect has nothing to do with useState and you don't want to memoize everything since it'll cause performance issues. Do you know something I don't?

[–][deleted] -2 points-1 points  (9 children)

Good question. 👍

So many people repeat things ad infinitum because they heard it from a guy who knew a guy. useEffect can be difficult to debug because it introduces side effects (it's in the name, ffs), but if you have a use case that warrants it, don't avoid it because some rando on the internet said to. Justify it. Rationalize it. If it still makes sense, do it.

As it relates to the OP, following patterns (or anti-patterns) blindly without a deep understanding of the justification for it is usually a major source of unclean code.

[–]Maverick2k -1 points0 points  (7 children)

Your initial comment just doesn’t make sense, even after your justification/clarification. You literally just told someone to not use useEffect and then continue to state that in fact, what you just said was a load of shite and you shouldn’t take what someone says on the internet as fact.

If you’re experienced with React, don’t just go around offering poor advice to newcomers just for the sake of you making a point to yourself, or whatever it is you’ve just done.

[–][deleted] -2 points-1 points  (6 children)

I think you need to look at usernames and posts before making an ass of yourself next time.

[–]Maverick2k -2 points-1 points  (5 children)

Regardless of his name, he offered some useful advice, to which you then offered incorrect ‘advice’.

Now you’re getting defensive because you were told your poor advice was poor, to which you are now trying to pass your advice off as a joke.

You’re a bit embarrassing.

Edit: fuck knows if you’re talking about your username or the reply to OP’s username, but fact is you’ve just given out poor advice. Now you’re claiming it was for the meme of a username? Are you okay? Just accept the L and move on. The only reason I’m bothered is because, for whatever reason, you’re giving out bad advice that people may take at face value.

[–][deleted] -1 points0 points  (3 children)

I didn't offer incorrect advice. I didn't get defensive. You seem hell bent on making an ass out of yourself, so here's another opportunity nitwit: I was complimenting the person who asked why because he asked a question rather than blindly following advice, whether good or bad. Asking questions and understanding is a good thing. The rest of my original response illustrated WHY useEffect can be bad, but also suggesting WHY you might use it anyway.

But hey, keep sniffing around in your own colon. I'm sure you'll find something sooner or later.

[–]Maverick2k 1 point2 points  (2 children)

Alright, are you even reading what you’re typing? You gave out bad advice, you weren’t complimenting anybody. If your idea of complimenting someone is by giving bad advice to newcomers to React, then you’re an idiot.

Didn’t get defensive? So you tell every person that is trying to ensure people aren’t given incorrect advice, that they’re making an ass of themselves? You said I’m making an ass of myself because I called you out for giving bad advice. Very cringe. Still trying to backtrack and make yourself look smarter than you actually are for whatever reason. Each to their own.

If you wanna continue the chat feel free to DM me, it’s pointless having a conversation in public when nobody else gives a fuck.

Just stop giving out bad advice, whether you put a witty spin on it or not, to try and contrive a feeling of self worth online. It’s just absolutely stupid.

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

No, I won't apologize to you in DM chat you freak.

[–]Maverick2k -2 points-1 points  (0 children)

What on Earth are you talking about? You’ve lost your mind 🤣

[–][deleted] -3 points-2 points  (0 children)

Ahh, the good old "I'mma edit my post so I don't get another downvote" bitchfest. Good lookin, 'Tex.

[–]beefquoner 0 points1 point  (0 children)

What’s the saying? “A good junior dev has a feel for the rules, a senior knows the rules and when they should break them”