Software Craftsmanship for New Developers
Tech Foundations Louisville January 22, 2019
Software Craftsmanship for New Developers Tech Foundations - - PowerPoint PPT Presentation
Software Craftsmanship for New Developers Tech Foundations Louisville January 22, 2019 Who is Chad Green? Data & Solutions Architect at ProgressiveHealth Community Involvement Code PaLOUsa Conference Chair Louisville .NET Meetup
Software Craftsmanship for New Developers
Tech Foundations Louisville January 22, 2019
Data & Solutions Architect at ProgressiveHealth Community Involvement Code PaLOUsa Conference Chair Louisville .NET Meetup Organizer Louisville Tech Leaders Meetup Organizer Louisville Tech Ladies Co-Organizer Contact Information chadgreen@chadgreen.com chadgreen.com @ChadGreen ChadwickEGreen
Who is Chad Green?
What is Software Craftsmanship
Software Craftsmanship for New Developers
Software Craftsmanship for Non Developers
What Software Craftsmanship is not
page 04
Software Craftsmanship for Non Developers
What is Software Craftsmanship
page 05
mathematical rigor of a scientific approach with computational theory
precision, predictability, measurement, risk mitigation, and professionalism
Software Craftsmanship for Non Developers
Craft, Trade, Engineering, Science, or Art
page 06
evidence to the innovation, design, construction, operation, and maintenance of structures, machines, materials, devices, systems, processes, and organizations
testable explanations and predictions about the universe
artifacts, expressing the author’s imaginative, conceptual idea, or technical skill, intended to be appreciated for their beauty or emotional power
Software Craftsmanship for Non Developers
What is Software Craftsmanship
page 07
Agile Manifesto question some these assumptions
Individuals and interactions over processes and tools
Software Craftsmanship is about professionalism in software development.
Software Craftsmanship for Non Developers
Software Craftsmanship History
page 09
Craftsmanship over Crap
Craftsmanship
Professional Programmers
Software Craftsmanship for Non Developers
Manifesto for Software Craftsmanship
page 010
Not only working software, but also well-crafted software Not only responding to change, but also steadily adding value Not only individuals and interactions, but also a community of professionals Not only customer collaboration, but also productive partnerships
Software Craftsmanship for Non Developers
Manifesto for Software Craftsmanship
page 011
Not only working software, but also well-crafted software
Software Craftsmanship for Non Developers
Manifesto for Software Craftsmanship
page 012
Not only responding to change, but also steadily adding value
Try and leave this world a little better than you found it, and when you turn comes to die you can die happy in feeling that at any rate you have not wasted your time but have done your best. Robert Stephenson Smyth Bader-Powell, founder of The Scout Association
Software Craftsmanship for Non Developers
Manifesto for Software Craftsmanship
page 014
Not only individuals and interactions, but also a community of professionals
Software Craftsmanship for Non Developers
Manifesto for Software Craftsmanship
page 015
Not only customer collaboration, but also productive partnerships
Technical Debt
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
What is Technical Debt
page 017
an easy solution now instead of using a better approach that would take longer
can accumulate interest, making it hard to implement changes later
Software Craftsmanship for Non Developers
Example of Technical Debt
page 018
everyone can do everything
and then another and another
but really need another permission change in a couple of days
Software Craftsmanship for Non Developers
Common Causes of Technical Debt
page 019
changes
SOLID Principles
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
S.O.L.I.D.
page 021
Software Craftsmanship for Non Developers
Single Responsibility Principle (SRP)
page 022
Software Craftsmanship for Non Developers
Single Responsibility Principle (SRP)
page 023
CFO COO CTO Employee
+ Caculate Pay + ReportHours + SaveClass violates the SRB because the three methods are responsible to different actors
accounting department, which reports to the CFO
the human resources department, which reports to the COO
administrators, who report to the CTO
Software Craftsmanship for Non Developers
Open-Closed Principle (OCP)
page 024
modification
Software Craftsmanship for Non Developers
Liskov Substitution Principle (LSP)
page 025
q(y) should be provable for objects y of type y where S is a subtype
base/parent class
Billing License
+ CalculateFee()
Personal License
+ CalculateFee()
Business License
+ CalculateFee()
Software Craftsmanship for Non Developers
Interface Segregation Principle (ISP)
page 026
does not use or clients should not be forced to depend on methods they do not use
Software Craftsmanship for Non Developers
Dependency Inversion Principle (DIP)
page 027
that the high level module must not depend on the low level module, but they should depend on abstractions.
Other Key Principles
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
DRY – Don’t Repeat Yourself
page 029
authoritative representation within a system
when you will forget
If you write it once, think about encapsulating it. If you write it twice, you have to encapsulate it. If you write it three times, programming isn’t for you. Phil Japikse, Microsoft MVP, ASPInsider, MCSD, MCDBA, PSM II, PSD, CSM, Consultant, Coach, Author, Trainer
Software Craftsmanship for Non Developers
KISS – Keep it Simple Stupid
page 031
Software Craftsmanship for Non Developers
YAGNI – You Aren’t Going to Need It
page 032
you just foresee that you need them
possibly work”
Key Practices
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
TDD – Test Driven Development
page 034
short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests,
have first written a failing unit test.
sufficient to fail – and not compiling is failing
sufficient to pass the currently failing unit test
Software Craftsmanship for Non Developers
Pair Programming
page 035
workstation
code as it is typed
Software Craftsmanship for Non Developers
Practicing – Coding Katas
page 036
Code Smells
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
Code Smells - Comments
page 038
Software Craftsmanship for Non Developers
Code Smells - Comments
page 039
Software Craftsmanship for Non Developers
Code Smells - Comments
page 040
Software Craftsmanship for Non Developers
Code Smells - Comments
page 041
Software Craftsmanship for Non Developers
Code Smells - Comments
page 042
Software Craftsmanship for Non Developers
Code Smells - Environment
page 043
Software Craftsmanship for Non Developers
Code Smells - Environment
page 044
Software Craftsmanship for Non Developers
Code Smells - Functions
page 045
Software Craftsmanship for Non Developers
Code Smells - General
page 046
Software Craftsmanship for Non Developers
Code Smells - General
page 047
Software Craftsmanship for Non Developers
Code Smells - General
page 048
Software Craftsmanship for Non Developers
Code Smells - General
page 049
Software Craftsmanship for Non Developers
Code Smells - General
page 050
Software Craftsmanship for Non Developers
Code Smells - General
page 051
Software Craftsmanship for Non Developers
Code Smells - General
page 052
Software Craftsmanship for Non Developers
Code Smells - General
page 053
Software Craftsmanship for Non Developers
Code Smells - General
page 054
DateTime newDate = date.add(5) DateTime newDate = date.AddDays(5)
Software Craftsmanship for Non Developers
Code Smells - General
page 055
Software Craftsmanship for Non Developers
Code Smells - General
page 056
3.141592653589793 3.141592753589793 3.141592753589793
Software Craftsmanship for Non Developers
Code Smells - General
page 057
Software Craftsmanship for Non Developers
Code Smells - Names
page 058
Software Craftsmanship for Non Developers
Code Smells – Names: Choose Descriptive Names
page 059
CREATE PROCEDURE dbo.HII_Mobile_Cond_Workout_Activities_Log_View @ID INT = 0, @cond_workout_ID INT = 0 AS BEGIN SELECT al.ID, al.cond_workout_ID, al.activity, al.mins, al.cal_burn, a.Category, ai.ID AS intensity_id, ai.Intensity FROM HII_Mobile_Cond_Workout_Activities_Log al INNER JOIN HII_Cond_Activities a ON a.ID = al.activity LEFT JOIN HII_Cond_Activities_Intensity ai ON ai.Activity_ID = a.ID AND ai.ID=al.intensity WHERE al.active=1 AND (cond_workout_ID = @cond_workout_ID OR al.Id = @ID) ORDER BY al.created_date END CREATE PROCEDURE dbo.HII_Mobile_Cond_Workout_Activities_Log_View @ID INT = 0, @cond_workout_ID INT = 0 AS BEGIN SELECT al.ID, al.cond_workout_ID, al.activity, al.mins, al.cal_burn, a.Category, ai.ID AS intensity_id, ai.Intensity FROM HII_Mobile_Cond_Workout_Activities_Log al INNER JOIN HII_Cond_Activities a ON a.ID = al.activity LEFT JOIN HII_Cond_Activities_Intensity ai ON ai.Activity_ID = a.ID AND ai.ID=al.intensity WHERE al.active=1 AND (cond_workout_ID = @cond_workout_ID OR al.Id = @ID) ORDER BY al.created_date END CREATE PROCEDURE dbo.GetWorkActivitiesLog @Id INT = 0, @WorkoutId INT = 0 AS BEGIN SELECT ActivityLog.ID, ActivityLog.cond_workout_ID, ActivityLog.activity, ActivityLog.mins, ActivityLog.cal_burn, Activities.Category, Intensity.ID AS intensity_id, Intensity.Intensity FROM HII_Mobile_Cond_Workout_Activities_Log AS ActivityLog INNER JOIN HII_Cond_Activities AS Activities ON a.ID = ActivityLog.activity LEFT JOIN HII_Cond_Activities_Intensity Intensity ON Intensity.Activity_ID = a.ID AND ai.ID=ActivityLog.intensity WHERE ActivityLog.active=1 AND (ActivityLog.cond_workout_ID = @WorkoutId OR ActivtyLog.Id = @ID) ORDER BY ActivityLog.created_date END
Software Craftsmanship for Non Developers
Code Smells - Names
page 060
intRepeat repeatCount
Software Craftsmanship for Non Developers
Code Smells - Names
page 061
public void GetFoo() { } public void CreateAndGetFoo() { }
Software Craftsmanship for Non Developers
Code Smells - Tests
page 062
Software Craftsmanship for Non Developers
Code Smells - Tests
page 063
Software Craftsmanship for Non Developers
Code Smells - Tests
page 064
Software Craftsmanship for Non Developers
Code Smells - Tests
page 065
Software Craftsmanship for Non Developers
Code Smells - Tests
page 066
Software Craftsmanship for Non Developers
Code Smells - Tests
page 067
Getting More
Software Craftsmanship for Non-Developers
Software Craftsmanship for Non Developers
Getting More – Books
page 069
Software Craftsmanship for Non Developers
Getting More – Podcasts
page 070
Software Craftsmanship for Non Developers
Getting More – Meetups
page 071
Tech Foundations Louisville Louisville Tech Ladies Deep Learning and AI For Louisville Derby DevOps Louisville Business Intelligence & Big Data Analytics Meetup Louisville Jenkins Area Meetup Louisville Microsoft Azure User Group Louisville Ruby Brigade Louisville Open Source Programming Meetup Group
Software Craftsmanship for Non Developers
Getting More – Conferences
page 072
Software Craftsmanship is about professionalism in software development.
chadgreen@chadgreen.com chadgreen.com @ChadGreen ChadwickEGreen
thank you.