Professional Documents
Culture Documents
Optimization Mindset
Optimization Mindset
mindset
Naveen Muguda
Naveen Muguda
Engineer | Speaker | Teacher | Writer
https://www.linkedin.com/in/muguda/
https://naveenkumarmuguda.medium.com/
2
Disclaimer
some pictures from google searches
3
4
one ring mindset to rule them all
5
Source: Freepik.com
6
7
Optimality Mindset
It’s more than getting it done, it’s about doing it well.
8
9
10
5W + H
● What
● Who
● When
● Why
● Where
● How
11
What should software address
Functional + Non Functional requirements
12
Software Qualities: A Meta-Model, an O
ntology, and more
source: https://manishsharma.blog/2019/10/04/non-functional-requirements-most-
neglected-aspect-of-software-development/
13
What should software do
South Shift mindset: Automate what your clients/stakeholders would have
done
14
Machine/Human dichotomy
Machine Human
Detail Idea
15
How to develop software
"Programs are meant to be read by humans and only incidentally for computers to execute ." -
Abelson & Sussman
16
17
How should we represent the world
A model is a simplified representation of a thing or phenomenon that intentionally
emphasizes certain aspects while ignoring others. Abstraction with a specific use in
mind.
—Rebecca Wirfs-Brock
18
How much should we … : Minimalism
clearing away all but the most essential things
19
How to represent: Low Gap
● the structure of the software should closely reflect the structure of the domain
○ rich domain models
○ algebraic types
Applying-UML-Patterns
20
How should we communicate: Ubiquitous language
● a common, rigorous language across developers, business and users
● no ambiguous terms and no synonymous terms.
21
how much should be included: Bounded Context
boundary of consistency
22
void someMethod(){ void someMethod(){
//do some stuff doSomeStuff();
line 1 calculateSomeOtherStuff();
line 2 doFinalStuff();
line 3 }
//calculate some other stuff void doSomeStuff(){
line 4 line 1
line 5 line 2
line 6 line 3
}
//do final stuff
line 7 void calculateSomeOtherStuff(){
line 8 line 4
line 9 line 5
} line 6
}
void doFinalStuff(){
line 7
line 8
line 9
23
}
source:https://isappscience.org/efficacy-and-effectiveness/
24
Why to divide
25
public static int guess(int i)
{
i = i - ((i >>> 1) & 0x55555555);
i = (i & 0x33333333) + ((i >>> 2) & 0x33333333);
i = (i + (i >>> 4)) & 0x0f0f0f0f;
i = i + (i >>> 8);
i = i + (i >>> 16);
return i & 0x3f;
}
26
why to modularize:comprehensibility
27
How to deal with complexity
“Manage Essential complexity and reduce/eliminate Accidental Complexity”
28
Halstead complexity measures
n1 = the number of distinct operators
n2 = the number of distinct operands
N1 = the total number of operators
N2 = the total number of operands
Program vocabulary: n = n1 + n2
Program length: N = N1 + N2
Volume: V = N * log n
Difficulty : D = n1 * N2 / (2 * n2)
Effort : E = D * V
29
What to do : compress
number of classes, methods, objects
30
How to compress
Platforms: What, why, when and how
Axis of Variation
31
What to automate:
● Architectural fitness functions
● continuous testing
● continuous deployment
● ….
32
When to : left shift mindset
33
Where to test
production-like environments
34
other/extended versions
If it ain't tight, it ain't done
Occam's Razor
35
Summary
It’s more than getting it done, it’s about doing it well.
36