SlideShare una empresa de Scribd logo
1 de 68
Descargar para leer sin conexión
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Creating Code
30%
Maintaining
Code
70%
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Writing Code
10%
Reading
Code…
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Describe the entity it
represents
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Describe the entity it
represents
Easy to understand and read
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Describe the entity it
represents
Easy to understand and
read
Be specific as possible
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Bad Names
total, ct, checks, CHKTTL
velt, tv, train
cd, current, c, date
lpp, lines
Good Names
runningTotal, checkTotal
trainVelocity, velocityInMph
currentDate, todaysDate
linesPerPage
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Don’t use magic numbers
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Don’t use magic numbers
Instead use constants, enums or config
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Don’t use magic numbers
Instead use constants, enums, or config
Makes code more readable / self
documenting
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Duplication leads to maintenance issues
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Duplication leads to maintenance issues
Y2K Culprit?
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Duplication leads to maintenance issues
Y2K Culprit?
“Every piece of knowledge must have a single,
unambiguous, authoritative representation
within a system”
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Each responsibility is an axis
of change
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Each responsibility is an axis
of change
Change is going to happen
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Each responsibility is an axis
of change
Change is going to happen
Loose Coupling
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Legacy Code = Code without
Tests
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Legacy Code = Code without
Tests
Great Step-by-step guide
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Legacy Code = Code without
Tests
Great Step-by-step guide
Write unit tests as you use
legacy code
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Author + 2 Reviewers
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Author + 2 Reviewers
Using “peer pressure”
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Author + 2 Reviewers
Using “peer pressure”
Encourages collaboration
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Keep a positive attitude
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Keep a positive attitude
Check your ego
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Keep a positive attitude
Check your ego
Review all code
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Keep a positive attitude
Check your ego
Review all code
Code Review early and often
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Don’t use magic numbers
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Don’t use magic numbers
Keep your code DRY
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Write Unit Tests
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Write Unit Tests
Have regular Code Reviews
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
http://lunamark.com
http://bit.ly/ttf2016-wcfy
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
The Mythical Man Month by Frederick P. Brooks Jr
(http://www.amazon.com/The-Mythical-Man-Month-Engineering-
Anniversary/dp/0201835959)
Code Complete by Steve McConnell
(http://www.amazon.com/Code-Complete-Practical-Handbook-
Construction/dp/0735619670)
Clean Code by Robert C. Martin (http://www.amazon.com/Clean-
Code-Handbook-Software-Craftsmanship/dp/0132350882)
Working Effectively with Legacy Code by Michael Feathers
(http://www.amazon.com/Working-Effectively-Legacy-Michael-
Feathers/dp/0131177052)
FogCreek Software Blog
Effective Code Reviews - 9 Tips from a Converted Skeptic
(http://blog.fogcreek.com/effective-code-reviews-9-tips-from-a-
converted-skeptic/)
Stop More Bugs with our Code Review Checklist
(http://blog.fogcreek.com/increase-defect-detection-with-our-code-
review-checklist-example/)

Más contenido relacionado

Destacado

Spolni paradoks i pljacka
Spolni paradoks i pljackaSpolni paradoks i pljacka
Spolni paradoks i pljackaJRadojcic
 
Kako spasiti hrvatsku
Kako spasiti hrvatskuKako spasiti hrvatsku
Kako spasiti hrvatskuJRadojcic
 
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세Hyeonmin Park
 
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ Angie's List AP Chemistry and Physics Tutor Plainsboro NJ
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ Derek Benson
 
Expansión - Evita que tu cartera se arruine por los prejuicios profesionales
Expansión - Evita que tu cartera se arruine por los prejuicios profesionalesExpansión - Evita que tu cartera se arruine por los prejuicios profesionales
Expansión - Evita que tu cartera se arruine por los prejuicios profesionalesEAE Business School
 
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...EAE Business School
 
Why 1 is One, 2 is Two, 3 is Three?
Why 1 is One, 2 is Two, 3 is Three?Why 1 is One, 2 is Two, 3 is Three?
Why 1 is One, 2 is Two, 3 is Three?Rakesh Kumar
 
2. diagram. electricity & magnetism.
2.  diagram. electricity & magnetism.2.  diagram. electricity & magnetism.
2. diagram. electricity & magnetism.pablojgd
 
Unit 2. vertebrates and invertebrates animals
Unit 2. vertebrates and invertebrates animalsUnit 2. vertebrates and invertebrates animals
Unit 2. vertebrates and invertebrates animalsisapla37
 

Destacado (10)

Spolni paradoks i pljacka
Spolni paradoks i pljackaSpolni paradoks i pljacka
Spolni paradoks i pljacka
 
Kako spasiti hrvatsku
Kako spasiti hrvatskuKako spasiti hrvatsku
Kako spasiti hrvatsku
 
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세
[16.05.09] 동성애에 대한 인식과 우리의 바람직한 자세
 
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ Angie's List AP Chemistry and Physics Tutor Plainsboro NJ
Angie's List AP Chemistry and Physics Tutor Plainsboro NJ
 
Expansión - Evita que tu cartera se arruine por los prejuicios profesionales
Expansión - Evita que tu cartera se arruine por los prejuicios profesionalesExpansión - Evita que tu cartera se arruine por los prejuicios profesionales
Expansión - Evita que tu cartera se arruine por los prejuicios profesionales
 
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...
Murcia es la comunidad que más aumentó su deuda durante el pasado año. Estudi...
 
Why 1 is One, 2 is Two, 3 is Three?
Why 1 is One, 2 is Two, 3 is Three?Why 1 is One, 2 is Two, 3 is Three?
Why 1 is One, 2 is Two, 3 is Three?
 
2. diagram. electricity & magnetism.
2.  diagram. electricity & magnetism.2.  diagram. electricity & magnetism.
2. diagram. electricity & magnetism.
 
Sams 21st
Sams 21stSams 21st
Sams 21st
 
Unit 2. vertebrates and invertebrates animals
Unit 2. vertebrates and invertebrates animalsUnit 2. vertebrates and invertebrates animals
Unit 2. vertebrates and invertebrates animals
 

Más de Paul Gower

Be a Better Remote Agile Team Member
Be a Better Remote Agile Team MemberBe a Better Remote Agile Team Member
Be a Better Remote Agile Team MemberPaul Gower
 
Overcoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityOvercoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityPaul Gower
 
Codestock 2019 - Build a successful remote agile team in three easy steps!
Codestock 2019 - Build a successful remote agile team in three easy steps!Codestock 2019 - Build a successful remote agile team in three easy steps!
Codestock 2019 - Build a successful remote agile team in three easy steps!Paul Gower
 
WeRockIT 2019 - Build a successful remote agile team in three easy steps!
WeRockIT 2019 - Build a successful remote agile team in three easy steps!WeRockIT 2019 - Build a successful remote agile team in three easy steps!
WeRockIT 2019 - Build a successful remote agile team in three easy steps!Paul Gower
 
Overcoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityOvercoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityPaul Gower
 
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018Paul Gower
 
Unit Testing in Umbraco
Unit Testing in UmbracoUnit Testing in Umbraco
Unit Testing in UmbracoPaul Gower
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
Code Review: How And When
Code Review: How And WhenCode Review: How And When
Code Review: How And WhenPaul Gower
 
Code Review: How and When - Tulsa TechFest 2016
Code Review: How and When - Tulsa TechFest 2016Code Review: How and When - Tulsa TechFest 2016
Code Review: How and When - Tulsa TechFest 2016Paul Gower
 
How and When To Code Review
How and When To Code ReviewHow and When To Code Review
How and When To Code ReviewPaul Gower
 
Write Code For The Future You - LR Tech Fest
Write Code For The Future You - LR Tech FestWrite Code For The Future You - LR Tech Fest
Write Code For The Future You - LR Tech FestPaul Gower
 
Windows 8 and Phone App Development
Windows 8 and Phone App DevelopmentWindows 8 and Phone App Development
Windows 8 and Phone App DevelopmentPaul Gower
 

Más de Paul Gower (15)

Be a Better Remote Agile Team Member
Be a Better Remote Agile Team MemberBe a Better Remote Agile Team Member
Be a Better Remote Agile Team Member
 
Overcoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityOvercoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase Productivity
 
Codestock 2019 - Build a successful remote agile team in three easy steps!
Codestock 2019 - Build a successful remote agile team in three easy steps!Codestock 2019 - Build a successful remote agile team in three easy steps!
Codestock 2019 - Build a successful remote agile team in three easy steps!
 
WeRockIT 2019 - Build a successful remote agile team in three easy steps!
WeRockIT 2019 - Build a successful remote agile team in three easy steps!WeRockIT 2019 - Build a successful remote agile team in three easy steps!
WeRockIT 2019 - Build a successful remote agile team in three easy steps!
 
Overcoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase ProductivityOvercoming Delay: How The Best Developers Increase Productivity
Overcoming Delay: How The Best Developers Increase Productivity
 
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018
Rub Some DevOps on your NodeJS app in Azure - ScenicCitySummit 2018
 
Unit Testing in Umbraco
Unit Testing in UmbracoUnit Testing in Umbraco
Unit Testing in Umbraco
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Code Review: How And When
Code Review: How And WhenCode Review: How And When
Code Review: How And When
 
Code Review: How and When - Tulsa TechFest 2016
Code Review: How and When - Tulsa TechFest 2016Code Review: How and When - Tulsa TechFest 2016
Code Review: How and When - Tulsa TechFest 2016
 
How and When To Code Review
How and When To Code ReviewHow and When To Code Review
How and When To Code Review
 
Write Code For The Future You - LR Tech Fest
Write Code For The Future You - LR Tech FestWrite Code For The Future You - LR Tech Fest
Write Code For The Future You - LR Tech Fest
 
Windows 8 and Phone App Development
Windows 8 and Phone App DevelopmentWindows 8 and Phone App Development
Windows 8 and Phone App Development
 
Code Kata
Code KataCode Kata
Code Kata
 

Último

UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 

Último (20)

20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 

Write Code For The Future You - Tulsa TechFest 2016

  • 1. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 2. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 3. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 4. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 5. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 6. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 7. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 8. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 9. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 10. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 11. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 12. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 13. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 14. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 15. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 16. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Creating Code 30% Maintaining Code 70%
  • 17. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 18. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Writing Code 10% Reading Code…
  • 19. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 20. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 21. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 22. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 23. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 24. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 25. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 26. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 27. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 28. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 29. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Describe the entity it represents
  • 30. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Describe the entity it represents Easy to understand and read
  • 31. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Describe the entity it represents Easy to understand and read Be specific as possible
  • 32. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Bad Names total, ct, checks, CHKTTL velt, tv, train cd, current, c, date lpp, lines Good Names runningTotal, checkTotal trainVelocity, velocityInMph currentDate, todaysDate linesPerPage
  • 33. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 34. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Don’t use magic numbers
  • 35. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Don’t use magic numbers Instead use constants, enums or config
  • 36. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Don’t use magic numbers Instead use constants, enums, or config Makes code more readable / self documenting
  • 37. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 38. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 39. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 40. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Duplication leads to maintenance issues
  • 41. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Duplication leads to maintenance issues Y2K Culprit?
  • 42. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Duplication leads to maintenance issues Y2K Culprit? “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”
  • 43. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 44. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Each responsibility is an axis of change
  • 45. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Each responsibility is an axis of change Change is going to happen
  • 46. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Each responsibility is an axis of change Change is going to happen Loose Coupling
  • 47. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 48. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 49. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 50. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Legacy Code = Code without Tests
  • 51. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Legacy Code = Code without Tests Great Step-by-step guide
  • 52. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Legacy Code = Code without Tests Great Step-by-step guide Write unit tests as you use legacy code
  • 53. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Author + 2 Reviewers
  • 54. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Author + 2 Reviewers Using “peer pressure”
  • 55. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Author + 2 Reviewers Using “peer pressure” Encourages collaboration
  • 56. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Keep a positive attitude
  • 57. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Keep a positive attitude Check your ego
  • 58. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Keep a positive attitude Check your ego Review all code
  • 59. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Keep a positive attitude Check your ego Review all code Code Review early and often
  • 60. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 61. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names
  • 62. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names Don’t use magic numbers
  • 63. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names Don’t use magic numbers Keep your code DRY
  • 64. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing
  • 65. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing Write Unit Tests
  • 66. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing Write Unit Tests Have regular Code Reviews
  • 67. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! http://lunamark.com http://bit.ly/ttf2016-wcfy
  • 68. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! The Mythical Man Month by Frederick P. Brooks Jr (http://www.amazon.com/The-Mythical-Man-Month-Engineering- Anniversary/dp/0201835959) Code Complete by Steve McConnell (http://www.amazon.com/Code-Complete-Practical-Handbook- Construction/dp/0735619670) Clean Code by Robert C. Martin (http://www.amazon.com/Clean- Code-Handbook-Software-Craftsmanship/dp/0132350882) Working Effectively with Legacy Code by Michael Feathers (http://www.amazon.com/Working-Effectively-Legacy-Michael- Feathers/dp/0131177052) FogCreek Software Blog Effective Code Reviews - 9 Tips from a Converted Skeptic (http://blog.fogcreek.com/effective-code-reviews-9-tips-from-a- converted-skeptic/) Stop More Bugs with our Code Review Checklist (http://blog.fogcreek.com/increase-defect-detection-with-our-code- review-checklist-example/)

Notas del editor

  1. First I want to tell you a little bit about my background and help you understand where I have come from and why I am excited to share with you today some of my thoughts around writing better code for your future self (or someone else). I want you to understand that I hope this talk, like my other one if you attended it earlier today, is more about starting the conversation (and I hope to give you some good tips along the way). But know that I enjoy not only discussing this topic of clean code or writing better code but I solicit your feedback or tips you might have as well. So please reach out to me on twitter to continue this discussion as we learn how to improve how we write code.
  2. First internship my junior year in college over the summer of 2000. I wrote a lot of perl script. I had never really written anything except C++ and some assembler up until this point. It was an interesting experience because it was my first intro to a language that had so many different ways to program a solution.
  3. Anyone here heard of this contest? Annual competition between 1996 and 2000 Entries were judged on incomprehensibility among other things They even had an annual contest for a few years to see how obfuscated you could write your code. I'm sure many of you who are older than me remember a similar contest around writing obfuscated c code back in the day.
  4. It was consider a badge of honor if you could write code in a way to “stump” a programmer who might not know perl very well. Or code that only they could figure out… We are not built to be human compilers. Let the computer do that.
  5. After that internship I finished college and took a job that changed the trajectory of my career for the better.
  6. My first job right out of college was working for a big company called Alltel Information Services. Originally was a company called Systematics that was bought by Alltel and renamed to Alltel Information Services
  7. They started us in a 6 month training program they called Alltel Client-Server University. They wanted to train new employees in the way that they developed their software. Since it was banking software it was very complex and it was really bad if you introduced a bug and ended up losing someone’s money. People don’t like it when you lose their money.
  8. My first job out of college was at Alltel Information Services (sub of Alltel) A great learning experience because of the 6 month training course they did for new hires to train us to work on the complex systems they have developed. Alltel University - Instructor lecture time - lab time - code review every day Changed the trajectory of my career to be more aware of writing better readable code and less "elite code" Anyone to be able to understand my code
  9. I eventually changed jobs a couple of times and started working for a consulting company. After working for them for a few years, I was added to “that project”. You know the one that was starting to slip on some of their milestone dates and it was looking like the delivery date was going to slip as well. And you guessed it the project manager thought it would be a great idea to just add more people to the project to “Save” it from being late.
  10. On paper it looked like a good idea to the project manager to add me to the project. It appeared that I would be able to help them complete the project on time and become the “hero” for that project. Well I started on the project and ran into a really hard to find bug. It was even harder to find because it was in code I couldn’t easily understand. It was written in a way that was really hard to follow the logic of the program, etc.
  11. Has anyone in here had to find a bug in some code that was hard to understand? (it could be code that you had written a few months ago even) I wanted to rewrite the code instead of trying to fix the bug because it seemed like it would be easier. Can anyone relate to that? (pause) Well I eventually found the bug but the project wasn’t early or even on time due to not only this bug but also do to another thing I had learned in the Alltel Client/Server University but hadn’t seen in the real world until this project. It’s called the…
  12. Has anyone in here read this book or at least know the concept behind the book? Okay there are some that don’t so I’ll give you the simplest example I know even though it’s a bit contrived: The idea is you can’t always add more developers to a project to make the project finish faster. The analogy I like is: Can 9 women have a baby on 1 month rather than 9 months? Of course not that’s absurd! Well in the same light not all projects can be easily split into parts that are easily developed simultaneously. Sometimes it is just adding fuel to the fire rather than putting the fire out!
  13. So many developers enjoy writing new programs or starting from scratch we sometimes forget why we should care about Maintenance of our code. Who can tell us the percentage breakdown of time we spend as developers creating versus maintaining code? Barry Boehm - Software Engineering Economics, Prentice Hall Schach, R., Software Engineering, Fourth Edition, McGraw-Hill Glass, Robert, Frequently Forgotten Fundamental Facts about Software Engineering
  14. Who can tell us the percentage breakdown of time we spend as developers creating versus maintaining code? Barry Boehm - Software Engineering Economics, Prentice Hall Schach, R., Software Engineering, Fourth Edition, McGraw-Hill Glass, Robert, Frequently Forgotten Fundamental Facts about Software Engineering
  15. Who can tell me how much of our time do we spend as developers reading code vs writing code? Clean Code book
  16. Who can tell me how much of our time do we spend as developers reading code vs writing code? Clean Code book
  17. Before giving you one of my favorite quotes around why you should care who the reader of your code is, I want to give you some interesting history behind where the quote came from.
  18. It all started in a Comp.lang.c++ newsgroup discussion back in 1991.
  19. Someone asked the newsgroup why people don’t use the comma operator more often in C++. Does anyone know what the comma operator is used for in C++?
  20. Here’s an example of using the comma operator where you will notice that both variable assignments would take place on the same line of code. Therefore both assignments would happen if the if expression resulted in TRUE But what if a more junior developer came behind you and didn’t understand the comma operator so they decided to change it to a semicolon because they just assumed you meant to use a semicolon instead of a comma.
  21. I mean in reality it’s just a simple dot that is changing here, right? It’s one character changing what harm could it cause? One little dot is changed to the viewer but the meaning of the 2nd example of code is very different. In other words the comma operator can make the code harder to read. Just one dot made the anothervar = anothervalue; execute. So from this discussion is where the first time I heard one of my favorite quotes:
  22. This quote comes from a post John F. Woods authored back in 1991 to the comp.lang.c++ news group.
  23. I want to go over some tips that I find to be helpful when writing code for my future self and I hope they will help you today. Also this is a journey and I don’t know it all and this is not an exaustive list these are just some that I think will help you start writing better code for your future self. But before we get started I want to give a quick review of some of the history behind this “Clean Code” / “Better Code” / “Code Complete” movement. It obviously started for me when I went through Alltel Client/Server University but this movement has been around for a while. Here are a list of some things that I think impacted my view of how to write better code:
  24. Writing better code is an iterative process and we are still learning how best to do it today. 1993 Code Complete 1st edition 2004 Code Complete 2nd edition I have already discussed the impact this book has had (along with the 6 month training I received right out of college) so I won’t talk about it much more…other than to say if you haven’t read it I highly recommend it! I love Steve’s approach and how he backs everything with data and statistics...which I will show you some of them later in this presentation.
  25. This was a milestone to me as well. I learned a lot from the iterative approach to writing software the agile way. It also reminds me that even in my “writing better code” approach I need to be open to change and not fight against it. It helps me remember that the end goal is to make the best process we can use to write better code and that ‘my way’ could be improved upon as we learn more. I am a big fan of keeping the feedback loop as tight as possible so we are delivering exactly what our clients need us to deliver. I could talk a lot longer about this but we need to keep moving.
  26. Uncle Bob has written a few books on writing “Clean Code” or “Clean Coder”. He is also another “great leader” in the movement of writing “better” or “clean code”. Now I want to discuss a few tips (6 to be exact) on how you can start writing better code today. Speaking of one of my favorite books this first tip comes from Code Complete.
  27. Tips for writing better code that is easier to maintain. The most important consideration in naming a variable is that the name fully and accurately describe the entity the variable represents. An effective technique for coming up with a good name is to state in words what the variable represents.
  28. You want your variables easy to read and understand. Again we don’t need to compile code in our head we should be able to read it like prose.
  29. The more specific you can be the easier it will be to understand what the variable represents when you look at it 3-6 months from now. Here are some examples of both bad names and good names.
  30. Running total of checks written to date Velocity of a bullet train Current Date Lines per page Now on to our next tip…Magic Numbers
  31. Who knows what I mean when I say: “Magic Number”? Ok, good. Well some don’t so let me explain. It’s where you use a specific number in an expression in your code rather than a variable or constant value.
  32. Rule #1: Just don’t use them!
  33. Instead of commenting around the magic number use a constant, enum or some configuration file or setting in your program
  34. Having a constant or some variable (if named properly like we discussed already) can make the code easier to read. For example, something like “MAX_LENGTH_OF_PASSWORD” than a number 8.
  35. Tips for writing better code that is easier to maintain. The most important consideration in naming a variable is that the name fully and accurately describe the entity the variable represents. An effective technique for coming up with a good name is to state in words what the variable represents.
  36. Tips for writing better code that is easier to maintain. The most important consideration in naming a variable is that the name fully and accurately describe the entity the variable represents. An effective technique for coming up with a good name is to state in words what the variable represents. Now on to our next tip…D.R.Y.
  37. Duplication (inadvertent or purposful duplication) can lead to maintenance nightmares, poor factoring, and logical contradictions. One could argue that most of the diffculty in Y2K remediation is due to the lack of a single date abstraction within any given system. DRY is more than not duplicating code. Dave Thomas interview: DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation. Given all this knowledge, why should you find one way to represent each feature? The obvious answer is, if you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. DRY is important if you want flexible and maintainable software.
  38. Duplication (inadvertent or purposeful duplication) can lead to maintenance nightmares, poor factoring, and logical contradictions.
  39. One could argue that most of the difficulty in Y2K remediation is due to the lack of a single date abstraction within any given system. They had multiple representations of the “DATE” class in their programs and due to this technical debt when the 2-digit year became an issue it wasn’t as simple as changing the code in one place.
  40. Dave Thomas interview: DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation. Given all this knowledge, why should you find one way to represent each feature? The obvious answer is, if you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. DRY is important if you want flexible and maintainable software.
  41. Here are some tips to help us write clean code. Classes – should have a single responsibility This is the S in the SOLID principles you may have heard of before. If not I recommend you go google SOLID principles and read about them be
  42. Why is it important to separate responsibilities among classes and or methods in programming? In Uncle Bob’s book “Clean Code” he says “Because each responsibility is an axis of change.”
  43. You are going to miss something. Requirement, or bug in your code…or even a new feature is going to be added to the program at some point. Change usually happens in responsibility or axis
  44. Loose Coupling – Classes should not have direct knowledge of each other. This helps with being able to change as little code as possible when a change does need to happen. Here is an example albeit contrived but it still drives home the point.
  45. Rectangle class has 2 methods which are 2 different responsibilities. Provide mathematical model of the geometry of the rectangle Render the rectangle on a graphical user interface 2 applications use the rectangle class If area method changes then both applications have to recompile.
  46. Single Responsibility Pattern – S in SOLID principals See how we split the rectangle’s responsibilities into 2 Now if Area method changes just the geometric rectangle changes.
  47. Tips for writing clean code or easier to maintain code. What is legacy code you might ask? One of the best definitions I have found that describes Legacy code is…Code w/out tests
  48. The average software project was written under some aspect of code-and-fix without automated unit tests. And we can’t just throw this code away. In “Working Effectively with Legacy Code” Michael Feathers provides step-by-step instructions on how to deal with code to get it better with unit tests. He provides specific advice for several situations and rules that help you recognize Next time you use a method you will want to write a unit test for it.
  49. In “Working Effectively with Legacy Code” Michael Feathers provides step-by-step instructions on how to deal with code to get it better with unit tests. He provides specific advice for several situations and rules that help you recognize Next time you use a method you will want to write a unit test for it.
  50. Next time you use some legacy code why not try and write a unit test to test the code you just wrote or changed in a legacy method? What harm could it do?
  51. Tips for writing clean code or easier to maintain code. Should involve programmer and at least 2 reviewers. This means there are at least 3 people reading your code. Use “peer pressure” to your advantage (or motivation for you if you’re the programmer).
  52. Tips for writing clean code or easier to maintain code. Should involve programmer and at least 2 reviewers. This means there are at least 3 people reading your code. Use “peer pressure” to your advantage (or motivation for you if you’re the programmer).
  53. Tips for writing clean code or easier to maintain code. Should involve programmer and at least 2 reviewers. This means there are at least 3 people reading your code. Use “peer pressure” to your advantage (or motivation for you if you’re the programmer).
  54. We as developers are really good at finding issues or being critical; however, remember just because someone didn’t do something how you would have done it doesn’t necessarily mean it is wrong.
  55. Both for the reviewer and the submitter it is good to check your ego at the door. Code review is not the time to show your amazing coding prowess nor is it a time to get defensive.
  56. No code is too short or too simple to review. It builds a habit of always reviewing code
  57. The effectiveness of your reviews decreases after an hour so don’t put off code reviews. It’s good to set aside time during the day to coincide with breaks so you don’t disrupt your own flow.
  58. We discussed 6 main tips that I want to go over quickly again… Name variables better. They need to describe the entity it represents and be easy to understand and readable.
  59. Name variables better. They need to describe the entity it represents and be easy to understand and readable. Ban magic numbers
  60. Ban magic numbers 1 logical representation of each concept in your code along side not repeating code when possible.
  61. 1 logical representation of each concept in your code along side not repeating code when possible. Methods should do one thing and one thing well. Each responsibility is an axis of change
  62. Methods should do one thing and one thing well. Each responsibility is an axis of change Stop writing legacy code and start writing unit tests
  63. Stop writing legacy code and start writing unit tests Have regular code reviews with at least 2 reviewers and the programmer should be present
  64. Have regular code reviews with at least 2 reviewers and the author
  65. Questions? Comments?