SlideShare a Scribd company logo
1 of 28
Download to read offline
Pyramid 
A talk by Alexandru Bolboaca 
Developer 
of 
@alexboly 
alex.bolboaca@mozaicworks.com 
Skills
A guesstimate 
80% of you are in a context where you: 
1.Work on an existing codebase 
2.Sometimes encounter strange issues 
3.Have difficulties changing parts of code 
4.Are under pressure to add more features / fix 
bugs faster
A model 
5. Bad code => changeable code 
4. My code is easy to change 
3. My code always works 
2. My code sometimes works 
1. My code doesn't work
Be aware that... 
1.All models are wrong, some models are useful 
2.This model focuses on hard skills (but soft skills 
are very important!)
Level 1 
I write code but... 
It doesn't work
Aka... 
● Beginner 
● My grandmother 
● Anyone you know who's not a programmer 
We all wrote this type of code...
Code Sample 
int main(){ 
string teststring; 
getline(cin, teststring); 
cout << teststring << endl; 
int b; 
for (int b = teststring.length();b <= 0; b--){ 
cout << teststring.at(b) << endl; 
} 
cout << "n" << endl; 
} 
Expected: “code” => “edoc” 
Loop starts Variable 'b' re-declared after the end of the string 
“n” and endl are the same thing 
Source: https://answers.yahoo.com/question/index?qid=20140126105146AAaZDSN 
Wrong condition
Skills required for Level 1 
● Starting the computer 
● Starting a text editor 
● Reading 
● Writing on a computer 
● … you get the idea
Level 2 
I write code but... 
It sometimes works
Aka... 
● Jr. programmer 
● “It works on my computer” 
● “You didn't say the server is not always named 
Jane!” 
● “It worked yesterday” 
● “It's 90% done”
Code Sample 
ON_NOTIFY( wNotifyCode, idControl, memberFxn ) 
afx_msg void memberFxn( NMHDR * pNotifyStruct, LRESULT * 
result ); 
typedef struct tagNMHDR { 
HWND hwndFrom; // handle of control sending message 
UINT idFrom;// identifier of control sending message 
UINT code; // notification code; see below 
} NMHDR; 
Careful with the types. I searched 6 months for 
a bug because I used INT instead of UINT 
Source: http://msdn.microsoft.com/en-us/library/9c4xka2b.aspx
Skills required for Level 2 
● Writing code 
● Lots of optimism 
● Perseverance 
● Passion for programming
Level 3 
I write code and... 
It always works
Aka... 
● Sr. programmer (why not just programmer?)
Code Sample 
public ResultsdotNet CalculateThreadpool(ResultsdotNet total){ 
ManualResetEvent[] events = new ManualResetEvent[Environment.ProcessorCount]; 
List<ResultsdotNet> results = new List<ResultsdotNet>(); 
for (int i = 1; i <= Environment.ProcessorCount; i++){ 
Parallelised Monte Carlo 
Algorithm 
ResultsdotNet batchResult = new ResultsdotNet() { Iterations = total.Iterations / Environment.ProcessorCount, ManualResetEvent = new 
ManualResetEvent(false) }; 
results.Add(batchResult); 
events[i - 1] = batchResult.ManualResetEvent; 
ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateCallback), batchResult); 
} 
WaitHandle.WaitAll(events); 
foreach (ResultsdotNet batchResult in results){ 
total.dW += batchResult.dW; 
total.dX += batchResult.dX; 
total.dY += batchResult.dY; 
total.dZ += batchResult.dZ; 
total.W += batchResult.W; 
total.X += batchResult.X; 
total.Y += batchResult.Y; 
total.Z += batchResult.Z; 
total.Iterations += batchResult.Iterations; 
} 
total.dW = total.dW / results.Count; 
total.dX = total.dX / results.Count; 
total.dY = total.dY / results.Count; 
total.dZ = total.dZ / results.Count; 
total.W = total.W / results.Count; 
total.X = total.X / results.Count; 
total.Y = total.Y / results.Count; 
total.Z = total.Z / results.Count; 
return total; 
} 
Long method 
Unclear intent 
What is parallelised? 
But it works! 
http://www.codeproject.com/Articles/767997/Parallelised-Monte-Carlo-Algorithms-sharp
Skills required for Level 3 
● Understanding requirements 
● Clarifying requirements 
● Identifying local technical risks 
● Testing his/her own code; writing automated tests 
for own code help 
● Involving team mates for a code review, pair 
programming
Level 4 
I write code and... 
It's easy to change
Aka... 
● Technical Lead
Code Sample 
def upload() { 
def problemId = params.problemId 
def problem = Problem.get(problemId) 
def uploadedFile = request.getFile('solution') 
if (uploadedFile.empty) { 
flash.message = 'Please select a file' 
forward(controller: "profile", action: "index") 
return 
} 
createSolution(problem, uploadedFile) 
redirect(action: "index") 
} 
def createSolution(problem, uploadedFile) { 
def filename = "${userService.getUser().id}/${uploadedFile.originalFilename}" 
def destinationPath = new File(filename) 
destinationPath.mkdirs() 
uploadedFile.transferTo(destinationPath) 
new Solution(user: userService.getUser(), problem: problem, pathToSolution: 
filename).save() 
} 
Source: I TAKE Unconference Contest application
Skills required for Level 4 
● Clean code 
● Changeable design principles (eg. SOLID) 
● Design patterns 
● Automated developer testing (includes unit, 
integration, end to end, acceptance testing) 
● Identifying risks
Level 5 
I can turn bad code into 
Changeable code
Aka... 
● Code cleaner 
● Consultant
Skills required for Level 5 
● Writing tests on existing code 
● Refactoring 
● Writing own refactoring scripts
The model 
5. Bad code => changeable code 
4. My code is easy to change 
3. My code always works 
2. My code sometimes works 
1. My code doesn't work
Remember 
1.All models are wrong, some models are useful 
2.This model focuses on hard skills (but soft skills 
are very important!)
Your Questions? 
“The important thing is 
not to stop questioning”
I'm guilty for this talk! 
Alexandru Bolboacă 
Trainer, coach, polyglot 
programmer with international 
experience 
alex.bolboaca@mozaicworks.com 
@alexboly
Photo Attribution 
http://i.images.cdn.fotopedia.com/flickr-3873843704- 
hd/Paris/Main_sights/Paris__Louvre_Pyramid.jpg 
http://www.quotes.jotoexplorer.com/wp-content/ 
uploads/2012/10/Albert%20Einstein%20Quotes%205.jpg 
http://youthjoint.com/alpha/wp-content/ 
uploads/2014/04/blackboard-with-chalk2.jpg

More Related Content

What's hot

Functional Programming in C#
Functional Programming in C#Functional Programming in C#
Functional Programming in C#Giorgio Zoppi
 
Review of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiReview of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiNico Ludwig
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to cSadhanaParameswaran
 
Java if and else
Java if and elseJava if and else
Java if and elsepratik8897
 
Giorgio zoppi cpp11concurrency
Giorgio zoppi cpp11concurrencyGiorgio zoppi cpp11concurrency
Giorgio zoppi cpp11concurrencyGiorgio Zoppi
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript ProgrammingSehwan Noh
 
Writing testable js [by Ted Piotrowski]
Writing testable js [by Ted Piotrowski]Writing testable js [by Ted Piotrowski]
Writing testable js [by Ted Piotrowski]JavaScript Meetup HCMC
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Ovidiu Farauanu
 
A fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxA fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxPVS-Studio
 
28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScriptVARSHAKUMARI49
 
30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscriptVARSHAKUMARI49
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorialadelaticleanu
 
Mobile Weekend Budapest presentation
Mobile Weekend Budapest presentationMobile Weekend Budapest presentation
Mobile Weekend Budapest presentationPéter Ádám Wiesner
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascriptDoeun KOCH
 

What's hot (20)

Functional Programming in C#
Functional Programming in C#Functional Programming in C#
Functional Programming in C#
 
Review of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiReview of c_sharp2_features_part_ii
Review of c_sharp2_features_part_ii
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
 
Java if and else
Java if and elseJava if and else
Java if and else
 
Giorgio zoppi cpp11concurrency
Giorgio zoppi cpp11concurrencyGiorgio zoppi cpp11concurrency
Giorgio zoppi cpp11concurrency
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
Writing testable js [by Ted Piotrowski]
Writing testable js [by Ted Piotrowski]Writing testable js [by Ted Piotrowski]
Writing testable js [by Ted Piotrowski]
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)
 
A fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBoxA fresh eye on Oracle VM VirtualBox
A fresh eye on Oracle VM VirtualBox
 
Effective PHP. Part 3
Effective PHP. Part 3Effective PHP. Part 3
Effective PHP. Part 3
 
28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScript
 
Effective PHP. Part 5
Effective PHP. Part 5Effective PHP. Part 5
Effective PHP. Part 5
 
Effective PHP. Part 2
Effective PHP. Part 2Effective PHP. Part 2
Effective PHP. Part 2
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Java script basic
Java script basicJava script basic
Java script basic
 
30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorial
 
Effective PHP. Part 4
Effective PHP. Part 4Effective PHP. Part 4
Effective PHP. Part 4
 
Mobile Weekend Budapest presentation
Mobile Weekend Budapest presentationMobile Weekend Budapest presentation
Mobile Weekend Budapest presentation
 
Advanced javascript
Advanced javascriptAdvanced javascript
Advanced javascript
 

Viewers also liked

16073 o shomework
16073 o shomework16073 o shomework
16073 o shomeworksahil23331
 
Determining The Barriers Faced By Novice Programmers
Determining The Barriers Faced By Novice ProgrammersDetermining The Barriers Faced By Novice Programmers
Determining The Barriers Faced By Novice ProgrammersWaqas Tariq
 
AYN RAND Translations
AYN RAND TranslationsAYN RAND Translations
AYN RAND TranslationsAnochi.com.
 
Digital marketing and Employee Advocacy
Digital marketing and Employee AdvocacyDigital marketing and Employee Advocacy
Digital marketing and Employee AdvocacyRay Hiltz
 
Gas Hydrates - Big Potential with Uncertain Future
Gas Hydrates - Big Potential with Uncertain FutureGas Hydrates - Big Potential with Uncertain Future
Gas Hydrates - Big Potential with Uncertain Futureml285
 
Kirkstyles - Sustainable, Innovative and Affordable Construction
Kirkstyles - Sustainable, Innovative and Affordable ConstructionKirkstyles - Sustainable, Innovative and Affordable Construction
Kirkstyles - Sustainable, Innovative and Affordable ConstructionTim Harper
 
Snsのメリットとは
SnsのメリットとはSnsのメリットとは
Snsのメリットとはuchidakatsuya
 
Freedom con and sfl 13 14 april 2016
Freedom con and sfl 13 14 april 2016Freedom con and sfl 13 14 april 2016
Freedom con and sfl 13 14 april 2016Anochi.com.
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddAlexandru Bolboaca
 

Viewers also liked (20)

Continuous delivery
Continuous deliveryContinuous delivery
Continuous delivery
 
16073 o shomework
16073 o shomework16073 o shomework
16073 o shomework
 
Determining The Barriers Faced By Novice Programmers
Determining The Barriers Faced By Novice ProgrammersDetermining The Barriers Faced By Novice Programmers
Determining The Barriers Faced By Novice Programmers
 
embedded system for green g
embedded system for green gembedded system for green g
embedded system for green g
 
AYN RAND Translations
AYN RAND TranslationsAYN RAND Translations
AYN RAND Translations
 
Digital marketing and Employee Advocacy
Digital marketing and Employee AdvocacyDigital marketing and Employee Advocacy
Digital marketing and Employee Advocacy
 
Grupo
GrupoGrupo
Grupo
 
Gas Hydrates - Big Potential with Uncertain Future
Gas Hydrates - Big Potential with Uncertain FutureGas Hydrates - Big Potential with Uncertain Future
Gas Hydrates - Big Potential with Uncertain Future
 
Cv Ak Web
Cv Ak WebCv Ak Web
Cv Ak Web
 
Joe & The Museum of London
Joe & The Museum of LondonJoe & The Museum of London
Joe & The Museum of London
 
Integrated Water Resource Management (Iwrm)
Integrated Water Resource Management (Iwrm)Integrated Water Resource Management (Iwrm)
Integrated Water Resource Management (Iwrm)
 
Robertson omoa
Robertson omoaRobertson omoa
Robertson omoa
 
Applied craftsmanship
Applied craftsmanshipApplied craftsmanship
Applied craftsmanship
 
Kirkstyles - Sustainable, Innovative and Affordable Construction
Kirkstyles - Sustainable, Innovative and Affordable ConstructionKirkstyles - Sustainable, Innovative and Affordable Construction
Kirkstyles - Sustainable, Innovative and Affordable Construction
 
Vauban and stairs
Vauban and stairsVauban and stairs
Vauban and stairs
 
Emtech Malaga
Emtech MalagaEmtech Malaga
Emtech Malaga
 
Bgv spreuken
Bgv spreukenBgv spreuken
Bgv spreuken
 
Snsのメリットとは
SnsのメリットとはSnsのメリットとは
Snsのメリットとは
 
Freedom con and sfl 13 14 april 2016
Freedom con and sfl 13 14 april 2016Freedom con and sfl 13 14 april 2016
Freedom con and sfl 13 14 april 2016
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tdd
 

Similar to Pyramid Code Change Model

PVS-Studio and static code analysis technique
PVS-Studio and static code analysis techniquePVS-Studio and static code analysis technique
PVS-Studio and static code analysis techniqueAndrey Karpov
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksStoyan Nikolov
 
(3) cpp procedural programming
(3) cpp procedural programming(3) cpp procedural programming
(3) cpp procedural programmingNico Ludwig
 
Behaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About TestingBehaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About Testingdn
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testingmalcolmt
 
Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?Andrey Karpov
 
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows Side
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows SideNagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows Side
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows SideNagios
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Gianluca Padovani
 
Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent codeDror Helper
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazyMichael Boman
 
44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyAnne Nicolas
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone CivettaCocoaHeads France
 

Similar to Pyramid Code Change Model (20)

PVS-Studio and static code analysis technique
PVS-Studio and static code analysis techniquePVS-Studio and static code analysis technique
PVS-Studio and static code analysis technique
 
Wtf per lineofcode
Wtf per lineofcodeWtf per lineofcode
Wtf per lineofcode
 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time Checks
 
(3) cpp procedural programming
(3) cpp procedural programming(3) cpp procedural programming
(3) cpp procedural programming
 
Clean code
Clean codeClean code
Clean code
 
Behaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About TestingBehaviour Driven Development and Thinking About Testing
Behaviour Driven Development and Thinking About Testing
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testing
 
Static code analysis: what? how? why?
Static code analysis: what? how? why?Static code analysis: what? how? why?
Static code analysis: what? how? why?
 
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows Side
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows SideNagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows Side
Nagios Conference 2011 - Michael Medin - Workshop: Scripting On The Windows Side
 
Porting to Python 3
Porting to Python 3Porting to Python 3
Porting to Python 3
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)
 
Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent code
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazy
 
44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy44CON London 2015 - How to drive a malware analyst crazy
44CON London 2015 - How to drive a malware analyst crazy
 
Kernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easyKernel Recipes 2019 - Formal modeling made easy
Kernel Recipes 2019 - Formal modeling made easy
 
Android ndk
Android ndkAndroid ndk
Android ndk
 
Clean Code 2
Clean Code 2Clean Code 2
Clean Code 2
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 

More from Alexandru Bolboaca

More from Alexandru Bolboaca (20)

Refactor legacy code through pure functions
Refactor legacy code through pure functionsRefactor legacy code through pure functions
Refactor legacy code through pure functions
 
Design Without Types
Design Without TypesDesign Without Types
Design Without Types
 
Thinking in Functions
Thinking in FunctionsThinking in Functions
Thinking in Functions
 
Raising the Bar
Raising the BarRaising the Bar
Raising the Bar
 
The Journey to Master Code Design
The Journey to Master Code DesignThe Journey to Master Code Design
The Journey to Master Code Design
 
What is good software design? And why it matters?
What is good software design? And why it matters?What is good software design? And why it matters?
What is good software design? And why it matters?
 
Functional programming in C++
Functional programming in C++Functional programming in C++
Functional programming in C++
 
Agile Technical Leadership
Agile Technical LeadershipAgile Technical Leadership
Agile Technical Leadership
 
TDD As If You Meant It
TDD As If You Meant ItTDD As If You Meant It
TDD As If You Meant It
 
Usable Software Design
Usable Software DesignUsable Software Design
Usable Software Design
 
Hidden loops
Hidden loopsHidden loops
Hidden loops
 
Removing structural duplication
Removing structural duplicationRemoving structural duplication
Removing structural duplication
 
Why You Should Start Using Docker
Why You Should Start Using DockerWhy You Should Start Using Docker
Why You Should Start Using Docker
 
Stay focused
Stay focusedStay focused
Stay focused
 
Kanban intro
Kanban introKanban intro
Kanban intro
 
Unit testing-patterns
Unit testing-patternsUnit testing-patterns
Unit testing-patterns
 
Incremental design, simply explained
Incremental design, simply explainedIncremental design, simply explained
Incremental design, simply explained
 
Feedback - The Lost Art of Agile
Feedback -  The Lost Art of AgileFeedback -  The Lost Art of Agile
Feedback - The Lost Art of Agile
 
Build a great Technical Team
Build a great Technical TeamBuild a great Technical Team
Build a great Technical Team
 
Deliver every two days
Deliver every two daysDeliver every two days
Deliver every two days
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Pyramid Code Change Model

  • 1. Pyramid A talk by Alexandru Bolboaca Developer of @alexboly alex.bolboaca@mozaicworks.com Skills
  • 2. A guesstimate 80% of you are in a context where you: 1.Work on an existing codebase 2.Sometimes encounter strange issues 3.Have difficulties changing parts of code 4.Are under pressure to add more features / fix bugs faster
  • 3. A model 5. Bad code => changeable code 4. My code is easy to change 3. My code always works 2. My code sometimes works 1. My code doesn't work
  • 4. Be aware that... 1.All models are wrong, some models are useful 2.This model focuses on hard skills (but soft skills are very important!)
  • 5. Level 1 I write code but... It doesn't work
  • 6. Aka... ● Beginner ● My grandmother ● Anyone you know who's not a programmer We all wrote this type of code...
  • 7. Code Sample int main(){ string teststring; getline(cin, teststring); cout << teststring << endl; int b; for (int b = teststring.length();b <= 0; b--){ cout << teststring.at(b) << endl; } cout << "n" << endl; } Expected: “code” => “edoc” Loop starts Variable 'b' re-declared after the end of the string “n” and endl are the same thing Source: https://answers.yahoo.com/question/index?qid=20140126105146AAaZDSN Wrong condition
  • 8. Skills required for Level 1 ● Starting the computer ● Starting a text editor ● Reading ● Writing on a computer ● … you get the idea
  • 9. Level 2 I write code but... It sometimes works
  • 10. Aka... ● Jr. programmer ● “It works on my computer” ● “You didn't say the server is not always named Jane!” ● “It worked yesterday” ● “It's 90% done”
  • 11. Code Sample ON_NOTIFY( wNotifyCode, idControl, memberFxn ) afx_msg void memberFxn( NMHDR * pNotifyStruct, LRESULT * result ); typedef struct tagNMHDR { HWND hwndFrom; // handle of control sending message UINT idFrom;// identifier of control sending message UINT code; // notification code; see below } NMHDR; Careful with the types. I searched 6 months for a bug because I used INT instead of UINT Source: http://msdn.microsoft.com/en-us/library/9c4xka2b.aspx
  • 12. Skills required for Level 2 ● Writing code ● Lots of optimism ● Perseverance ● Passion for programming
  • 13. Level 3 I write code and... It always works
  • 14. Aka... ● Sr. programmer (why not just programmer?)
  • 15. Code Sample public ResultsdotNet CalculateThreadpool(ResultsdotNet total){ ManualResetEvent[] events = new ManualResetEvent[Environment.ProcessorCount]; List<ResultsdotNet> results = new List<ResultsdotNet>(); for (int i = 1; i <= Environment.ProcessorCount; i++){ Parallelised Monte Carlo Algorithm ResultsdotNet batchResult = new ResultsdotNet() { Iterations = total.Iterations / Environment.ProcessorCount, ManualResetEvent = new ManualResetEvent(false) }; results.Add(batchResult); events[i - 1] = batchResult.ManualResetEvent; ThreadPool.QueueUserWorkItem(new WaitCallback(CalculateCallback), batchResult); } WaitHandle.WaitAll(events); foreach (ResultsdotNet batchResult in results){ total.dW += batchResult.dW; total.dX += batchResult.dX; total.dY += batchResult.dY; total.dZ += batchResult.dZ; total.W += batchResult.W; total.X += batchResult.X; total.Y += batchResult.Y; total.Z += batchResult.Z; total.Iterations += batchResult.Iterations; } total.dW = total.dW / results.Count; total.dX = total.dX / results.Count; total.dY = total.dY / results.Count; total.dZ = total.dZ / results.Count; total.W = total.W / results.Count; total.X = total.X / results.Count; total.Y = total.Y / results.Count; total.Z = total.Z / results.Count; return total; } Long method Unclear intent What is parallelised? But it works! http://www.codeproject.com/Articles/767997/Parallelised-Monte-Carlo-Algorithms-sharp
  • 16. Skills required for Level 3 ● Understanding requirements ● Clarifying requirements ● Identifying local technical risks ● Testing his/her own code; writing automated tests for own code help ● Involving team mates for a code review, pair programming
  • 17. Level 4 I write code and... It's easy to change
  • 19. Code Sample def upload() { def problemId = params.problemId def problem = Problem.get(problemId) def uploadedFile = request.getFile('solution') if (uploadedFile.empty) { flash.message = 'Please select a file' forward(controller: "profile", action: "index") return } createSolution(problem, uploadedFile) redirect(action: "index") } def createSolution(problem, uploadedFile) { def filename = "${userService.getUser().id}/${uploadedFile.originalFilename}" def destinationPath = new File(filename) destinationPath.mkdirs() uploadedFile.transferTo(destinationPath) new Solution(user: userService.getUser(), problem: problem, pathToSolution: filename).save() } Source: I TAKE Unconference Contest application
  • 20. Skills required for Level 4 ● Clean code ● Changeable design principles (eg. SOLID) ● Design patterns ● Automated developer testing (includes unit, integration, end to end, acceptance testing) ● Identifying risks
  • 21. Level 5 I can turn bad code into Changeable code
  • 22. Aka... ● Code cleaner ● Consultant
  • 23. Skills required for Level 5 ● Writing tests on existing code ● Refactoring ● Writing own refactoring scripts
  • 24. The model 5. Bad code => changeable code 4. My code is easy to change 3. My code always works 2. My code sometimes works 1. My code doesn't work
  • 25. Remember 1.All models are wrong, some models are useful 2.This model focuses on hard skills (but soft skills are very important!)
  • 26. Your Questions? “The important thing is not to stop questioning”
  • 27. I'm guilty for this talk! Alexandru Bolboacă Trainer, coach, polyglot programmer with international experience alex.bolboaca@mozaicworks.com @alexboly
  • 28. Photo Attribution http://i.images.cdn.fotopedia.com/flickr-3873843704- hd/Paris/Main_sights/Paris__Louvre_Pyramid.jpg http://www.quotes.jotoexplorer.com/wp-content/ uploads/2012/10/Albert%20Einstein%20Quotes%205.jpg http://youthjoint.com/alpha/wp-content/ uploads/2014/04/blackboard-with-chalk2.jpg