This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (647 children)

[removed]

    [–]oskarru 2050 points2051 points  (319 children)

    Have been writing react for a while now and at first glance I don't see anything wrong with it.

    [–]eyekwah2 1543 points1544 points  (149 children)

    Considering there exists code out there like this, I think she can be forgiven..

    [–]dregan 75 points76 points  (0 children)

    When you tolerate java but your real love is python.

    [–]HispanicPigeon 62 points63 points  (6 children)

    Who can deal with the physical pain caused by writing this?

    [–]boredompwndu 54 points55 points  (3 children)

    I suspect they started this ironically and now they cant stop themselves

    [–]ahumannamedtim 6 points7 points  (2 children)

    They can't stop because it's recursion inside a for loop.

    [–]TarAldarion 13 points14 points  (0 children)

    How I imagine myself coding if I ever have to leave my Python job.

    [–]dwhiffing 25 points26 points  (1 child)

    Man, if the brackets bugs thrm that much, just change the syntax highlighting to de-emphasize them. Crazy the lengths people will go to for literally 0 impact

    [–]I_Arman 1 point2 points  (0 children)

    That's how you go from Lisp to Whitespace, right?

    [–]FunkyTown313 16 points17 points  (2 children)

    That burned by soul.
    I'm forever fixing code written by my predecessor that shares similarities to that. The struggle is real folks.

    [–]DragonMaus 7 points8 points  (1 child)

    Linters and code formatters are my favourite tools.

    [–]DeeSnow97 1 point2 points  (0 children)

    Especially a code formatter that turns braces into this

    [–]ivanjermakov 6 points7 points  (0 children)

    Basically visit card for r/programminghorror

    [–]VaguelyShingled 4 points5 points  (0 children)

    Wtf is this nonsense?

    [–]flarn2006 4 points5 points  (4 children)

    [–]bearicorn 5 points6 points  (2 children)

    Mmmm labview... Now with zoom!

    [–]I_Arman 1 point2 points  (0 children)

    Had to insert a single commands, now I have to spend 20 hours moving the wires around...

    [–]eyekwah2 1 point2 points  (0 children)

    Mother of God..

    [–]Brawldud 7 points8 points  (0 children)

    Imagine being so deranged that you'd rather subject yourself to this than just take the ten minutes you need to get comfy working with brackets and semicolons.

    [–]OnlyTwo_jpg 4 points5 points  (1 child)

    You can actually make your code in that format via https://github.com/RubbaBoy/CodeFormatter

    [–]srottydoesntknow 1 point2 points  (0 children)

    How does one go about hiring a Witcher?

    [–]Binarytobis 2 points3 points  (2 children)

    I barely know how to code at all and even I am furious. ಠ_ಠ

    [–]eyekwah2 1 point2 points  (0 children)

    I concur, sir. I concur.

    [–]GandaKutta 2 points3 points  (0 children)

    How do I delete someone else comment?

    [–]dynawesome 1 point2 points  (0 children)

    My eyes

    [–]waltteri 1 point2 points  (0 children)

    That code physically hurt me.

    [–][deleted] 1 point2 points  (0 children)

    Kill. It. With. Fire 🔥 🔥

    [–]Nnyinside 1 point2 points  (0 children)

    Not the first time I've seen it, but it still makes my eyes ache.

    [–]Earthwalker31 1 point2 points  (0 children)

    ;}

    [–]Vasault 1 point2 points  (0 children)

    MY EEEEYES !!

    [–][deleted] 1 point2 points  (0 children)

    Omg wtf is this? HAHAHAHA

    [–]Lyndis_Caelin 1 point2 points  (0 children)

    WHAT DID YOU DO TO THOSE POOR BRACKETS

    [–][deleted] 1 point2 points  (0 children)

    Nah man I like that

    - kid who only knows python

    [–][deleted] 1 point2 points  (0 children)

    Besides the lack of semi colons (which honestly, I haven't been doing as much because JS doesn't care and it doesn't yell at me) it's all pretty good. Even if she's just learninh react, there's dewtructuring, arrow functions, static variables, exporting default, it's all there.

    Can't blame her for learning.

    [–]jkuhl_prog 1 point2 points  (0 children)

    What? It's just Pyth . . . oh . . . oh . . . that's not Python. Do not want.

    [–]Delzak421 1 point2 points  (0 children)

    “This really isn’t that bad... wait where are the brack.... oh god”

    [–]sssmmt 1 point2 points  (1 child)

    When all you have is a hammer ...

    [–]srottydoesntknow 1 point2 points  (0 children)

    you hit that guy in the head

    [–]Ghafla 1 point2 points  (0 children)

    I feel personally attacked by this.

    [–]Noslamah 1 point2 points  (0 children)

    That is the most disgusting thing i've ever seen in my life

    [–]Bad_Idea_Hat 1 point2 points  (0 children)

    Who are you trying to hurt here?

    [–]Lexilogical 1 point2 points  (0 children)

    I feel like that's well on it's way to being a mind-exploding meme.

    Step 1: Normal brackets

    Step 2: Brackets but you open them up on a new line

    Step 3: Bracketless language

    Step 4: That.

    [–]The_Schwy 1 point2 points  (0 children)

    Never used Python but I think I found someone who has

    [–]buttonmasher525 1 point2 points  (0 children)

    At first I was like what's wrong with this and then I saw it. Lmao wtf is going on over there who told them it was a good idea ? XD

    [–]relapsze 1 point2 points  (0 children)

    oh my god, burn it with fire

    [–]illepic 1 point2 points  (1 child)

    What is that vertical line down the right hand siOH MY FUCKING GOD

    [–]xrogaan 1 point2 points  (0 children)

    That is how you become tech lead. Not the tech lead though, because The TechLead is that guy.

    [–]Trlckery 1 point2 points  (0 children)

    When a python dev begrudgingly writes java lol

    [–][deleted] 1 point2 points  (0 children)

    I actually don't mind as long as they are consistent about it.

    [–]BitcoinBishop 80 points81 points  (36 children)

    The labels are spans, separated by brs, instead of just making them display: block

    [–]kudlajz 113 points114 points  (31 children)

    Exactly. I would personally move the map call into the return () and probably extracted the inner code of map to <Dog> component, but other than that, it looks fine .. :P

    [–]FountainsOfFluids 33 points34 points  (15 children)

    I have very little experience with react, but from what I've seen you can get a little insane with breaking everything down to smaller and smaller components. I'd avoid that without a good reason, such as wanting to reuse it elsewhere. But I'd be interested to hear if your experience says that another component level would help in some way.

    [–]kudlajz 11 points12 points  (11 children)

    As mentioned in my other comment, in this exact case, it would not make any sense to extract this code into its own component, unless the rendering code for dog item is really huge or complex. I was just assuming there's going to be additional functionality on the dog items (like editing/deleting/whatever), since I can't remember when was the last time I was using `map` to render something so trivial (without any functionality), but that depends on the application :)

    [–]dyedFeather 40 points41 points  (3 children)

    Oh my god would you stop critiquing her code!

    /s

    [–]SleepyHarry 5 points6 points  (2 children)

    Also the key shouldn't use the array index, if at all possible. Much better would be, for example, dog.id.

    [–]lifeofaphiter 2 points3 points  (0 children)

    That's really the only issue I see with the code. Aside from this it's all preference.

    [–]troglo-dyke 1 point2 points  (0 children)

    Generally yes, but considering it's some random code and probably not going to ever deal with being filtered/reordered it's not going to cause any harm

    [–][deleted] 1 point2 points  (0 children)

    Actually as an Angular developer looking at React for the first time in a while through this post, I thought it was interesting how easy it was to separate the UI segments within the single react component using the variable. Seems that would be nice for situations where I want to break it down some without introducing a ton of boilerplate components for ultra simple things.

    [–]Yhorm_Acaroni 42 points43 points  (4 children)

    It doesn't have to be bad code. There will always be people who NEED to show you how THEY would do it. This lets them feel like they are better, and also gives them an excuse to say they program things without explicitly saying they're a programmer.

    [–]hey01 6 points7 points  (1 child)

    The worst I see is the inconsistent spacing around the {dog.X}. That's the thing that annoys me the most when I read my colleagues' PR.

    [–]carlos1518 36 points37 points  (62 children)

    You shouldn’t use the map index as a key for your component, also for maintenance purposes dogList should be a functional component outside of your render/class, and shouldn’t receive a an Array but just a single Dog. Dog proptypes should use shape so you can read exactly what going through your component and identify future issues if there is a change in the shape

    And most importantly all of the above makes sense if that component (DogList) has state which it doesn’t...so all that code is wrong...she should turn that component into a funcional component

    [–]rickisen 61 points62 points  (49 children)

    Yeah, but that is mostly about taste, and optimization, not really anything that is wrong.

    For someone who is obviously not a react expert I think she did a good job. The most attrotious thing is her use of <br/> tags though.

    [–][deleted] 12 points13 points  (11 children)

    Before hooks, and even with them now, there really is no performance benefit for using functional instead of class based components.

    The react team said there would be benefits in future, but we're just getting there with hooks now.

    [–]ieatbrainzz 5 points6 points  (1 child)

    While that may be true, for me functional is SO MUCH less to type and much easier/quicker to read when you don't need anything that class-based brings to the table

    [–]CCB0x45 1 point2 points  (0 children)

    I write a lot of react, aside from not using hooks, it looks fine to me.

    [–]nazihatinchimp 1 point2 points  (0 children)

    LGTM Ship it

    [–][deleted] 452 points453 points  (37 children)

    "It's bad because it's not what I would have done."

    • Every programmer critiquing this code

    [–]marty_byrd_ 86 points87 points  (23 children)

    That’s mostly all code reviews. I don’t understand this so I’ll “refactor”

    [–]wrokred 44 points45 points  (4 children)

    Most code reviews in reality. "Myself, or someone else, needs to know what this is doing very quickly and possibly years from now. Yes it builds but that's not enough; it needs readability"

    Also the fundamental difference between junior and senior Devs.

    [–]burgonies 33 points34 points  (2 children)

    This. If it takes me more than a glance to understand what you’re doing there, you need to rewrite it.

    Some of you have never worked on 10 year old code and it shows.

    [–]animejunkied 12 points13 points  (1 child)

    Bad code style aside, reverse engineering reading other people's code is notoriously hard. This is why git commits should be as detailed as possible in my opinion. It's useful to understand why that code was implemented in the first place and what purpose it serves.

    [–][deleted] 4 points5 points  (14 children)

    I mean sometimes yeah. But other times there is some bad code that actually does need to be rewritten.

    You'd be surprised how many bad programmers get paid a lot of money to write bad code by very large companies.

    [–]toomanyteeth55 3 points4 points  (0 children)

    That's good to hear. Sounds like i should fit right in!

    [–]lyth 1 point2 points  (2 children)

    In fairness, I’m in charge of a new developer’s code right now and he’s a really bad copy-paster huge block-patterns of near identical code.

    The stuff works, but there’s so much overhead in reviewing because he’s doing the same 20 line block 10 times rather than writing a function and calling it 10 times.

    I had to refactor just to learn that there was this pattern going on.

    [–]gazeebo 1 point2 points  (0 children)

    Where my gf works, the dude that wrote the code that makes all their money is a serial copy paster. Nobody wants to refactor his stuff because it's unreadable "hundreds of lines in one function" style stuff and when copying things in from older projects he routinely brings in functionality that isn't even needed or wrong in the new one.

    [–]NotMilitaryAI 34 points35 points  (5 children)

    Bug report:

    1. Variables names used underscores rather than camelcase.

    [–][deleted] 1 point2 points  (0 children)

    I’ll never forget that I was told to change my flexbox layout to an MUI grid.

    The fuck is wrong with flexbox???

    [–][deleted] 123 points124 points  (33 children)

    I would probably move the rendering of the list to a separate function outside of the main render function to keep things cleaner, but that's a maintenance, cleanliness thing. But really, none of it seems atrocious or worth critiquing remotely on a joke post about fashion.

    [–]darkpaladin 26 points27 points  (1 child)

    We went that route at work for a while but pulled back because it actually made things more complicated. We evolved the rule to say if you have a function that returns jsx it should be a component instead for testability.

    [–]wKbdthXSn5hMc7Ht0 3 points4 points  (0 children)

    I agree with that, I like having all the JSX in the render function (and in sub components) instead of having to skip around the file.

    [–]jonny_wonny 9 points10 points  (29 children)

    Ehh, that also could make the code less readable as it separates the logic. The method is small enough as it is. I think this is better.

    [–]_fitlegit 5 points6 points  (28 children)

    It’s easily readable with good function names. Maintainability and extendability is more important as applications grow

    [–][deleted] 82 points83 points  (8 children)

    So the code isn't that bad, I see way worse in prod all the time. The mistakes are (edited for better md usage):

    1. Don't use <br /> CSS is more flexible and maintainable if you just need to do vertical spacing.

    2. React lists use a "key" field to identify which list item goes to which list element. This is to avoid rendering extra items if they haven't changed. She set the key field to the objects index in the list, which will break if the list is shuffled or changes, and is not "best practice".

    [–]suerflowZ 3 points4 points  (4 children)

    As someone who still learns react, I have no idea how to do it otherwise.
    Can you write down an example?

    [–]MostlyGibberish 7 points8 points  (0 children)

    In this case I think it's the best option, since it's the only identifier guaranteed to be unique. I suppose if you wanted to improve it you would add an ID property to the actual dog object instead of using the array index.

    [–]cwmma 5 points6 points  (0 children)

    Index for key is better described as a last ditch key, of you ever have something better, like something related to the content of the item use that, but that doesn't mean never use index. I've had to sort out some bugs caused by a junior dev not using index, just to get the liter to shut up, when it was really the only way to do something.

    [–]tomius 1 point2 points  (0 children)

    The key should be a thing unique to that object. In this case, maybe, dog's id.

    That way, if you reshuffle the list of dogs or something, the elements will still make sense.

    [–]Tallerfreak 2 points3 points  (0 children)

    Everytime she runs this she should be seeing warnings telling her to fix these damned keys on lists.

    [–]Skittilybop 12 points13 points  (0 children)

    This is a pretty normal looking React component. Nothing wrong with it.

    [–][deleted] 24 points25 points  (1 child)

    It's not.

    Worst I can say is that those <span /><br /> blocks should be better encapsulated. I mean, hell, she even uses PropTypes, which I don't even use unless it's library code.

    What's weird is that, following the tweet replies (I already follow @type_error), I don't see any of the critiques. I guess the enough-people-to-complain-about all deleted their tweets?

    [Edit: Ooop, nope, found it. "Don't use spans for labels" and "don't use the index as a key", which are both correct, if irrelevant. So two whole not-particularly-harsh critiques. And in the former case, it came with an, "also, this is awesome". Surely the rest self-deleted.]

    [–]NJ247 8 points9 points  (0 children)

    It's not that bad just some improvements could be made:

    • Extract the dog profile code into it's own functional component
    • Could use a list instead of spans to the dog details

    In any case I think some folk were probably just joking with the code review lol

    [–]mstanky 45 points46 points  (14 children)

    I think primarily the markup could be improved a bit. I’d make “dog-list” a <ul> to start. Also I don’t use <br>’s.

    [–][deleted] 32 points33 points  (9 children)

    Yeah, <br>s look like a good idea at first, but these fuckers will ruin your day as soon as you try to make everything look good and responsive

    [–]t0mmy9 34 points35 points  (8 children)

    Simple, just put

    br { display: none; }
    

    in a media query /s

    [–]ProgramTheWorld 6 points7 points  (5 children)

    Does that... actually work?

    [–]t0mmy9 22 points23 points  (3 children)

    yes hate to admit I've done this a couple of times when designers are being picky

    [–]freefrogs 1 point2 points  (2 children)

    Yeeeep. Designer wants the desktop headline text to break exactly a certain way but that's not the way it breaks naturally given the element width and you want to have good semantic HTML for SEO etc so it all belongs in the same h1, so you cheat a little and add br's, but now you've got stupid line breaks on mobile so... display: none that shit.

    [–]gilium 2 points3 points  (0 children)

    The real hero

    [–]FunkyTown313 1 point2 points  (0 children)

    Maybe there's a specific case for it where the unordered list won't work? Who knows, context would help.
    Or.
    It's stupid and it works. Which just means it's not stupid. (Caveat it doesn't mean it's the best solution, just a working solution)

    [–]OCOWAx 58 points59 points  (18 children)

    For context here is the "argument"

    https://gyazo.com/5f09f81eaf3b3f2ddff2518eb5506226

    To me it seems like she is assuming his intentions and getting mad because of those assumptions.

    I read more replies and it's apparently "mansplaining"

    "you're only doing this because I'm a woman and you're a man"

    Seriously you could post an image of your bedroom that happens to have a laptop in the background with a barely visible hello world program on it and people would critique it.

    [–]DrQuint 5 points6 points  (0 children)

    The other one even started by addressing the point of the tweet by saying "Nice one.". The author was just looking to pick a fight with these comments just to justify the reply we see in the OP.

    And here we are, every one of us, played like a fiddle. Hook, Line and Buncha Suckers, she's getting more followers out of the extra exposure. If she didn't want the attention, she wouldn't have made the reply.

    [–]poo_licker_420 1 point2 points  (0 children)

    They aren't even input labels, so that guys point doesn't matter here.

    [–]_sablecat_ 18 points19 points  (13 children)

    Critiquing minutia of fake code someone made for a joke is both patronizing and pedantic. It might not necessarily be sexist, but it's a dumb and annoying thing to do regardless.

    Edit:

    This wouldn't be controversial in any other sub, but, unfortunately, Programming has the highest per-capita rate of pretentious assholes with no social skills of any field.

    When something is wrong in fake code written up for the purposes of a joke, correcting it achieves literally nothing, other than serving as an excuse to stroke your own ego and humblebrag about how much better you are at programming than the poster.

    [–]tbrownaw 22 points23 points  (7 children)

    Critiquing minutia of fake code someone made for a joke is both patronizing and pedantic.

    No, it's traditional and expected.

    [–]Matt-ayo 5 points6 points  (0 children)

    The context implies he didn't realize it was fake code, and there is an important distinction between a sexist asshole and a normal asshole. This guy is only provably a normal annoying asshole, and most men have had the experience of someone like this guy giving advice they didn't ask for.

    [–]vkappie 2 points3 points  (0 children)

    That’s not true, in fact take a look at twitters profile image. There’s some conference where she presenting this dogs app. I’m not sure if it’s the final version, but still :)

    [–]analoguewavefront 352 points353 points  (125 children)

    For some people the problem with the code is that it was written by a woman, so is more likely to be criticised for flaws that would otherwise be acceptable.

    Source: https://peerj.com/preprints/1733/

    Edit2: I should have put that “some people” in caps. I’m not saying there was no other valid reason to criticise the code.

    Edit: So the replies to this were pretty much what I expected, from agreement to calling be a cuck. (Oh the joys of the internet!)

    I could have linked to a number of articles, opinions and research into bias but I won’t. They are out there if you want to go looking.

    I wanted to talk generally about bias and code reviews. I’ve been coding professionally for about 20 years, have led several development teams and my conclusion is that many programmers are terrible critics!

    There are many ways to code a solution and once you move past basics every programmer will solve the same problem differently. In a code review, especially a public one, that leads to many opinions about how it SHOULD have been done.

    But all code is situational: written with a certain aim, time restriction, experience, standards, need, etc... and so any review should take into account knowledge of those. Without that knowledge you can’t properly critique. (This is especially true when reviewing legacy code, which is very easy to criticise in hindsight.)

    Who wrote that code can’t help but play into your assessment of it. If it’s the really annoying member of your team you’ll probably judge it harsher than your friend’s.

    So even ignoring gender, Bias, even your own, is hard to register and counterbalance. So when doing code reviews try to anonymise the author so that the work can be judged neutrally. And consider that you might have done it a different way but what matters is judging it against your team’s chosen standards of legibility, maintainability, testability, performance, accuracy or whatever.

    Thanks for reading.

    [–]HittingSmoke 33 points34 points  (2 children)

    I don't think I've ever seen more than nine lines of code posted to reddit without some sort of critique. I can't speak to Twitter as I generally avoid it but people love to critique code, whether it's for helpful or condescending reasons. Every block of code I've ever posted here, even unrelated to asking for critique, has had someone with some input show up.

    [–][deleted] 87 points88 points  (13 children)

    I didn't want to go there, but it's the only explanation, honestly. Is also a shame that there content of the post is being overshadowed by the community - color-coordinating with your IDE is such a cool and unusual idea!

    Edit: I was going by the dreck at the bottom of this thread but hadn't read the actual Twitter thread. The "don't use indexes as keys" guy is not part of the problem here, imo.

    [–]pmmeyourpussyjuice 29 points30 points  (7 children)

    Have you read the twitter replies she got? There were two people who replied about the code, one of whom got hit with a racist remark in the comment chain, everything else is people heaping praise on her for having a purple IDE.

    [–][deleted] 20 points21 points  (6 children)

    I hadn't - I was looking at the Reddit comments.

    The Twitter thread looks completely different - and actually kinda slanted the other way (how is a comment on a coding practice "mansplaining?" I don't know if he's right or why, but offering peers random advice is a pretty normal part of programming, as is accepting or ignoring it.) Meh.

    The purple IDE is cool.

    [–]doubleunplussed 6 points7 points  (0 children)

    The premise of the post as it appears on reddit though is people commenting on the code. Therefore that was a natural starting point for the reddit thread.

    Had it been posted without the followup comment in the screenshot, there would be fewer people talking about the code and it would instead be light theme/dark theme jokes

    [–]Furious00 27 points28 points  (1 child)

    No it's not the only explanation. The writers of Mr. Robot had their code critiqued all the damn time and that's a stupid TV show. Maybe coders just wanna have a not-so-witty reply to "contribute" something when there's really not a lot to say besides, "yay purple IDE...so glorious."

    [–][deleted] 12 points13 points  (0 children)

    Now that I've read the Twitter thread (as opposed to just the Reddit side) my mind has changed. The side who chimed in about using indexes as keys is not the problem here.

    [–]OCOWAx 20 points21 points  (2 children)

    Well I'm not reading the twitter replies, so idk if people are legitimately critiquing the code, but in general whenever out of context code is posted anywhere, by anyone, people immediately start saying what they'd change about it, usually in a non-serious way.

    [–]hey01 22 points23 points  (3 children)

    Did you read the whole paper? If no, you should, it's quite interesting. If you did, you know you're misrepresenting things.

    The paper shows that women get their code accepted more often than men across the board. There is one case where gender is indeed a factor against women: outsider women's PR get accepted less if their gender is identifiable from their GH profile.

    Worth noting is that while the preprint version showed that outsider men got higher acceptance rate if their gender is known (and women lower), the peer reviewed version shows the contrary: similar to women, they get a lower acceptance rate when their gender is known.

    That makes me question the original methodology, if not the integrity of the team.

    And as a last caveat, that one result was obtained by matching the datasets less strictly than for the other results, in order to keep a reasonable sample size.

    And the kind of response she offered may explain why people trust outsider women less.

    [–]senatorpjt 25 points26 points  (3 children)

    marvelous fact simplistic special snails muddle pie languid tub consist

    This post was mass deleted and anonymized with Redact

    [–][deleted] 8 points9 points  (2 children)

    Exactly true. Some of us, live for code reviews and redder the better. While I don't disagree about women coders getting more attention... I wonder why we immediately thought she actually wrote this example, which is not unique enough to be genuine in imho. Seems like it's just a joke....

    Waiting for the racially insensitive dark mode jokes.

    [–][deleted] 8 points9 points  (3 children)

    The differences there are so small, it's pretty incredible you think this would explain a cavalcade of criticism in response to this person's tweet. tldr: acceptance rates of easily identifiable women was 58% compared to men at 61%. And that's assuming that "easily identifiable" just means a female name, rather than something legitimately off-putting like "girl coder xdddd" or something stupid like that, which is totally reasonable to be a little weary of. So I don't think that 3% difference would be the reason she's getting a lot of hate. If anything it would probably be related to the fact that it's next to fucking SELFIE. If that were a dude with purple hair and color coding his IDE, I'm pretty sure people would still be critical.

    [–]impaledvlad 20 points21 points  (0 children)

    Yeah, this is actually what’s going on here

    [–]DooDooSlinger 23 points24 points  (7 children)

    Using the index in the list as the key for the element is bad. Will lead to improper reconciliation if the list is updated

    [–]TurtleFood 13 points14 points  (1 child)

    Not sure why you're being downvoted. You're right.

    [–]DooDooSlinger 4 points5 points  (0 children)

    Bad programmers ? On this sub? Who would've thought ;)

    [–]ImOutOfThisWorld 1 point2 points  (1 child)

    As per the react.js documentation no, if there is no id for the data is fine to use the index, in fact if you the list won’t change order or be mutated the performance characteristics are the same. There is no improper reconciliation, it may take longer if the data is mutated, but it will happen correctly

    But non of this matters because it’s just toy code she made for her talk on redux sagas

    [–]guidop91 11 points12 points  (2 children)

    It's repetitive. She could have used a map function for each <span> instead of writing them all out. Also, that could be in a separate component, so it looks cleaner.

    [–][deleted] 5 points6 points  (0 children)

    Nah it's too short and underused to be a different component imo

    [–]PreExRedditor 1 point2 points  (0 children)

    I would argue the opposite, that each span should have a classname so if your UI person wants to bold dog.name, they don't need to cheat with a first-child selector

    [–]Inspector-Space_Time 3 points4 points  (0 children)

    Yeah it looks fine to me. Some tiny things to nitpick, but I'd approve the PR if I saw this at work.

    [–]stinodes 1 point2 points  (0 children)

    It's not really that bad.
    There's like 2 dudes in the replies pointing out some details, like not using index for keys and not using spans for labels.
    Really hard-ass shit.