SlideShare a Scribd company logo
1 of 33
Develop Best Practices
The secret sauce for coding modern software
Kosala Nuwan Perera
@kosalanuwan
Peter Falk told to Paul Reiser…
get some paper
put it in a typewriter
type FADE IN
... and keep typing.
Problem, solution, and solve…
Biggest mistake of all time is
jump straight to “Solve”.
People really don’t get this!
Every feature is
a commitment, a financial debt,
even if its not used.
Did you know that you are
woefully stuck in the Appland?
Well, now you know 
Things that teams literally struggle
- More granular tracing and auditing
- User telemetry
- Support for flexible DevOps
- Modularization
- Hybrid could opportunities
- End-to-end message security
- Powerful API for Public and Private
- Asynchronous UX
- Support for Multiplicity of clients
- More efficient background processing
Things that teams literally struggle
- More granular tracing and auditing
- User telemetry
- Support for flexible DevOps
- Modularization
- Hybrid could opportunities
- End-to-end message security
- Powerful API for Public and Private
- Asynchronous UX
- Support for Multiplicity of clients
- More efficient background processing
Things that teams literally struggle
- More granular tracing and auditing
- User telemetry
- Support for flexible DevOps
- Modularization
- Hybrid could opportunities
- End-to-end message security
- Powerful API for Public and Private
- Asynchronous UX
- Support for Multiplicity of clients
- More efficient background processing
A computer program is
the most complicated thing on earth,
second to a woman's brain.
I just told this and she second it 
How do you make things so complicated?
- Rigid
Small change causing cascade changes.
- Fragile
Breaks in many places due to a single change.
- Immobility
Cannot reuse in other projects due to risks/high efforts.
- Design debt
Technical debt by taking shortcuts?
- Environment debt
Technical debt by not running build, test, and other tasks.
- Needless complexity
- Needless repetition
- Opacity
Cannot/hard to understand. Requires reengineering.
How do you make things so complicated?
- Rigid
Small change causing cascade changes.
- Fragile
Breaks in many places due to a single change.
- Immobility
Cannot reuse in other projects due to risks/high efforts.
- Design debt
Technical debt by taking shortcuts?
- Environment debt
Technical debt by not running build, test, and other tasks.
- Needless complexity
- Needless repetition
- Opacity
Cannot/hard to understand. Requires reengineering.
How do you make things so complicated?
- Rigid
Small change causing cascade changes.
- Fragile
Breaks in many places due to a single change.
- Immobility
Cannot reuse in other projects due to risks/high efforts.
- Design debt
Technical debt by taking shortcuts?
- Environment debt
Technical debt by not running build, test, and other tasks.
- Needless complexity
- Needless repetition
- Opacity
Cannot/hard to understand. Requires reengineering.
How do you make things so complicated?
- Rigid
Small change causing cascade changes.
- Fragile
Breaks in many places due to a single change.
- Immobility
Cannot reuse in other projects due to risks/high efforts.
- Design debt
Technical debt by taking shortcuts?
- Environment debt
Technical debt by not running build, test, and other tasks.
- Needless complexity
- Needless repetition
- Opacity
Cannot/hard to understand. Requires reengineering.
Why would you care?
- Respond to change
- Cost of change
- Financial debt
You have a limited number of
keystrokes left in your hands
before you “die”.
What can you try Today?
- Naming conventions
- Methods
- Design principles
- Dependency injection
- Encapsulate conditionals
- Polymorphism to If/Else or Switch/Case
- Exception over return codes
Read more at Crockford's guidelines for JavaScript and
Google guidelines for JavaScript
Convention Example
App Root PascalCase Approvely
Files camelCased autoComplete.controller.js
Constructors PascalCase WebRequest
Namespaces camelCased but it’s unusual to have
two parts in one word though
Approvely.widgets
Functions camelCased toString
Non-constant variables
including params
camelCased
Constants but ES5 has
no constants
Capitalized or PascalCase CLICK_EVENT, Events.Click
Enums but ES5 has no
enums
Capitalized or PascalCase. Singular
for non-flags and plural for flags
HTTP_STATUS_CODE,
HttpStatusCode, BindingFlags
What can you try Today?
- Naming conventions
- Methods
- Design principles
- Dependency injection
- Encapsulate conditionals
- Polymorphism to If/Else or Switch/Case
- Exception over return codes
What can you try Today?
- Naming conventions
- Methods
- Design principles
- Dependency injection
- Encapsulate conditionals
- Polymorphism to If/Else or Switch/Case
- Exception over return codes
class Sword
{
public void Hit(string target) { ... }
}
class Samurai
{
private Sword sword;
public Samurai()
{
sword = new Sword();
}
public void Attack(string target)
{
sword.Hit(target);
}
}
Usage:
Samurai warrior = new Samurai();
warrior.Attack("the evildoers");
interface IWeapon
{
void Hit(string target);
}
class Sword : IWeapon
{
public void Hit(string target) { ... }
}
class Shuriken : IWeapon
{
public void Hit(string target) { ... }
}
class Samurai
{
public Samurai(IWeapon w) { ... }
public void Attack(string target) { ... }
}
Usage:
Shuriken weap1 = new Shuriken();
Samurai warrior1 = new Samurai(weap1);
warrior1.Attack("the evildoers");
Sword weap2 = new Sword();
Samurai warrior2 = new Samurai(weap2);
warrior2.Attack("the evildoers");
What can you try Today?
- Naming conventions
- Methods
- Design principles
- Dependency injection
- Encapsulate conditionals
- Polymorphism to If/Else or Switch/Case
- Exception over return codes
if (navigator.appName == "Microsoft Internet Explorer") {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
$(".js-slider-frame").animate({ left: "-130px" }, 1000);
flag = false;
} else {
$(".js-slider-frame").animate({ left: "236px" }, 1000);
flag = true;
}
return false;
});
} else {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
move(".js-slider-frame").set("left", -130).duration("1s").end();
flag = false;
} else {
move(".js-slider-frame").set("left", 236).duration("1s").end();
flag = true;
}
return false;
});
}
if (navigator.appName == "Microsoft Internet Explorer") {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
$(".js-slider-frame").animate({ left: "-130px" }, 1000);
flag = false;
} else {
$(".js-slider-frame").animate({ left: "236px" }, 1000);
flag = true;
}
return false;
});
} else {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
move(".js-slider-frame").set("left", -130).duration("1s").end();
flag = false;
} else {
move(".js-slider-frame").set("left", 236).duration("1s").end();
flag = true;
}
return false;
});
}
if (navigator.appName == "Microsoft Internet Explorer") {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
$(".js-slider-frame").animate({ left: "-130px" }, 1000);
flag = false;
} else {
$(".js-slider-frame").animate({ left: "236px" }, 1000);
flag = true;
}
return false;
});
} else {
var flag = true;
$(".js-right-arrow").click(function () {
if (flag) {
move(".js-slider-frame").set("left", -130).duration("1s").end();
flag = false;
} else {
move(".js-slider-frame").set("left", 236).duration("1s").end();
flag = true;
}
return false;
});
}
var flag = true,
isIE = navigator.appName == "Microsoft Internet Explorer";
$(".js-right-arrow").click(function () {
if (isIE) {
$(".js-slider-frame").animate({ left: flag ? "-130px" : "236px" }, 1000);
} else {
move(".js-slider-frame").set("left", flag ? -130 : 236).duration("1s");
}
flag = !flag;
return false;
});
What can you try Today?
- Naming conventions
- Methods
- Design principles
- Dependency injection
- Encapsulate conditionals
- Polymorphism to If/Else or Switch/Case
- Exception over return codes
When you are matured with these
principles and patterns,
it will become difficult for you to
think without those.
Where to begin?
- Good Editor
- Static analysis tools
- Builds
- Test automation tools
- Source control
- Continuous integration
What other things that go with it?
- Open source
- Code kata
- Pair programming
- Design/Code reviews
- Peer reviews
I swear to write software,
more useful software
and nothing but well-crafted software
so help me God!
- The Software Craftsmanship Oath
Happy Coding 
Kosala Nuwan Perera
@kosalanuwan

More Related Content

Similar to Developer Best Practices - The secret sauce for coding modern software

Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDCODEiD PHP Community
 
Ultimate Node.js countdown: the coolest Application Express examples
Ultimate Node.js countdown: the coolest Application Express examplesUltimate Node.js countdown: the coolest Application Express examples
Ultimate Node.js countdown: the coolest Application Express examplesAlan Arentsen
 
Reactive programming with RxJS - Taiwan
Reactive programming with RxJS - TaiwanReactive programming with RxJS - Taiwan
Reactive programming with RxJS - Taiwanmodernweb
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deploymentFilippo Zanella
 
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...Marco Cedaro
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 mayLuciano Amodio
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Developing faster than ever (Liferay DEVCON 2017)
Developing faster than ever (Liferay DEVCON 2017)Developing faster than ever (Liferay DEVCON 2017)
Developing faster than ever (Liferay DEVCON 2017)Sébastien Le Marchand
 
Work Queues
Work QueuesWork Queues
Work Queuesciconf
 
Human scaling on the front end
Human scaling on the front endHuman scaling on the front end
Human scaling on the front endRudy Rigot
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainLourens Naudé
 
The Value of Reactive
The Value of ReactiveThe Value of Reactive
The Value of ReactiveVMware Tanzu
 
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег ЗинченкоWebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег ЗинченкоGeeksLab Odessa
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Konstantin Kudryashov
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budgetDavid Lukac
 
Advanced Topics in Continuous Deployment
Advanced Topics in Continuous DeploymentAdvanced Topics in Continuous Deployment
Advanced Topics in Continuous DeploymentMike Brittain
 

Similar to Developer Best Practices - The secret sauce for coding modern software (20)

Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
 
Ultimate Node.js countdown: the coolest Application Express examples
Ultimate Node.js countdown: the coolest Application Express examplesUltimate Node.js countdown: the coolest Application Express examples
Ultimate Node.js countdown: the coolest Application Express examples
 
Reactive programming with RxJS - Taiwan
Reactive programming with RxJS - TaiwanReactive programming with RxJS - Taiwan
Reactive programming with RxJS - Taiwan
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deployment
 
Going web native
Going web nativeGoing web native
Going web native
 
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
JsDay - It's not you, It's me (or how to avoid being coupled with a Javascrip...
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Developing faster than ever (Liferay DEVCON 2017)
Developing faster than ever (Liferay DEVCON 2017)Developing faster than ever (Liferay DEVCON 2017)
Developing faster than ever (Liferay DEVCON 2017)
 
Work Queues
Work QueuesWork Queues
Work Queues
 
Human scaling on the front end
Human scaling on the front endHuman scaling on the front end
Human scaling on the front end
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your Domain
 
The value of reactive
The value of reactiveThe value of reactive
The value of reactive
 
The Value of Reactive
The Value of ReactiveThe Value of Reactive
The Value of Reactive
 
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег ЗинченкоWebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
 
Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015Min-Maxing Software Costs - Laracon EU 2015
Min-Maxing Software Costs - Laracon EU 2015
 
Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budget
 
Advanced Topics in Continuous Deployment
Advanced Topics in Continuous DeploymentAdvanced Topics in Continuous Deployment
Advanced Topics in Continuous Deployment
 

More from Kosala Nuwan Perera

Lean UX and Design winning mobile apps
Lean UX and Design winning mobile appsLean UX and Design winning mobile apps
Lean UX and Design winning mobile appsKosala Nuwan Perera
 
Native vs Web vs Hybrid Mobile Application Development
Native vs Web vs Hybrid Mobile Application DevelopmentNative vs Web vs Hybrid Mobile Application Development
Native vs Web vs Hybrid Mobile Application DevelopmentKosala Nuwan Perera
 
Automating mobile usability heuristics
Automating mobile usability heuristicsAutomating mobile usability heuristics
Automating mobile usability heuristicsKosala Nuwan Perera
 
Crafting features that matter - UX from a Modern Analyst's perspective
Crafting features that matter - UX from a Modern Analyst's perspectiveCrafting features that matter - UX from a Modern Analyst's perspective
Crafting features that matter - UX from a Modern Analyst's perspectiveKosala Nuwan Perera
 
Web-centric application architectures
Web-centric application architecturesWeb-centric application architectures
Web-centric application architecturesKosala Nuwan Perera
 
Emphasis on sprint delivery model with Feature Crews
Emphasis on sprint delivery model with Feature CrewsEmphasis on sprint delivery model with Feature Crews
Emphasis on sprint delivery model with Feature CrewsKosala Nuwan Perera
 
Design stunning user experience with expression blend
Design stunning user experience with expression blendDesign stunning user experience with expression blend
Design stunning user experience with expression blendKosala Nuwan Perera
 
Why certain code is hard to test?
Why certain code is hard to test?Why certain code is hard to test?
Why certain code is hard to test?Kosala Nuwan Perera
 

More from Kosala Nuwan Perera (11)

Lean UX and Design winning mobile apps
Lean UX and Design winning mobile appsLean UX and Design winning mobile apps
Lean UX and Design winning mobile apps
 
Native vs Web vs Hybrid Mobile Application Development
Native vs Web vs Hybrid Mobile Application DevelopmentNative vs Web vs Hybrid Mobile Application Development
Native vs Web vs Hybrid Mobile Application Development
 
Automating mobile usability heuristics
Automating mobile usability heuristicsAutomating mobile usability heuristics
Automating mobile usability heuristics
 
Fake It Before Make It
Fake It Before Make ItFake It Before Make It
Fake It Before Make It
 
Crafting features that matter - UX from a Modern Analyst's perspective
Crafting features that matter - UX from a Modern Analyst's perspectiveCrafting features that matter - UX from a Modern Analyst's perspective
Crafting features that matter - UX from a Modern Analyst's perspective
 
Code Quality for a Fresh Start
Code Quality for a Fresh StartCode Quality for a Fresh Start
Code Quality for a Fresh Start
 
Web-centric application architectures
Web-centric application architecturesWeb-centric application architectures
Web-centric application architectures
 
Emphasis on sprint delivery model with Feature Crews
Emphasis on sprint delivery model with Feature CrewsEmphasis on sprint delivery model with Feature Crews
Emphasis on sprint delivery model with Feature Crews
 
Design stunning user experience with expression blend
Design stunning user experience with expression blendDesign stunning user experience with expression blend
Design stunning user experience with expression blend
 
Why certain code is hard to test?
Why certain code is hard to test?Why certain code is hard to test?
Why certain code is hard to test?
 
If you dont appear on google
If you dont appear on googleIf you dont appear on google
If you dont appear on google
 

Recently uploaded

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 

Recently uploaded (20)

英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 

Developer Best Practices - The secret sauce for coding modern software

  • 1. Develop Best Practices The secret sauce for coding modern software Kosala Nuwan Perera @kosalanuwan
  • 2. Peter Falk told to Paul Reiser… get some paper put it in a typewriter type FADE IN ... and keep typing.
  • 3. Problem, solution, and solve… Biggest mistake of all time is jump straight to “Solve”.
  • 4. People really don’t get this! Every feature is a commitment, a financial debt, even if its not used.
  • 5. Did you know that you are woefully stuck in the Appland? Well, now you know 
  • 6. Things that teams literally struggle - More granular tracing and auditing - User telemetry - Support for flexible DevOps - Modularization - Hybrid could opportunities - End-to-end message security - Powerful API for Public and Private - Asynchronous UX - Support for Multiplicity of clients - More efficient background processing
  • 7. Things that teams literally struggle - More granular tracing and auditing - User telemetry - Support for flexible DevOps - Modularization - Hybrid could opportunities - End-to-end message security - Powerful API for Public and Private - Asynchronous UX - Support for Multiplicity of clients - More efficient background processing
  • 8. Things that teams literally struggle - More granular tracing and auditing - User telemetry - Support for flexible DevOps - Modularization - Hybrid could opportunities - End-to-end message security - Powerful API for Public and Private - Asynchronous UX - Support for Multiplicity of clients - More efficient background processing
  • 9. A computer program is the most complicated thing on earth, second to a woman's brain. I just told this and she second it 
  • 10. How do you make things so complicated? - Rigid Small change causing cascade changes. - Fragile Breaks in many places due to a single change. - Immobility Cannot reuse in other projects due to risks/high efforts. - Design debt Technical debt by taking shortcuts? - Environment debt Technical debt by not running build, test, and other tasks. - Needless complexity - Needless repetition - Opacity Cannot/hard to understand. Requires reengineering.
  • 11. How do you make things so complicated? - Rigid Small change causing cascade changes. - Fragile Breaks in many places due to a single change. - Immobility Cannot reuse in other projects due to risks/high efforts. - Design debt Technical debt by taking shortcuts? - Environment debt Technical debt by not running build, test, and other tasks. - Needless complexity - Needless repetition - Opacity Cannot/hard to understand. Requires reengineering.
  • 12. How do you make things so complicated? - Rigid Small change causing cascade changes. - Fragile Breaks in many places due to a single change. - Immobility Cannot reuse in other projects due to risks/high efforts. - Design debt Technical debt by taking shortcuts? - Environment debt Technical debt by not running build, test, and other tasks. - Needless complexity - Needless repetition - Opacity Cannot/hard to understand. Requires reengineering.
  • 13. How do you make things so complicated? - Rigid Small change causing cascade changes. - Fragile Breaks in many places due to a single change. - Immobility Cannot reuse in other projects due to risks/high efforts. - Design debt Technical debt by taking shortcuts? - Environment debt Technical debt by not running build, test, and other tasks. - Needless complexity - Needless repetition - Opacity Cannot/hard to understand. Requires reengineering.
  • 14. Why would you care? - Respond to change - Cost of change - Financial debt
  • 15. You have a limited number of keystrokes left in your hands before you “die”.
  • 16. What can you try Today? - Naming conventions - Methods - Design principles - Dependency injection - Encapsulate conditionals - Polymorphism to If/Else or Switch/Case - Exception over return codes
  • 17. Read more at Crockford's guidelines for JavaScript and Google guidelines for JavaScript Convention Example App Root PascalCase Approvely Files camelCased autoComplete.controller.js Constructors PascalCase WebRequest Namespaces camelCased but it’s unusual to have two parts in one word though Approvely.widgets Functions camelCased toString Non-constant variables including params camelCased Constants but ES5 has no constants Capitalized or PascalCase CLICK_EVENT, Events.Click Enums but ES5 has no enums Capitalized or PascalCase. Singular for non-flags and plural for flags HTTP_STATUS_CODE, HttpStatusCode, BindingFlags
  • 18. What can you try Today? - Naming conventions - Methods - Design principles - Dependency injection - Encapsulate conditionals - Polymorphism to If/Else or Switch/Case - Exception over return codes
  • 19. What can you try Today? - Naming conventions - Methods - Design principles - Dependency injection - Encapsulate conditionals - Polymorphism to If/Else or Switch/Case - Exception over return codes
  • 20. class Sword { public void Hit(string target) { ... } } class Samurai { private Sword sword; public Samurai() { sword = new Sword(); } public void Attack(string target) { sword.Hit(target); } } Usage: Samurai warrior = new Samurai(); warrior.Attack("the evildoers");
  • 21. interface IWeapon { void Hit(string target); } class Sword : IWeapon { public void Hit(string target) { ... } } class Shuriken : IWeapon { public void Hit(string target) { ... } } class Samurai { public Samurai(IWeapon w) { ... } public void Attack(string target) { ... } } Usage: Shuriken weap1 = new Shuriken(); Samurai warrior1 = new Samurai(weap1); warrior1.Attack("the evildoers"); Sword weap2 = new Sword(); Samurai warrior2 = new Samurai(weap2); warrior2.Attack("the evildoers");
  • 22. What can you try Today? - Naming conventions - Methods - Design principles - Dependency injection - Encapsulate conditionals - Polymorphism to If/Else or Switch/Case - Exception over return codes
  • 23. if (navigator.appName == "Microsoft Internet Explorer") { var flag = true; $(".js-right-arrow").click(function () { if (flag) { $(".js-slider-frame").animate({ left: "-130px" }, 1000); flag = false; } else { $(".js-slider-frame").animate({ left: "236px" }, 1000); flag = true; } return false; }); } else { var flag = true; $(".js-right-arrow").click(function () { if (flag) { move(".js-slider-frame").set("left", -130).duration("1s").end(); flag = false; } else { move(".js-slider-frame").set("left", 236).duration("1s").end(); flag = true; } return false; }); }
  • 24. if (navigator.appName == "Microsoft Internet Explorer") { var flag = true; $(".js-right-arrow").click(function () { if (flag) { $(".js-slider-frame").animate({ left: "-130px" }, 1000); flag = false; } else { $(".js-slider-frame").animate({ left: "236px" }, 1000); flag = true; } return false; }); } else { var flag = true; $(".js-right-arrow").click(function () { if (flag) { move(".js-slider-frame").set("left", -130).duration("1s").end(); flag = false; } else { move(".js-slider-frame").set("left", 236).duration("1s").end(); flag = true; } return false; }); }
  • 25. if (navigator.appName == "Microsoft Internet Explorer") { var flag = true; $(".js-right-arrow").click(function () { if (flag) { $(".js-slider-frame").animate({ left: "-130px" }, 1000); flag = false; } else { $(".js-slider-frame").animate({ left: "236px" }, 1000); flag = true; } return false; }); } else { var flag = true; $(".js-right-arrow").click(function () { if (flag) { move(".js-slider-frame").set("left", -130).duration("1s").end(); flag = false; } else { move(".js-slider-frame").set("left", 236).duration("1s").end(); flag = true; } return false; }); }
  • 26. var flag = true, isIE = navigator.appName == "Microsoft Internet Explorer"; $(".js-right-arrow").click(function () { if (isIE) { $(".js-slider-frame").animate({ left: flag ? "-130px" : "236px" }, 1000); } else { move(".js-slider-frame").set("left", flag ? -130 : 236).duration("1s"); } flag = !flag; return false; });
  • 27. What can you try Today? - Naming conventions - Methods - Design principles - Dependency injection - Encapsulate conditionals - Polymorphism to If/Else or Switch/Case - Exception over return codes
  • 28. When you are matured with these principles and patterns, it will become difficult for you to think without those.
  • 29. Where to begin? - Good Editor - Static analysis tools - Builds - Test automation tools - Source control - Continuous integration
  • 30. What other things that go with it? - Open source - Code kata - Pair programming - Design/Code reviews - Peer reviews
  • 31.
  • 32. I swear to write software, more useful software and nothing but well-crafted software so help me God! - The Software Craftsmanship Oath
  • 33. Happy Coding  Kosala Nuwan Perera @kosalanuwan

Editor's Notes

  1. Problem assumptions - Do customers know they have a problem? Solution assumptions - Would they buy if there is a solution? Solve assumption - Is it feasible to solve and sell?
  2. Craving for Apps, just the app and a database. Modern software architecture is all about apps. How important is this?
  3. These are the things that teams literally struggle when succeeding. How many of us do end-to-end message security? What about Async UX? These are the things that keeps you up all night.
  4. These are the things that teams literally struggle when succeeding. How many of us do end-to-end message security? What about Async UX? These are the things that keeps you up all night.
  5. These are the things that teams literally struggle when succeeding. How many of us do end-to-end message security? What about Async UX? These are the things that keeps you up all night.
  6. Got to leave the Appland now. We are no longer building apps only. We have to build systems and it is hard.
  7. Need to know what are not-so-good practices first.
  8. The ultimate reengineering discussion. Why? We have already learnt how not to do it.
  9. Why would you even care? Understandability, Readability, Changeability, Extensibility, Maintainability
  10. What if? What would you do with the keystrokes?
  11. Common good practices we can learn from the start.
  12. JS conventions.
  13. Smelly code sample about object construction.
  14. Separating object construction.
  15. How IE complicated our lives.
  16. Take a hike once and you’ll be terrified. Keep it up and you’ll know in-and-out about the jungle after a while.
  17. Nothing beats the code reviews.