Тёмный

This code was messy... live refactoring a subscribers React side project 

Web Dev Cody
Подписаться 222 тыс.
Просмотров 77 тыс.
50% 1

cleaning up some react code.
------------
🤑 Patreon / webdevjunkie
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/codyseibert/youtube

Опубликовано:

 

20 авг 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 122   
@tudor14
@tudor14 Год назад
Dude you'd be a dope senior dev to work with as a junior. These types of videos are more valuable than you probably think. Cheers from Australia
@victorj9582
@victorj9582 Год назад
Wow I’m actually impressed how much you cleaned up in an hour, I would’ve been staring at this in confusion 😅 Great work
@Immatreus
@Immatreus Год назад
ive watched a lot of react youtube tutorials and this was by far the most informative. thank you so much for making this
@zachmikulcik3569
@zachmikulcik3569 Год назад
I really get more out of live refactoring than a tutorial or the creation of a small new project. This requires alot of thought process to figure out what its doing and then design a way to make it work like how it worked previously except being much cleaner. Great work!
@flofe2607
@flofe2607 Год назад
I'm more impressed by the fact that he just understands what this guy did and is able to refactor it
@WebDevCody
@WebDevCody Год назад
Yeah this one was a tough one
@k1mpman
@k1mpman Год назад
Watching this video made me realize how much I've longed and wanting a video like this. I try to consume tutorials and all that as much as I can but I learnt so much more from this and I'm not even that far into the video. Thanks a bunch from a webdev uni student
@WebDevCody
@WebDevCody Год назад
Glad it helped!
@dhanushshetty7840
@dhanushshetty7840 Год назад
Good job man. I'm learning react. These videos are really helpful to understand how to go about design
@oOrbitZz
@oOrbitZz Год назад
Great Job. I enjoy watching. I admire your patience.
@refactoringcoach6499
@refactoringcoach6499 Год назад
This video is the right format for learning for most people. Well done! I started my channel just to help people by refactoring real projects live on RU-vid. I hope this is going to be valuable enough for junior as well as experienced engineers/devs
@zorgivanov8685
@zorgivanov8685 Год назад
I love your videos, so much to learn! Thank you for your work
@aayushpatil7514
@aayushpatil7514 Год назад
These reafactoring videos are really helping :D
@pwerd
@pwerd Год назад
Amazing video and concept! Subscribed!
@jshstuff
@jshstuff Год назад
This is such great content. Lots of nuggets along the way for different skill levels
@TheDinosaur90
@TheDinosaur90 Год назад
Great video! One thing that I think can be highlighted more is the need of tests, particularly for services. Tests are good for make more robust your software and document the behavior of it
@WebDevCody
@WebDevCody Год назад
💯
@depressigor2257
@depressigor2257 Год назад
you are doing gods work, can´t thank you enough!
@romainvincent7346
@romainvincent7346 Год назад
When you think you are losing people in the middle of a hard refactor, don't forget to mention the fact that such a refactor gradually makes the code more complex before it eventually makes it drastically simpler. This is expected because there are so much things to change or fix. Also, I would advise to keep your intermediate working steps in git commits, in a refactor branch. That way you can easily roll back. -- Oh and by the way, keyboard events have a "key" property that is more appropriate than "which". you may check `event.key == "Enter"` instead of `event.which == 13`.
@redaelouahabi731
@redaelouahabi731 Год назад
Bro, I didn't know how to thank you, so helpful, especially for junior devs who don't have a senior above them
@arzi2054
@arzi2054 Год назад
Never stop doing these, please
@yousfhamad70
@yousfhamad70 Год назад
Thanks so much you are realy doing a great and diff thing, please continue
@mvrius2924
@mvrius2924 Год назад
Yo man, this project was really messy =)) Congrats for being able to focus and refactor it
@bulldog2024
@bulldog2024 Год назад
I agree with having the button as type of submit when using in the form.
@Sleakon
@Sleakon Год назад
This is really good. I also laughed when you said "I'm not going to critique the design here because I'm not good at design either".
@Ssmidge
@Ssmidge Год назад
Another great video :D
@JustAlexanderThings
@JustAlexanderThings Год назад
Thank you for the review of the project!
@WebDevCody
@WebDevCody Год назад
Sure thing
@TheDopoqob
@TheDopoqob 9 месяцев назад
This is your first live refactoring video im watching. You might know this by now since this video is over 1 year old but at 59:53 you could mark and edit multiple lines at the same time in VSCode by using scroll click and dragging or pressing ctrl+alt+arrow down. Then you can mark all lines at the same time by ctrl+shift+arrow left then copy and paste the variable names for all lines simultaneously.
@kirillvoloshin2065
@kirillvoloshin2065 Год назад
great video! thank you!
@aviattri_9
@aviattri_9 Год назад
good work man!
@freyfrenzy
@freyfrenzy Год назад
watched the whole thing, great vid!! ps: you can spread JSX props like `` but tbh idk how widespread (pun intended) this is. i rarely see it in the wild but i personally love it, though i can kinda see how the “{...{” could turn people off to it.
@WebDevCody
@WebDevCody Год назад
Yeah something seems dirty about that, but I use spread when I need to pass through from props or something when making a HoC or wrapping a component
@demolish000000
@demolish000000 Год назад
Great feedback. Learned a lot. Thank you
@jesusidev
@jesusidev Год назад
For those that are interesting in inline errors the plug-in is called error lens
@jestoni8975
@jestoni8975 Год назад
Great video! Thank you for guiding me here RU-vid Algorithm 🙏
@achtube85
@achtube85 Год назад
2:12 There is a VS Code extension called "Inline Fold", which is still in development, which folds all Tailwaind classes into a ". . ." shape :)
@fraelitecagnin7628
@fraelitecagnin7628 Год назад
Thank you, I was wondering if something like that existed!
@JEsterCW
@JEsterCW Год назад
Ye i just put this extension into my article about tailwind and have been using it for quite long time :D
@luizcastro5246
@luizcastro5246 Год назад
this is really cool
@Jeanpierrec19
@Jeanpierrec19 Год назад
Some more things that should likely be refactored: The board does not need to know about tasks, this should probably be state in the column which would remove some props. Likewise all the places where the columns are being refetched can likely just be be solved just by having the columns be state in the board and adding it to the dependency array of useEffect.
@jonnydommett7280
@jonnydommett7280 Год назад
Loving these videos really useful to see what type of stuff you pick up on, what extension are you using that shows the warnings inline with the code ?
@rickyalmeida
@rickyalmeida Год назад
I'd like to know too.
@WebDevCody
@WebDevCody Год назад
Error lens
@TheCameltotem
@TheCameltotem Год назад
I'm not in a JS dev but man this was horrible to see lol. The coupling is just crazy. But hey we all been new. Great video
@unhott1893
@unhott1893 Год назад
This is better than ASMR!
@SeibertSwirl
@SeibertSwirl Год назад
Good job love ❤️ I love you! 😘
@WebDevCody
@WebDevCody Год назад
Thank you baby love. Love you number one fan ❤️
@Peter-yd2ok
@Peter-yd2ok Год назад
Please make more videos like this.
@koftespies8867
@koftespies8867 Год назад
this vids are a great source of confidence and trust in my self… the code in these vids is honestly really bad
@chocolatecoveredgummybears
@chocolatecoveredgummybears Год назад
as a vanilla web developer for over a decade, now currently a programmer at a isp, i think my brain just exploded looking at react code lol
@blakelarson5005
@blakelarson5005 Год назад
vanilla to react is eye opening. Don't look back!
@chocolatecoveredgummybears
@chocolatecoveredgummybears Год назад
@@blakelarson5005 lol the systems and codebases here are written in php from like 2005. using sql server 2000 on their billing software. re-wrote a lot of it to work on new php. a lot of vanilla js on the front end though
@GamersOutcast
@GamersOutcast Год назад
input type button lets you have a button that doesn't submit the parent form by default. I'm sure there are more use cases.
@juliohintze595
@juliohintze595 Год назад
Nice video, dude. So good! Hey, did you know that if you press F2 with your cursor on top of a variable, you can rename it and the new name will be replaced everywhere?
@WebDevCody
@WebDevCody Год назад
Yeah I’m just so used to using cmd d
@stevebob240
@stevebob240 Год назад
Very helpful video, I'm an aspiring junior dev working with React as well. I learned a lot from your critique but am also happy that I could see some of this project's issues, what/how I may think about improving it (this person still did a good job and I appreciate it being shared!). Do you think a person with this level of code quality is ready to begin applying to junior level jobs?
@WebDevCody
@WebDevCody Год назад
I think writing clean code take a while to learn and typically you learn it on the job when people start denying your changes in code review because they are too sloppy. I think showing you’re able to build a larger project on your own the best way to demonstrate your skills. This app in the video is consider “small”, so I’d expect him to keep adding features until it at least felt medium
@stevebob240
@stevebob240 Год назад
@@WebDevCody Great response, thank you. I've built a couple small applications and am in the process of a more medium sized one now. I try hard to keep it clean but it's imperfect. It's a constant learning process as you know but I'm enjoying it. Your content is very helpful!
@mattz_zeref
@mattz_zeref Год назад
"What i'm doing right now" yeah every programmer when they refactoring 😂😂😂
@mohammed.haydar
@mohammed.haydar Год назад
Great video as always, how'd someone send you a project to refactor and live review it? and how much do u charge for that?
@WebDevCody
@WebDevCody Год назад
Join my discord and send me a message
@mohammed.haydar
@mohammed.haydar Год назад
@@WebDevCody Will do, thanks.
@igboman2860
@igboman2860 Год назад
You can leave board/:id as is but rename the variable while destructuring. I suggest this because board/:id is RESTfulish
@joshbedo8291
@joshbedo8291 Год назад
2:15 you can use a text wrap if you dont want class names to go off screen
@abdalrhmanme
@abdalrhmanme Год назад
Please go through the application and test every feature so we can have an idea about the project instead of jumping to the code immediatly Thanks.
@WebDevCody
@WebDevCody Год назад
Good suggestion
@PhilipCarlssonP
@PhilipCarlssonP Год назад
What's that extension that shows eslint errors/warnings on the line that they occur on?
@igboman2860
@igboman2860 Год назад
For the for loop you can make it functional by filtering and return the result, which is essentially what the person is doing. columns.filter(col-> col.data.id == parse) Easier to read Wrote that before I saw you did that. Great job
@hizzlyplay8127
@hizzlyplay8127 Год назад
how is called this thing where is shows if something is not usable in red text ?
@kristemmerman921
@kristemmerman921 Год назад
Great video, unfortunately you changed every line of code when you auto formatted the files. When you commit your changes, the whole file history becomes unreadable! This is the reason to share prettier, lint configs or disable auto formatting on save.
@WebDevCody
@WebDevCody Год назад
Yeah, always have an eslint file on your projects from the start
@cipriandanielpetrisor9344
@cipriandanielpetrisor9344 Год назад
This is where you make a separate PR with just the style changes and make sure to indicate its JUST style changes. The refactoring can be added as a separate PR after that and you actually get a meaningful diff.
@robinverbeelen4906
@robinverbeelen4906 Год назад
Why don't you use vs code softwrap? In the beginning you said that you eslint on save which is perfectly fine, but you also mentioned the tailwind classes being silly on their own, soft wrapping them helps a lot in my opinion, but would like to hear why you don't :)
@robinverbeelen4906
@robinverbeelen4906 Год назад
Why would you auto-like comments tho? It doesn't make sense when you like a comment with a question and then just don't answer it :p Nonetheless, I liked your video, it's cool to see how other people take on tasks like these.
@devkobie
@devkobie Год назад
Great video. Can you share your eslint config file
@Chriptus
@Chriptus Год назад
Wrap text * exists *
@owenwexler7214
@owenwexler7214 Год назад
Not to Monday morning quarterback what you were doing too much but personally I would have moved those DB functions out first thing as I believe database functions in a UI component is a major major smell. Edit: ah, I see you did this around 30:40
@WebDevCody
@WebDevCody Год назад
🎉
@irissupercoolsy
@irissupercoolsy Год назад
Could you maybe put the messy code as a download, so we could follow the video, cleaning up with you?
@WebDevCody
@WebDevCody Год назад
I’d have to ask my subscriber since it isn’t my code. Join my discord and ask for who’s code was in this video and I’ll connect you with the subscriber
@jior6
@jior6 Год назад
26:54 LOL
@JorgeCorradi
@JorgeCorradi Год назад
Could someone tell me what vscode theme that is?
@patrick.bruckner
@patrick.bruckner Год назад
59:57 you can.
@dinhquocle9932
@dinhquocle9932 Год назад
what is theme code in this video ? thank a lot
@rowhen_
@rowhen_ Год назад
Why don't you use word wrap on vscode (alt + z) so that you don't have to deal with the constant side-scrolling to look at code
@WebDevCody
@WebDevCody Год назад
I can try doing that next time
@dailygame9325
@dailygame9325 Год назад
Can I also share my portfolio website that i built
@ThanHtutZaw3
@ThanHtutZaw3 Год назад
I am new to Linux user and having some shortcut issue with VS code. I can go to fun by alt + click or Ctrl + click when using window but in Linux It doesn't work . Any Idea guys ? That problem found when I use vs code terminal and it solved with Ctrl alt click. still need others solution for finding fun etc...
@WebDevCody
@WebDevCody Год назад
I don’t use Linux sorry
@spyroninja
@spyroninja Год назад
What is "fun"? What are you trying to achieve? If you want to use the default Windows keybindings on Linux, there is a VS Code extension called (unsurprisingly) Windows Default Keybindings. It'll map the keybindings to what you would use on Windows (ctrl + d for finding duplicates, alt + shift + up/down arrows to copy/paste highlighted lines, etc). I don't know if it will do what you're asking.
@ThanHtutZaw3
@ThanHtutZaw3 Год назад
@@spyroninja I think It will work. Thanks bro
@awekeningbro1207
@awekeningbro1207 Год назад
How to submit our code for your live refactoring?
@WebDevCody
@WebDevCody Год назад
Discord
@noahsarcana
@noahsarcana Год назад
Index db is powerfull but not so easy to understand in one sight
@WebDevCody
@WebDevCody Год назад
Yeah looks messy from what I saw here. I’m assuming there might be a helper library to make it easier to use
@markskilbeck
@markskilbeck Год назад
Summit
@CottidaeSEA
@CottidaeSEA Год назад
Submit should be input with type submit or button with type submit. Nothing else. I personally prefer input, just to clarify that it's part of a form.
@WebDevCody
@WebDevCody Год назад
I like button with type submit I guess lol
@CottidaeSEA
@CottidaeSEA Год назад
@@WebDevCody Yeah, it's really a matter of preference as long as type submit is used.
@igorswies5913
@igorswies5913 Год назад
with input you can't put anything inside except text
@CottidaeSEA
@CottidaeSEA Год назад
​@@igorswies5913 Well... yes? I don't see the point of adding anything other than text inside of a button to begin with. If you feel like it, you can use a label and hide the actual submit button. You might want some SVG image as well, but you can honestly do a lot of that stuff with CSS.
@igorswies5913
@igorswies5913 Год назад
@@CottidaeSEA why limit yourself by default tho if a more natural option exists?
@pandaterminator007
@pandaterminator007 Год назад
I made a mini php framework for a LOL project, and named all functions by human names same for vars etc so i had lines like if(charles=helene) { amanda = pamela;} And then had it reviewd by a friend and he was like how to fuck do u even remember what name does what and how is this working xo
@WebDevCody
@WebDevCody Год назад
That sounds like a nightmare
@pandaterminator007
@pandaterminator007 Год назад
@@WebDevCody yup it was even for coding xo
@WebDevCody
@WebDevCody Год назад
@@pandaterminator007 I’m going to do that one of these video to troll you all
@pandaterminator007
@pandaterminator007 Год назад
it is mind fucking xo
@muresanandrei7565
@muresanandrei7565 Год назад
Really hate to see in React components with classes long as the entire screen use goddamn style components be more clean while also allowing easy use of animations.
@WebDevCody
@WebDevCody Год назад
Styled components kind of suck imo. Components should be there to abstract logic. When you make a ton of components to abstract styles you’re doing it wrong.
@muresanandrei7565
@muresanandrei7565 Год назад
@@WebDevCody What are you talking about it's garbage. And by seeing this video I can see what type of garbage frontend you teach
@mahadevovnl
@mahadevovnl Год назад
Tailwind is such an insult to CSS. I've never been strongly against anything in my long career, except for that insult of a thing. When I'm hiring I always see a recurring problem: those who use Tailwind never understand HTML and CSS. What a sad state of affairs to see it used so much. As if the DRY-concept is entirely gone AND the users of it go in repetition overdrive.
@WebDevCody
@WebDevCody Год назад
I don’t think you can use tailwind without knowing css. Everything in tailwind is basically a shortcut to css properties. It has the exact same concepts as flex, grid, etc. Ive seen many css classes with repeated styles sprinkled all inside of the class properties, so it goes the same both ways. If your devs don’t know how to dry code up, it’ll always be a mess
@tranceyy
@tranceyy Год назад
But real men use Angular, not this toy called React.
@macchimallo
@macchimallo Год назад
Looks like a good video, but man pls I stopped watching, 14min of video, 8-10 ads
@WebDevCody
@WebDevCody Год назад
Got to make money somehow am I right?
@michaelmclean2363
@michaelmclean2363 Год назад
useHistory
@brokula1312
@brokula1312 Год назад
Service names are too specific and should be nouns. Instead of "getTasks" service rather have "tasks.service" which holds all I/O on tasks. Then we would have: tasks.create(); tasks.get(id); tasks.all(); tasks.findOne(); tasks.findMany(); tasks.delete(id)...
@WebDevCody
@WebDevCody Год назад
It ends up being the same thing. getTasks vs tasks.getAll, literally the same thing. The only thing that achieves is you now have a bunch of independent files grouped together into the same file for no reason and now I have to scroll around a longer file to find the exact method I want filled with noise. I rather have a single file per method and only see the exact imports related to that method. Just preference.
@maurov2104
@maurov2104 Год назад
@@WebDevCody Ctrl + Shift + O bro, it's not that hard
@WebDevCody
@WebDevCody Год назад
@@maurov2104 I know how to use vscode short cuts, that’s not my point. At some point we have to decide what functions belong in a file. We don’t put 10 react components in the same file, so why put 10 controller methods in the same file. There are also tons of imports at the top and you don’t know which function they are required in at a glance. To each their own. Separation of concerns is a thing
Далее
How Senior Programmers ACTUALLY Write Code
13:37
Просмотров 1,4 млн
Нашли Краша Младшей Сестры !
23:46
🎙ПЕСНИ ВЖИВУЮ от КВАШЕНОЙ🌹
3:09:38
[RU] Winline EPIC Standoff 2 Major | Group Stage - Day 2
9:32:40
I Cannot Believe TypeScript Recommends You Do This!
7:45
Turning bad React code into senior React code
13:10
Просмотров 87 тыс.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
8 Design Patterns | Prime Reacts
22:10
Просмотров 391 тыс.
Why use Type and not Interface in TypeScript
14:12
Просмотров 195 тыс.
Нашли Краша Младшей Сестры !
23:46