10 Tips For Clean Code

preview_player
Показать описание
What is the clean code? In this talk the speaker will provide some answers to this question, and introduce you to 10 good habits that will help keep your code clean.

EVENT: Wordcamp US, 2016

SPEAKER: Michael Toppa

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

#1: You're responsible for code quality.
#2: Use meaningful names.
#3: Write code that expresses intent.
#4: Code should speak for itself. Less comments = less maintenance.
#5: Leave the code better than you found it.
#6: Single-responsibility code.
i.e function does 1 thing well. Less arguments = better function.
classes: most methods use most of the class' properties.
#7: Tests (TDD).
#8: Work on big picture skeleton, then fill in the details later
(interface first, implementation later).
#9: Independent components that can be used in different places.
#10: Master your craft.

How tf does this comment get so many likes? I'm just paraphrasing what the video says LUUL.

jessiechan
Автор

Mr. Toppa's Ten Tips with time markers:
#1: You are responsible for the quality of your code (2:31)
#2: Use meaningful names (3:30)
#3: Write code that expresses intent (4:23)
#4: Code should speak for itself whenever possible (4:58)
#5: Leave the code better than you found it (6:17)
#6: Single-responsibility principle (7:05)
#7: Write Tests (8:37)
#8: Work in short cycles: incremental and iterative (9:34) -- skipped
#9: Independent Architecture (9:36)
#10: Practice, Practice, Practice (10:40)

vaughn
Автор

Love the analogy with the doctors and accountants! Professional standards are definitely important

yuriymatso
Автор

To get the cleanest code you have to wipe your screen.

Tymon
Автор

99% of programmers will like this video, and then go back to writing dirty code, because their project is always unusually justified for being quick and dirty.

superstringcheese
Автор

clean talk about clean code. Love when people are concise and to the point lol great notes :)

cardmstr
Автор

O.M.G, my entire company needs to watch this. I spend 50% just trying to work out and more often than not rewrite other people's code.

fortuneflux
Автор

I love this channel, they always find really cool talks and ALWAYS give due CREDITS. Thank you so much for that.

SheeceGardazi
Автор

I would have loved to hear him explain number 8.

aminehamou
Автор

Watching this video after long time and still it taught me that i was not following the single resposibility code/functions! Thank you again Coding Tech for this awesome video gonna share it now so that others can learn from this too :)

arpitparmar
Автор

All this is heard before many times, but I must say you explain it really well and interesting.

jekabskarklins
Автор

I was asking for presentation about this and here it is. Thanks Coding Tech! <3

Iwillownyouandbehappy
Автор

This is the best video on programming I have watched. I wish I saw this when I started out 3 years ago.

seanlee
Автор

So true about comments, you end up neglecting comments as you update code due to time constrictions, better to use them only when you are very sure the code will not need updating.

suzesiviter
Автор

That was a really good talk and I enjoyed it. I wished he had ventured into program management where teams are involved. Of course his #1 rule is pertinent from 'my' point of view always. I both want and need my code to be self explanatory and as elegant as possible. But style comes into that and sometimes styles collide horribly. I've found that working in teams takes an initial time period of annealing style across the development atmosphere. In my case I spend time with each member of the team coding together at the same time and same place - right next to each other. Even taking turns at the keyboard. This is especially helpful in a group meeting when a particular aspect of the software needs greater attention. His comments on how the language forms a prose is excellent (vars as nouns, etc). And that style aspect determines the tone of the message so to speak. If one person is composing a melody and another is writing heavy metal, it just doesn't jive.

AtomkeySinclair
Автор

Really needed this video. I thought before I move deeper into writing more code, I should take a pause and clean up the existing code; even thou its tedious and boring to do so, where instead I could be coding.

pav
Автор

2:31 #1 You're responsible for the quality of your code
3:35 #2 Using meaningful names
4:12 great code should look like well written prose
4:26 #3 Write code that expresses intent
5:12 #4 comments are often lies waiting to happen, code should speak for itself
6:20 #5 the Boy Scout Rule
7:05 #6 Single Responsibility Principle
8:38 #7 write tests
9:16 unit tests
9:36 #9 independent architecture
10:41 #10 practice

ruixue
Автор

I agree that rushing is actually somewhat counter-intuitive in that it makes things take longer because you take shortcuts and make mistakes and you end up having to go back and fix them. This applies to most things in life, not just coding..

kylekoivukangas
Автор

Fun fact: writing clean code actually saves you time IMMEDIATELY

lucasterable
Автор

This is basically what they told me on the first day in my first freshman programming course at college.

exstasis