Why Did They Do This?! (Code Review)

  Рет қаралды 14,563

Cosden Solutions

Cosden Solutions

4 ай бұрын

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 ай бұрын
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!
@somashekharb1846
@somashekharb1846 4 ай бұрын
can u share github link
@tofahub
@tofahub 4 ай бұрын
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 ай бұрын
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.
@toastrecon
@toastrecon Ай бұрын
Seriously one of the best React channels on YT.
@reencedavid1039
@reencedavid1039 4 ай бұрын
Awesome content, keep it up! and always share the best standard of writing a react application.
@keatonaylor1580
@keatonaylor1580 4 ай бұрын
digging the content thanks!
@davronmaxmudov3972
@davronmaxmudov3972 4 ай бұрын
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 ай бұрын
Yep, have a video coming on complex state!
@omnilothar
@omnilothar 4 ай бұрын
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 ?
@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 ай бұрын
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?
@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 ❤
@virochansharma6446
@virochansharma6446 4 ай бұрын
Vs code theme?
@hahaheheh0h0
@hahaheheh0h0 4 ай бұрын
why do you not use vim/neovim when you're already using vim motions?
@cosdensolutions
@cosdensolutions 4 ай бұрын
because I prefer the VSCode ecosystem
@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 ай бұрын
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).
@nathnaelwondisha6649
@nathnaelwondisha6649 4 ай бұрын
can you share the code
@shahidshafi1227
@shahidshafi1227 4 ай бұрын
Theme??
@cosdensolutions
@cosdensolutions 4 ай бұрын
Desc
@DavideFicano
@DavideFicano 4 ай бұрын
Too many "as" in this code...
I Found the Perfect Open Source React Project (Code Review)
22:36
Cosden Solutions
Рет қаралды 62 М.
This is way too complicated! - Code Review
19:31
Cosden Solutions
Рет қаралды 21 М.
Пробую самое сладкое вещество во Вселенной
00:41
Homemade Professional Spy Trick To Unlock A Phone 🔍
00:55
Crafty Champions
Рет қаралды 57 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 47 МЛН
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 224 М.
Is this the perfect React app? - Code Review
11:02
Cosden Solutions
Рет қаралды 37 М.
I Reviewed Your Beginner React Code
12:36
Josh tried coding
Рет қаралды 97 М.
Compound Components in React (Design Patterns)
18:21
Cosden Solutions
Рет қаралды 28 М.
Extending Phoenix LiveView with Hooks
19:11
Code & Stuff
Рет қаралды 904
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 456 М.
You Are Using useEffect Wrong
14:40
Cosden Solutions
Рет қаралды 31 М.
This New Angular Release Is Wild
5:53
Theo - t3․gg
Рет қаралды 100 М.
Learn React Hooks: useEffect - Simply Explained!
14:07
Cosden Solutions
Рет қаралды 117 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 796 М.
Пробую самое сладкое вещество во Вселенной
00:41