Why Did They Do This?! (Code Review)

Поделиться
HTML-код
  • Опубликовано: 5 фев 2024
  • Join The Discord! → discord.cosdensolutions.io
    VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
    Welcome to Code Review!
    This is a series of videos where I review code that you send me or that I find online. I review the code as I would when I work with my clients. You will see how a senior developer looks and thinks about code in a variety of scenarios, learn about best practices and how to do things the right way, and learn how to become a better developer overall.
    Enjoy!
    Darius

Комментарии • 29

  • @yannickbonavoglia2448
    @yannickbonavoglia2448 4 месяца назад +16

    Thanks a lot for reviewing my code! I really hope it also helps others.
    The section of the code you reviewed was actually written months ago and I totally agree that everything should be separated in its own logic.
    The main reason why I didn’t put it in the first place is that when I realized it I already had written too much code and I was too lazy to refactor it 😅
    Keep up the good work!

  • @tofahub
    @tofahub 4 месяца назад +3

    I am porting from Angular and best react channel I have found thus far. I don't wanna make a todo app as an advanced programmer. I wanna learn best practices and this is the channel for that

  • @imkir4n
    @imkir4n 4 месяца назад +6

    Keep it coming, i love this series

  • @larsfaye292
    @larsfaye292 4 месяца назад

    Really grown to love this channel. Feels like it's perfectly suited to my skill level. Intermediate enough where I can still learn new things, but not too advanced where I feel lost.

  • @reencedavid1039
    @reencedavid1039 4 месяца назад

    Awesome content, keep it up! and always share the best standard of writing a react application.

  • @keatonaylor1580
    @keatonaylor1580 4 месяца назад +3

    digging the content thanks!

  • @toastrecon
    @toastrecon Месяц назад

    Seriously one of the best React channels on YT.

  • @davronmaxmudov3972
    @davronmaxmudov3972 4 месяца назад +1

    I download, like, share without watching). Your content is super cool

  • @abdullahmanafikhi4438
    @abdullahmanafikhi4438 4 месяца назад

    You're awsome man !, thanks alot ❤

  • @cedericprivat
    @cedericprivat 2 месяца назад

    I would love to see a video in which you explain how to handle state in a bigger application that has a lot of nested components. I‘m struggling to figure out where to put state or context if I need to access it in multiple places.

    • @cosdensolutions
      @cosdensolutions  2 месяца назад +1

      Yep, have a video coming on complex state!

  • @omnilothar
    @omnilothar 4 месяца назад +1

    if a component has too many useState (let say 5 or more), would you recommend to use reducer instead?

  • @julienraillard3567
    @julienraillard3567 4 месяца назад

    How would you handle the post summaries buttons to be recalculated when the comments are edited (number of like for the post, number of commentaries, etc.)? would you pass such a callback fonction down to the PostCommentCard components or something else ?

  • @Solo_playz
    @Solo_playz Месяц назад

    Great video 👏🏼
    Can you review my codebase?
    How can I send you the code repo link?
    Believe me the code I've written is really good enough that can be used in your content I just wanted that a senior developer like you can review my code and suggest me more good ways to optimise and restructure the entire code base ❤

  • @richardantao3249
    @richardantao3249 4 месяца назад

    The comments are probably stored on the current post @ 7:20 because of the data from the database being denormalized. Any document based databases (and more) will have denormalized data, which makes reads easiers and writes harder. That is an inherent tradeoff of denormalizing data and you wouldn't be able to judge the design decision just by looking at the frontend code.
    EDIT: Confirmed: the data has a '_id' prop which is a feature of MongoDB, which is a non-relational document database

    • @yannickbonavoglia2448
      @yannickbonavoglia2448 4 месяца назад +1

      hey there, I’m the author of that codebase.
      On the backend (node) the single post has as the comments an array of ObjectIds (as a foreign key of a comment entity), when I fetch the post i use the .populate() method to get all the data related to that comment and store it in the array.
      I feel like the BE approach is correct as the data is separately stored and only referenced as a foreign key in the comments, on the FE the approach of separating the logics into its own component is completely right imo.
      Feel free to provide any feedback!

    • @richardantao3249
      @richardantao3249 4 месяца назад

      @@yannickbonavoglia2448 Hi! No issue with a separate component, just highlighting that certain tools and design decisions will influence your data to take a certain shape, and it’s difficult to judge the decision when the only context is a single (set) of react component(s).

  • @yunusyavuz4683
    @yunusyavuz4683 4 месяца назад

    I love this series, but I have a question. is not it a good approach that PostCommentCard have "memo" function. In this way, we should not pass the comment object directly, we should pass comment properties one by one as interface seggregation requires. So that, if the comments state has some changes, the whole cards will not rendered right?

    • @cosdensolutions
      @cosdensolutions  4 месяца назад +1

      Since PostCommentCard is pure UI, it's not worth it. Re-renders are cheap and shouldn't be a problem. Only memoize like that when you are rendering heavy components

    • @mohamedsalimbensalem6118
      @mohamedsalimbensalem6118 4 месяца назад

      ​​@@cosdensolutions so memoing a component isnt always good?

  • @hahaheheh0h0
    @hahaheheh0h0 4 месяца назад

    why do you not use vim/neovim when you're already using vim motions?

  • @virochansharma6446
    @virochansharma6446 4 месяца назад

    Vs code theme?

  • @nathnaelwondisha6649
    @nathnaelwondisha6649 4 месяца назад

    can you share the code

  • @shahidshafi1227
    @shahidshafi1227 4 месяца назад

    Theme??

  • @DavideFicano
    @DavideFicano 4 месяца назад +1

    Too many "as" in this code...