5 Tips For Cleaner Code // Clean Up Your Code With These 5 Tips in 2020 For Developers

preview_player
Показать описание
📚 Win $15,000 in prizes - Free GAME, click here!

What sort of tips should you know to become a better web developer? In this video I discuss 5 tips you should know to be a better cleaner code in 2020 and 2021. #webdevelopment #cleancode

👉Check out my last video on Tailwind CSS

0:00 Introduction
0:44 Remove Comments
03:40 DRY
05:45 Naming Conventions
07:05 Make Readable Code
09:00 Test Your Code
10:18 BONUS

Рекомендации по теме
Комментарии
Автор

I am not good at English listening but your voice is so easy to listen, good job Erik, thank you for your sharing

nguyenmanh
Автор

I agree with all the tips except for the part about comments. However, some developers when they think of comments think they should comment what the code is doing, instead of why something is being done. In my opinion, if you have to describe what the code is doing, the code is poorly written. But there are times when it’s important to leave a history as to “why” something is being done. Or, if not the why, perhaps explain algorithms used, and why, expected inputs, outputs, etc. I

I am dealing with large chunks of uncommented code right now from a new grad that left our company and didn’t comment anything. We curse him nearly every day. Don’t be like that guy

purduetom
Автор

Thank you so much Erick for this video..
appreciate your Hard work:)

maheshmulik
Автор

Glad the DRY principle was in here. I'd say that "not writing comments" is a bit of an extreme though. If someone new comes in, at least having a little explanation in the file can be handy IMO.

SivakD
Автор

Yea I've been kinda messing up with writing same sh*t a few times when I could've just put it in a method and take it from there, I'm getting better at it nowadays though

alexjulius
Автор

As a CS student it is true our teachers always tell us to add comments, sometimes on every line

geekmors
Автор

Tip: Less Development by Slogan

Slogan: DRY - Don't Repeat Yourself
Actual core message: "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."

While repeated copy-paste is a bad practice, duplication can be a judgement call. Sometimes things that look the same initially will diverge in separate directions later.

"duplication is far cheaper than the wrong abstraction"

Code Smells: "The second is that smells *don't always indicate a problem* ... smells aren't inherently bad on their own - they are often an indicator of a problem rather than the problem themselves."

I think the best sound bite regarding the "comments smell" is: "When you feel the need to write a comment, first try to refactor the code so that any comment becomes superfluous."
Martin Fowler/Kent Beck in "Refactoring"

Slogan: SRP - Single Responsibility Principle
Actual core message: "Gather together those things that change for the same reason, and separate those things that change for different reasons."


"And then Uncle Bob runs into the problem that all of us have which is naming things incorrectly"

So a function should exhibit the property of cohesion.

Perhaps a more intuitive way of justifying short functions is "Fits in My Head".

i.e. a function needs to be large enough to represent a cohesive idea while remaining small enough to be reasoned about.

The less (clever) code there is to mentally parse in a function the easier it should be to comprehend it - and to verify whether it does its name justice - after which we can forget about the code and have confidence in the meaning of the function's name when we encounter it in the future.

PeerReynders
Автор

For JS, ESLint AirBnb and Prettier

TDD FTW

rexkenley
Автор

Review the clean code course by acadmind in Udemy erik

gowthamujjineni
Автор

I feel like the thumbnail could have a lot of good captions

seabass_