Why Did They Do This?! (Code Review)

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

Cosden Solutions

Cosden Solutions

3 ай бұрын

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 3 ай бұрын
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 3 ай бұрын
can u share github link
@tofahub
@tofahub 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 3 ай бұрын
Keep it coming, i love this series
@larsfaye292
@larsfaye292 3 ай бұрын
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 3 ай бұрын
Awesome content, keep it up! and always share the best standard of writing a react application.
@omnilothar
@omnilothar 3 ай бұрын
if a component has too many useState (let say 5 or more), would you recommend to use reducer instead?
@toastrecon
@toastrecon 19 күн бұрын
Seriously one of the best React channels on YT.
@keatonaylor1580
@keatonaylor1580 3 ай бұрын
digging the content thanks!
@julienraillard3567
@julienraillard3567 3 ай бұрын
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 ?
@abdullahmanafikhi4438
@abdullahmanafikhi4438 3 ай бұрын
You're awsome man !, thanks alot ❤
@davronmaxmudov3972
@davronmaxmudov3972 3 ай бұрын
I download, like, share without watching). Your content is super cool
@cedericprivat
@cedericprivat Ай бұрын
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 Ай бұрын
Yep, have a video coming on complex state!
@yunusyavuz4683
@yunusyavuz4683 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
​​@@cosdensolutions so memoing a component isnt always good?
@hahaheheh0h0
@hahaheheh0h0 3 ай бұрын
why do you not use vim/neovim when you're already using vim motions?
@cosdensolutions
@cosdensolutions 3 ай бұрын
because I prefer the VSCode ecosystem
@virochansharma6446
@virochansharma6446 3 ай бұрын
Vs code theme?
@richardantao3249
@richardantao3249 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
@@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).
@Solo_playz
@Solo_playz 22 күн бұрын
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 ❤
@nathnaelwondisha6649
@nathnaelwondisha6649 3 ай бұрын
can you share the code
@shahidshafi1227
@shahidshafi1227 3 ай бұрын
Theme??
@cosdensolutions
@cosdensolutions 3 ай бұрын
Desc
@DavideFicano
@DavideFicano 3 ай бұрын
Too many "as" in this code...
I Found the Perfect Open Source React Project (Code Review)
22:36
Cosden Solutions
Рет қаралды 60 М.
This is way too complicated! - Code Review
19:31
Cosden Solutions
Рет қаралды 20 М.
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 122 МЛН
КАРМАНЧИК 2 СЕЗОН 6 СЕРИЯ
21:57
Inter Production
Рет қаралды 389 М.
Ну Лилит))) прода в онк: завидные котики
00:51
What is Span in C# and why you should be using it
15:15
Nick Chapsas
Рет қаралды 246 М.
Single Responsibility Principle in React (Design Patterns)
16:50
Cosden Solutions
Рет қаралды 43 М.
Joscha at Microsoft
48:46
Simuli
Рет қаралды 1,5 М.
Coding with Notch (from Minecraft: The Story of Mojang)
3:57
2PlayerProductions
Рет қаралды 6 МЛН
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 759 М.
You Are Using useEffect Wrong
14:40
Cosden Solutions
Рет қаралды 30 М.
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 379 М.
Learn React Hooks: useEffect - Simply Explained!
14:07
Cosden Solutions
Рет қаралды 108 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
The problem with useEffect
11:37
Cosden Solutions
Рет қаралды 30 М.
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 122 МЛН