The document discusses best practices for developing modern software, including following principles like problem-solution-solve, avoiding unnecessary features, and addressing common struggles teams face. It provides tips for improving code quality such as using naming conventions, dependency injection, encapsulating conditionals, and exception handling over return codes. The document emphasizes continuously improving skills through practices like code reviews, pair programming, and following tools and processes like source control and continuous integration.
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
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?
Craving for Apps, just the app and a database.
Modern software architecture is all about apps.
How important is this?
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.
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.
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.
Got to leave the Appland now. We are no longer building apps only. We have to build systems and it is hard.
Need to know what are not-so-good practices first.
The ultimate reengineering discussion.
Why? We have already learnt how not to do it.
Why would you even care?
Understandability, Readability, Changeability, Extensibility, Maintainability
What if?
What would you do with the keystrokes?
Common good practices we can learn from the start.
JS conventions.
Smelly code sample about object construction.
Separating object construction.
How IE complicated our lives.
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.