3 Tips To Write Clean Code (from an ex-Google software engineer)

preview_player
Показать описание
Here are 3 tips to write clean, readable, and maintainable code. The examples that I show are written in JavaScript / TypeScript, but they apply to any programming language and to any part of the software development stack.

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

So who's gonna join me in cleansing their code of its filth?

clem
Автор

1. Always name your properties or variables in such a way that leaves absolutely no room for
2. Always capture a complicated piece of logic in a very descriptive, self-reading variable.
3. Avoid double negative (`const isNotBlocked = false` --> `const isBlocked = true`)

sangilyun
Автор

Clean code series idea: Would be really great if you'd do a video on how to use OOP concepts correctly or more efficiently.

himanshuraj
Автор

Another principle I try to follow:
Whenever you have a chunk of code that logically belongs together, make a function out of it, even if it is not used anywhere else. It makes it much easier to read code and find the section that might cause errors.

Raharth
Автор

Very interesting approach on how to write clean code. I really believe that the main key to write clean code is to always think on other developers. The quicker your team mate understands your code, the better (or cleaner) it is.

brenowschneider
Автор

The tip I would like to add is
"Don't get obsessed about premature abstractions, sometimes let there be two are more functions that look similar, dont generalize them into a single function"

aum
Автор

I have to say i am impressed by the simplicity of your explanation of this – most often – fuzzy seeming concept. I am feeling like the one thing i have to understand and to put a punchline in my head: make your code readable to a human that does not think like a programmer. That makes life easier for a programmer. Great stuff!

adamsilber-gniady
Автор

this video single-handedly helped me SOOO much more than the hours of coding videos I have watched. Thank you.

MaxxD
Автор

I love these tips. Clement can catch things that is so true but rarely talked about. This is true in all of your videos, and this is why you are so awesome

sunnyshang
Автор

The way you described all the tips with examples was greatl Love your content!

prakarshparashar
Автор

I'm still new to coding and these tips make a lot of sense. Thanks a lot man for your help 👍

robertoa.tarazona
Автор

Man I did all of this, every single tip you mentioned, in a production code. I am that dumbass bastard. Cant believe I am so called "software engineer". I literally feel dumb and exposed now. Straight to the point man.

doomguy
Автор

Really enjoyed this one. Doing this caused a good discussion on one of my recent code reviews a month or two ago. Thanks!

RideTheTeacups
Автор

Thanks for this amazing video Clem! We would definitely want a series on this !

vaidhyanathansm
Автор

17 min video from clement POG

Edit: Hell yeah, we want more of these vids

harispapadopoulos
Автор

That's awesome. It would be definitely great, if we can witness some more of such instances of clean code. Thanks for putting this up

whatsinaname
Автор

This is so important even when you are new you still need to learn this i think this is important more than making your code works. Because if you understand your code you can actually figure out whats wrong with your code and fix it.

phongtranquoc
Автор

Please make more these type of vids, it looks pure gold to me

chunkaifu
Автор

I'd love more of these types of videos too 🙂. Code structure/organization, clean code.. best practices in general for the individual coder and for a coder on a team. One thing I actually don't ever see, though I'm yet to experience (yet hear is important), is knowing what sorts of issues come up in teams and how to best deal with them. Maybe disagreements on deadlines? Coding styles (if the company doesn't have an agreed style already)? I dunno.

subz
Автор

Thank you so much, I've started a degree in multimedia engineering and I've had trouble with the time I had to spend reading several times the code I've written the previous days so that I could continue coding. I know this will help me a lot to reduce that time spent

etipeti