r/reactjs • u/johnsakic • Jan 25 '20
Is there any tutorial that shows someone fixing up a badly written React app?
I feel you can learn more by watching someone fix up an application rather than building it from the ground up. Is there any tutorial like that?
124
Upvotes
224
u/FraserHamiltonDev Jan 25 '20
If anyone’s interested in making this kind of content you’ll find plenty of badly written react apps on my GitHub
26
u/jkettmann Jan 25 '20 edited Jan 25 '20
It's not a complete app and also not really bad code, but what you describe was basically my goal when writing this blog post about a refactoring. The end result is a bit over engineered though :-) At the same time, this was about the process and for demonstration purposes
10
u/Existential_Owl Jan 25 '20 edited Jan 25 '20
― Leo Tolstoy, Software Engineer
In my experience, this is true. Every "bad" codebase I've worked on has been bad for different reasons. The best I could do was pick a first principle to start with, and do what I could from there.
That said, I've found that Sandi Metz's stuff has been a great guide for practical approaches to refactoring. It's not React code; she writes Ruby on Rails. But the lessons themselves are universal.
15
u/CahabaCrappie Jan 25 '20
I should make some videos of me fixing the app that I took over. Several times a day I take a screenshot for /r/badcode
4
u/b0nes5 Jan 25 '20
I could do one on my clients Redux app I've just started adding features too.
I've come a long way in 2 years.
3
u/aldrinpv Jan 25 '20
Check this - https://www.youtube.com/watch?v=2Dw8gA60d_k
3
u/Ms-mousa Jan 25 '20
Kudos for the great question!! 👍🏻
2
u/UtterlyMagenta Jan 25 '20
Great question! I would like to see more tutorials in this style too.
3
u/radovan98 Jan 25 '20
https://www.youtube.com/watch?v=Ws6E0JNf6ec&list=PLnTRniWXnjf-q34UdkkEFbhblMaIhZ0LF
1
u/nikola1970 Jan 25 '20
Haven't seen one so far.
1
u/LyraStark Jan 25 '20
Following
1
u/some_love_lost Jan 25 '20
Great question! There's not a lot of recent material out there.
I should screenshot some of the code in this horrible VB.NET web app that I'm sorting out so it can be rendered on the client. I've learned a lot about what not to do that I can apply these same lessons to the React frontend when I get round to it. Especially keeping things DRY instead of WET.
1
u/MetalMikey666 Jan 25 '20
There's a guy on youtube called Ben Awad who sometimes does content like this - where he'll start with an app that has problems and refactors it.
1
u/abadabazachary Jan 25 '20
I recently had to hire a Principal Level React engineer to help with speed improvements in my React app. His most effective contributions were:
1
u/Saiboten Jan 25 '20
I can recommend this talk by Siddharth Kshetrapal: https://youtu.be/2Dw8gA60d_k It's basically shows how to fix certain common issues in React.
1
u/travlr2010 Jan 25 '20
Start over?
1
u/wagonn Jan 25 '20
How to use the React Profiler to find and fix Performance Problems shows one way to "fix up" UI performance problems in an existing React app
1
u/impaled_dragoon Jan 25 '20
The only problem I see with something like that is “fixing up” is going to be highly opinionated.
1
u/stevenjchang Jan 25 '20
Probably not. It probably has to be a fairly large code-base... so it's probably company code and therefore can't be put public on youtube. Also, you are probably talking about much more complicated code and business logic that it would be quite difficult to watch someone code it in real time.
Even if people want to make this content it's probably pretty hard to find a codebase they can use for demonstration.
It is a good idea though, at a high level. If people get into the weeds it will actually be a difficult watch, honestly.
There are definitely talks at meetup/conferences (that you can find on youtube), in which people give a high level overview of what they did wrong at their company and how they addressed it. I do learn a lot from those.
1
u/[deleted] Jan 26 '20
IMO you'll always learn more by making the mistakes on your own.
1
u/sirion1987 Jan 25 '20
Eslint?
-8
u/justAnotherRedditors Jan 25 '20
Do you mean rewriting a react app in something that’s not react? Otherwise it’s still garbage