Clean Code - Uncle Bob / Lesson 1

  Views 219,167


Year ago

"Coding Better World Together" is a set of master lessons from the famous Uncle Bob (Robert Cecil Martin), where he gives us a broad vision of the importance and future of Software in today's society.
In this first lesson, Uncle Bob demonstrates the need to write a clean code and establishes the bases to achieve it, being these bases of a social and scientific nature. Making it clear that the future of programming is based on an ethical and polite code.
"Coding Better World Together" es un conjunto de lecciones magistrales del famoso tío Bob (Robert Cecil Martin), donde nos brinda una visión amplia de la importancia y el futuro del software en la sociedad actual.
En esta primera lección, el tío Bob demuestra la necesidad de escribir un código limpio y establece las bases para lograrlo, siendo estas bases de naturaleza social y científica. Dejando en claro que el futuro de la programación se basa en un código ético y cortés.
0:00 Event Presentation
2:03 Presenter Introduces Uncle Bob
3:41 Uncle Bob Introduction / My Tribe
4:49 How Far is the Sun?
10:52 Introduction to Clean Code
12:21 The current Society works with Software
19:47 Volkswagen case / Introduction to the Ethics of Software Development
24:28 Why are Programmers so slow?
32:13 What is a Clean Code?
40:09 Analyzing some lines of code
43:43 Long code is not Good Code
49:25 Good Code / Refactored Function
52:40 Polite Code / Rules for writing a news paper article
55:25 Shrunk Code / The Rules of Functions
1:00:23 Shrunk Code / Drawing a Function
1:05:36 When and why was Java invented?
1:08:52 Prose Code / Arguments
1:16:13 Avoid Switch Statements / Problems and Evolution of some programming languages
1:26:15 The Uncle Bob's wife message (funny moment)
1:27:22 Output Arguments No Side Effects / Garbage Collection
1:32:21 No Side Effects / Using Lambda
1:34:26 No Side Effects / Command and Query Separation
1:35:30 No Side Effects / Prefer Exceptions to returning error codes
1:37:05 DRI Principle (Don't Repeat Yourself)
1:39:21 Structured Programming / Edsger Dijkstra Vision vs Actual Vision of the programming
1:45:32 Science and Correct Software
- Facebook: es-la. unitycoin/
- Twitter: unity_coin

BenRangel 8 hours ago
52:30 Would argue this function is not great as it’s unclear if includeSetupAndTeardownPages supposedly modifies the pageData. Would be more clear and readable if it returned a value into a new variable.
ATAHUALPA ARIAS 10 hours ago
that intro was kinda unnecesary,
Volodia Agadjanov
Volodia Agadjanov 10 hours ago
His book's - ok, very curiosity, but its so fucking stand up. It's just show, nothing else. So I'm feeling lil cringe when I'm look at this
Ioseb Otskheli
Ioseb Otskheli Day ago
Why do we need to plug a diameter of earth to other observations or even to calculate diameter when we have distance 350 mile as he saying and angle of 7 degree? With this information can be already calculated distance to the sun. Actually, with the same mechanism as in case of Sun, Moon and Earth.
George Tsiros
George Tsiros 2 days ago
1:48:18 it's meaningless to test "lines of code". Functions, components, yes. Individual lines, no. I'm not testing that ++i successfully increments i. That would be absurd.
George Tsiros
George Tsiros 2 days ago
1:42:48 "no modern language has a 'goto'" ... patently false.
George Tsiros
George Tsiros 2 days ago
1:24:50 what i find bizarre is that a function may take any number of arguments, while it may return up to one. Considering function arguments are sometimes passed by _reference_ it is immediatelly apparent that function arguments can _also_ be function _results_ . They become much more symmetrical once you change the function output to be simply a by-reference argument. "but then...?!" i hear you... yeah, yeah, yeah. Ultimately, _all_ code manipulates two stacks. The data stack and the return stack. What is being currently being handled and what is the program going to do next, so any function has access to two things, two stacks. So there is no need to _explicitly_ write them in every call. This way, every function call degenerates to its name. In one paragraph we arrived at forth.
George Tsiros
George Tsiros 2 days ago
c# descends from delphi, not java.
André Piotrowski
André Piotrowski 2 days ago
Oh boy, seems as if he had never read Donald Knuth’s programs. Don’t tell me TeX, METAFONT, or CWEB is no beautiful code …
Rednesswahn 2 days ago
Guy: "How about we make the intro 3 and a half minutes long?" Nobody: "What a great idea!"
Nnamdi Okeke
Nnamdi Okeke Day ago
I think to get people interested in a concept tell a story
Parikshit Prasai
Parikshit Prasai 3 days ago
He reminds me of George Carlin
Тимур Курскиев
Тимур Курскиев 3 days ago
Funny, cause there is a goto keyword in C#, and C# is pretty modern language; I tried it just for fun couple times. For instance, in "catch" block of try-catch (something wrong happened? - hey, let's go to the label a put before this place and try again xD)
Тимур Курскиев
Тимур Курскиев 3 days ago
Oh, I remember reading those examples in the book)
Тимур Курскиев
Тимур Курскиев 3 days ago
He forgot to mention the processors inside of his smart watch.
Anthony NGOP-LOTI 3 days ago
1:07:12 " The best way to sell hardware was to win the hearts and minds of programmers first." That's true!
wiki circle
wiki circle 3 days ago
boring crowd. I should be there
UFO Driver
UFO Driver 4 days ago
20:28 why do I feel like he is talking about the future me? =(
Q D 4 days ago
Nice, falls in like with this books I’ve been reading in clean code. Not sure if folks are interested but I found a cheap version online:
Garrett York
Garrett York 4 days ago
Mariano MS
Mariano MS 5 days ago
This video could've been perfect if the editor just showed the screen when uncle Rob was talking about code...
JavoCover 5 days ago
LOL 26:53 to26:59 30:35 to30:52
PennyAfNorberg 5 days ago
In a collage exam where i was supposed to prove the existence of sequence of binary words suck that each neighboring elements differ in just one letter for every word size. I did so by writing a lisp program , in paper, that would generate the next sequence. Then I proved that it did that and used induction.
ishit realbad
ishit realbad 6 days ago
i'm not even a programmer and i have a very basic understanding of code, and this guy gets me all excited to start programming..... i'm a 3d artist generalist wtf XD
SomeBodyIUsedToKnow 6 days ago
Sounds like Lewis Black
dot 6 days ago
Imhotep did it
' ♥ # Y)=00ßß
' ♥ # Y)=00ßß 6 days ago
omg stop talking about society just give me the information I came for
Roland Lundall
Roland Lundall 6 days ago
Hi Uncle Bob. I code mostly with Python. Can I use everything you have said here in Python also.
Antonomase Apophasis
Antonomase Apophasis 7 days ago
1:15:24 A double take is when you see something, and take it in as a normal perception; then an awareness of something in that perception causes you to look again (in surprise) to retake your perception. The idea is that there is a disparity between expected and actual perception.
Mike Bertelsen
Mike Bertelsen 7 days ago
I couldn't listen to him for more than 15 minutes. This whole "act" really gets to me haha
Fist Finger
Fist Finger 7 days ago
Lighting is terrible, intro and music obnoxious and jarring...can't continue.
Daniela Lage
Daniela Lage 8 days ago
Minuto 99 - Ada Lovelace foi a primeira programadora do mundo
Solotov D.
Solotov D. 8 days ago
6:30 please stop insisting and collaborating in the cheating of people, the earth is flat!
Mihai Raulea
Mihai Raulea 8 days ago
The simple mind filming this is actually what's wrong in this world. Total lack of consideration or care.
Tobi Adeniji
Tobi Adeniji 8 days ago
What an intro.
Cooper & the Cash
Cooper & the Cash 9 days ago
I know nobody will give a damn about it, but I just realized I've been preaching Uncle Bob's programming principles and people do call me crazy and nuts.
Patrick Nazar
Patrick Nazar 9 days ago
Yeah too much spent on intro, not enough spend on covering the actual material. I'm watching him drink instead of the content of the slide. I'm watching him draw on the surface but not what he's drawing. Disappointed. Enjoyed the content but ruined by that.
Bhushan Nikhar
Bhushan Nikhar 9 days ago
Thing that makes you great is bash most popular thing.
Colab User
Colab User 9 days ago
What's wrong with C++? Java runs on a billion devices (That's what the banner claims during Java RTE install), and C runs on the entire rest... an C being the forefather of C++ ... how can someone hate C++? It gives you all the freedom that Java took away. (It is always up to the programmer to not misuse that freedom right?) I remember there were C/C++ haters around 20 to 15 years ago... but now with Python being so popular the Java vs C++ hate wars should have transformed to ancient history... Well I hate Java... (Had to say that here because Uncle Bob did not ask the audience if there are any Java haters around, only C++ haters). I like that guy, uncle Bob... "Why did they put lambdas into the language". I personally stick with C++ since Stroustrup published it. And C++ back then was so clear and easy ... now with all the lambda stuff and that pumped STL, is not really necessary as one can get away without... did so for 25 years.... Damned Lambdas. Lambada was fine... Lambda is not.
Jake Stewart
Jake Stewart 9 days ago
I know this doesn't have anything to do with the video, but I would like to share these questions and this message with as many people as possible. 1. What do you think happens to someone after they die? 2. Do you think there is an afterlife? 3. If heaven exists, how do you get there? 4. Would you be good enough to get into heaven? Here are a few questions to see if you are a good person: 1. How many lies have you told in your whole life? 2. Have you ever stolen? 3. Have you ever used God's name in vain? 4. Jesus said that "whoever looks at a woman to lust for her has already committed adultery with her in his heart" (Matthew 5:28). Have you ever looked with lust? 5. If you have broken any of these commandments, would you be innocent or guilty on Judgment Day? 6. Would you go to Heaven or Hell? The Bible says that "all liars shall have their part in the lake which burns with fire and brimstone" (Revelation 21:8) and "Those who indulge in sexual sin, or who worship idols, or commit adultery, or are male prostitutes, or practice homosexuality, or are thieves, or greedy people, or drunkards, or are abusive, or cheat people - none of these will inherit the Kingdom of God" (1 Corinthians 6:9-10). So, if you are guilty of any of the ten commandments, then you are in trouble when Judgment Day comes! Do you know what God did for guilty sinners so that we wouldn't have to go to Hell? 2,000 years ago, God became a human being, Jesus of Nazareth, who suffered and died on the cross for our sins and rose from the dead on the third day, defeating death. The punishment that we deserve for breaking God's law, Jesus took in our place. He paid the fine that we could never pay so that God can legally set us free by forgiving our sins. He is just, by punishing evil through Jesus’ death on the cross, while being rich in mercy towards us. What you have to do is repent, or confess and forsake your sins, and trust alone in Jesus Christ. Don't trust your own goodness, because, as Jesus said, “No one is good - except God alone” (Mark 10:18). Trust alone in the savior. The moment you do that, God will forgive every sin you have ever committed and grant you eternal life, and He will give you a new heart with new desires, so that you will love to do what is right. You will be born again. But you must repent and trust in Jesus. When are you going to do that? Here is a short Christian movie on this subject and depression:
David Malmström
David Malmström 9 days ago
1. I think that they rot. 2. No I don’t. 3. Wormhole. 4. Depends on the criteria. Probably not. 1. Around 180 000, one a hour for 31 years, mostly to myself. 2. Yes. 3. Probably. 4. Yes. 5. I don’t think that I measure up to those standards. 6. Hell 🔥
Cedric Villani
Cedric Villani 10 days ago
Uncle who?? Lol stfu
Adam V
Adam V 10 days ago
It's a shame he's such a racist, sexist, repulsive human being.
Dazel Mann
Dazel Mann 10 days ago
"From highest level of abstraction to a dot!!!" Why the dot?? Thats rude!!! 👌👌👌👌
Karim M. Elsayad 6023
Karim M. Elsayad 6023 6 days ago
"A DAT!"
Mark Amber
Mark Amber 11 days ago
41:12 ahh yes. Let’s just keep randomly switching the camera around during this slideshow which means now you have to pause and skip around!
Sidharth Shambu
Sidharth Shambu 9 days ago
lol yeah.. i was looking at it when they suddenly switched the camera
war.on. buffets
war.on. buffets 11 days ago
background_lighting += 1
Vorticity 11 days ago
Ой сколько воды ужас и вот это рекомендуют на серьезных щах?
Alexander Yukal
Alexander Yukal 11 days ago
Nick Adams
Nick Adams 11 days ago
if only ricky bobby could have seen this. Maybe he wouldn't have wanted to go fast 11 days ago
But what does this rant have to do with clean code? Is the question I kept asking my self trough 90% of this video.
Witch Hunter
Witch Hunter 11 days ago
listening to uncle bob felt like listening to harold finch, slap a welcome to the machine on the outro and its perfect
J Simp
J Simp 12 days ago
He literally just described the past two years of my life at 27:30.
Cybertron Ex
Cybertron Ex 12 days ago
the intro made me fall asleep
KeelFly 12 days ago
When you hear this intro you understand why some programmers are so conceited. They really think they run the world :D
P s
P s 12 days ago
Intro music made me want to kill myself
Amin Ababneh
Amin Ababneh 12 days ago
Ok, my guilt for the last project that I have worked on has tripled!
Justin Lynch
Justin Lynch 12 days ago
I think the fact that many software developers call themselves engineers without a degree in engineering is poignant. That is a profession, with continuous improvement mandated, ethics, a professional body. Yet developers take the title and ignore what's behind it. That would be a good first step, or even parallel step. I find it astonishing that flight control software doesn't require a stamp to this day.
David Linder
David Linder 13 days ago
If that wasn't the cheesiest intro ever....
iknowmyname7 13 days ago
Jeez, some people in the comments have a stick up their rear end. Enjoyed the talk, thanks for the upload.
Roger Dodger
Roger Dodger 13 days ago
I agree with this presentation 100%. I never consider one of my programs finished until it flashes banner fireworks and makes disco noise for two minutes before it does anyuthing useful.
chrisksamuel 13 days ago
He is my hero! "Preach the GOSPEL!!!"
Ashley Knox
Ashley Knox 14 days ago
Shame hes a dickhead
NaN 14 days ago
LotusScript has a goto statement, fully implemented. Sadly "On error goto " cannot be used without it. It's horrible, but you have to live with what you get.
It's Me
It's Me 14 days ago
I can't tell if this is a comedian or a teacher
Mr Vic
Mr Vic 15 days ago
"if" statement fails. use more switch statements. Else is not default. By principle, coding is a language. A skill so much needed in the 21. century. If you can learn how to speak, you can learn how to code. But... Engineering principles like: math, physics, chemistry, etc., are what programmers desperately lack. Some just went and started coding apps to sell stuff or some social network bullshit that will fade away. I had a good friend who is an engineer like myself and he learned how to write some code in c. Soon he built an application for pc, and earned a title of the best programmer in this part of the world. The dude solved mapping problem of complex system of monitoring. I won't say which one, and he became the top one. He wasn't a good student. He troubled with math and all of those technical subjects but it didn't stop him from imagining. Still till today I have his scripts he wrote as the school learning material with my name on it as a co-author. I was good at those subjects and provided technical stuff, he was the one who had the vision of what it should look like.
sky 15 days ago
I see developers are complaining about the presentation length but as an engineer, I really loved the way he framed the talk from the solar system to a java function. of course, what better example than a man who calculated the sun's distance at 250 bc without any modern tools to understand our lack of creativity and patience for shitty code.
ringoaikocascade 16 days ago
Thanks for uploading but terrible edit work around 40:00. He says "right here!" and points to a line of code, at the very same moment camera spans away to the audience.
ringoaikocascade 16 days ago
it turns out it's prevalent throughout the lecture. He says "here" and "there" and the camera is focused on his face. The time given for us to read the code is dedicated to shooting him drinking water.
Deckard 5 Pegasus
Deckard 5 Pegasus 16 days ago
He has some good points, but this whole speech could have been done 20 minutes. It's an hour and half too long. He likes to hear himself.
Sam Smith
Sam Smith 17 days ago
The idea that a function should not be able to be extracted is wrong because then you loose the information about where and well it gets called. You should be using code blocks instead.
Taro 17 days ago
1:46:11 “Science is not proven correct.”
BenRangel 18 days ago
1:12:54 it’s not hard to see what a bool does as a function argument! Just peek at the function definition - if you have a proper name for the bool it should be clear as daylight! Having 2 separate functions instead of a bool can lead to convoluted naming as you need both DoStuffWithX and DoStuffWithoutX instead of just DoStuff(bool x). Also consider that you can use default parameters in many languages.
Texas75023 18 days ago
Those Volkswagon SW Developers should not have been prosecuted. They were only "Teaching To The Test" which is the way ALL American Education operates.
Carey A
Carey A 19 days ago
The intro was ridiculous. I thought I’d clicked on the keynote of a used car sales conference.
Blind Bob
Blind Bob 19 days ago
Clearly that guy 2,500 years ago had a lot of spare time on his hands.....
Julian Sloman
Julian Sloman 19 days ago
That was really good, but didn't learn whether the water was in fact working.
ringoaikocascade 16 days ago
It's one of those "it makes you wonder, doesn't it?" kind of works.
Amir Mohammad Jalili
Amir Mohammad Jalili 19 days ago
He talks and somehow the image of late George Carlin comes to me:))
Carl Payne
Carl Payne 12 days ago
Yes! A mix of Carlin and Lewis Black.
Patrick Gold
Patrick Gold 20 days ago
Very nice video. Except for the fact that you are filming him when he is drawing, instead of the screen.
Tomás Ortí
Tomás Ortí 20 days ago
I used to buy Uncle Bob books. Now I watch these types of videos: Uncle Bob bases his business on books, chats and knowing many people suck at programming, not because his techniques are that great. They are applicable when software technologies and software engineers suck. Sad.
Lucas Gabriel Sánchez
Lucas Gabriel Sánchez 20 days ago
Uncle Bob talks are awesome. But please, rename this videos to tell that this is "Clean Code for Java/C#", not everything he said is applicable in other languages
mniOK 20 days ago
Levels of experience: junior, mid, senior, uncle.
T F 20 days ago
This is the worst intro ever.
Дмитро Шум
Дмитро Шум 21 day ago
I think the most important thing in this video is at 34:42