Bad Code v.s. Good Code

preview_player
Показать описание
Writing good code is hard. Even the best developers in the world right some bad code. In this video, I’ll describe the five criteria points that I believe make code good. These points include correctness, readability, testability, maintainability, and performance. I will also give eight practical ways to write better code. These include avoiding unnecessary coupling, planning ahead, focusing on modular code, avoiding deep nesting, not overcommenting, not fixating on performance, looking out for code smells, and properly handling bad input. I hope you find this helpful!

Prepping for your frontend interviews? Use code "conner" for a discount on my course FrontendExpert:

Socials:

Timestamps:
0:00 Good v.s. Bad Code
0:36 Correctness
0:47 Readability
1:48 Testability
1:59 Maintainability
2:25 Performance
2:58 Avoid Coupling
4:18 Good DRY Code
5:01 Plan For Coding
5:52 Modular Code
6:27 Deeply Nested Code
7:13 Over-Commenting
7:58 Performance Doesn’t Matter?
10:20 Code Smells
11:33 Bad Inputs
Рекомендации по теме
Комментарии
Автор

very helpful! keep up with these kind of videos.

RodnDjokYTB
Автор

I agree with the video.
A friend of mine said that applying SOLID will make my code always, the problem is that I didn't quite understand all the solid yet.
Do you if it apply for a language like javascript?

FilhoLouco
Автор

4:00 but you can simply call the common part together, and then process each branch later, can't you?
fun_1()
do_common()
do_unique_1() // or extensive code not in an inner function

fun_2()
do_common()
do_unique_2()

Of course, you may need to get variables back which could be resource-expensive (like game frame when time is of utmost importance)/cause an issue with non-pointer languages, which otherwise would process info and may return smaller values.

Can't you?

reda
Автор

no offence but my code quality depends on my hourly/project rate as a contractor.

tkdevlop