Beyond the Code: Identifying and reducing complexity in software development

DmitriiIvanov5 82 views 43 slides Mar 09, 2025
Slide 1
Slide 1 of 118
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118

About This Presentation

What makes software complex? In this presentation, we’ll dive into the various forms of complexity that software teams face, offering insights into how to measure and manage them effectively. From bad architectural decisions and cognitive biases to misalignment and inconsistent practices, we’ll ...


Slide Content

BEYOND THE CODE: IDENTIFYING AND
REDUCING COMPLEXITY
IN SOFTWARE DESIGN.
Dmitrii Ivanov,
Senior iOS developer @ING

AGENDA
Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

WHAT IS COMPLEXITY?
Simplicity Complexity
Cognitive load

INFORMATION PROCESSING MODEL
Sensory
memory
Working
memory
Long-term
memory
Input Attention
Encoding
Retrieval
!
Unlimited
Up to 3 sec
Capacity:
~7 items
5-20 sec
Unlimited
Indefinitely
Capacity: Capacity:

COGNITIVE CAPACITY
Sensory
memory
Working
memory
Long-term
memory
Input Attention
Encoding
Retrieval
Unlimited
Up to 3 sec
Capacity:
~7 items
5-20 sec
Unlimited
Indefinitely
Capacity: Capacity:

OUR WORLD IS COMPLEX!

OUR WORLD IS COMPLEX!

COMPLEX SYSTEMS AROUND US
▸Biological organisms
▸Social constructs and institutes
▸Devises and constructions
▸Organisations
▸Processes
▸Software products

HUMAN-MADE SYSTEMS

ESSENTIAL (INHERITED) COMPLEXITY

HUMAN-MADE SYSTEMS

ADDED (ACCIDENTAL) COMPLEXITY

ADDED COMPLEXITY
ESSENTIAL COMPLEXITY
Inherent to the problem
Introduced by a solution

Sensory
memory
Working
memory
Long-term
memory
Input Attention
Encoding
Retrieval
Unlimited
Up to 3 sec
Capacity:
~7 items
5-20 sec
Unlimited
Indefinitely
Capacity: Capacity:
COMPLEXITY = COGNITIVE LOAD

IMPACT OF BIG COGNITIVE LOAD
▸Low maintainability
▸Steep learning curve
▸Bad scalability
▸Error-proneness
▸Slow decision-making
▸More communication
▸Worse developers' well-being

Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

MEASURING COMPLEXITY
“You can't Manage what you can't Measure"
W. Edwards Deming
statistician and quality-control expert
or
Peter Drucker
books author, management consultant 

MEASURING COMPLEXITY
1.Lines of Code (LOC)
2.Cyclomatic complexity
3.Halstead volume
4.Maximum Nesting Level
5.Number of Parameters
6.Maintainability Index
func doSomething(x: Int) -> Int {
let y = x + 10
return y
}
func doSomething(x: Int) -> Int {
let y = x + 10
if y > 0 {
return y
} else {
return 0
}
}
MI = MAX(0,(171 -
5.2 * ln(Halstead Volume) -
0.23 * (Cyclomatic Complexity) -
16.2 * ln(Lines of Code)) *
100 / 171)

MEASURING COMPLEXITY
7.Cohesion (how focused are the functions)
8.Coupling (amount of dependencies)
9.Depth of Inheritance Tree (DIT)
10.Response for a Class (RFC)
11.Number of Added Methods
12.Number of Overridden Methods
13.Number of Implemented Interfaces (NOII)

MEASURING COMPLEXITY
7.Cohesion (how focused are the functions)
8.Coupling (amount of dependencies)
9.Depth of Inheritance Tree (DIT)
10.Response for a Class (RFC)
11.Number of Added Methods
12.Number of Overridden Methods
13.Number of Implemented Interfaces (NOII)
1.Lines of Code (LOC)
2.Cyclomatic complexity
3.Halstead volume
4.Maximum Nesting Level
5.Number of Parameters
6.Maintainability Index

Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

Complexity
What is it? What brings it?
How to deal with it?
How to
measure it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

CYCLOMATIC COMPLEXITY
func doSomething(x: Int) -> Int {
let y = x + 10
return y
}
Easier
func doSomething(x: Int) -> Int {
let y = x + 10
if y > 0 {
return y
} else {
return 0
}
}
More difficult

NESTED DATA TYPES
EasierMore difficult
public struct AboutThisAppConfiguration {

public struct Entry {

public enum Content {
case modal(AboutLegalEntryCoordinator )
case confirmedDeepLink(ConfirmationAlertPresenter )
}

public let title: String
public let content: Content

public init(title: String, icon: UIImage? = nil, content: Content,
trackingIdentifier: String, accessibilityIdentifier : String) {
self.title = title
self.content = content
}
}

public let entries: [Entry]

public init(entries: [Entry]) {
self.entries = entries
}
}
public struct AboutThisAppConfiguration {

public let entries: [AboutThisAppConfigurationEntry ]
public init(entries: [Entry]) {
self.entries = entries
}
}
public struct AboutThisAppConfigurationEntry {

public let title: String
public let content: AboutThisAppConfigurationEntryContent
public init(title: String, icon: UIImage? = nil, content: Content,
trackingIdentifier: String, accessibilityIdentifier : String) {
self.title = title
self.content = content
}
}
public enum AboutThisAppConfigurationEntryContent {
case modal(AboutLegalEntryCoordinator )
case confirmedDeepLink(ConfirmationAlertPresenter )
}

NESTED `IF`
EasierMore difficult
if cardIds.count > 1 {
cardDismissHandler()
} else {
if insightsWidgetViewController != nil {
cardDismissHandler()
}
insightsWidgetCoordinatorDelegate ?.dismissWidget(at: insightsLocation)
}
if cardIds.count > 1 || insightsWidgetViewController != nil {
cardDismissHandler()
} else {
insightsWidgetCoordinatorDelegate ?.dismissWidget(at: insightsLocation)
}
if let cardId {
if let element = interaction. element(for: insightsLocation,
cardId: cardId) else {
return
}
} else {
tracker.trackElements(element,
page: analyticsPage(with: productName))
}
guard let cardId, let element = interaction.element(for: insightsLocation,
cardId: cardId) else {
return
}
tracker.trackElements(element, page: analyticsPage(with: productName))

LONG PARAMETER LIST
EasierMore difficult
public func trackFormStep(formId: String,
formStep: String,
formStatus: String,
transactionId: String?,
formOutcome: String?,
formType: String?) {
...
}
public func trackFormStep(content: FormStepTrackingContent ) {
...
}
public struct FormStepTrackingContent : Equatable, Sendable {
public let formId: String
public let formStep: String
public let formStatus: String
public let transactionId: String?
public let formOutcome: String?
public let formType: String?
}

COMPLEX CONDITIONS
if (featureToggles.toggle(for: .inAppReview) == .enabled &&
(numberOfLaunchesSinceLastPrompted >=
configuration.minimumRequiredLaunches ) ||
(dateProvider() >= nextPromptDate &&
applicationVersion != latestVersionPromptedForReview )) {
attemptToShowNativeRating (in: windowScene, completion: completion)
}
let featureIsActive = featureToggles.toggle(for: .inAppReview) == .enabled
let enoughLaunches = numberOfLaunchesSinceLastPrompted >=
configuration.minimumRequiredLaunches
let dateVersionConditionMet = ( dateProvider() >= nextPromptDate &&
applicationVersion != latestVersionPromptedForReview )
if featureIsActive && (enoughLaunches || dateVersionConditionMet) {
attemptToShowNativeRating (in: windowScene, completion: completion)
}
EasierMore difficult

SPECIFIC DECISIONS IN CODE
‣ High cyclomatic complexity
‣ High nesting level
‣ Long parameter list
‣ Complex conditions
‣ Nested if`s
‣ Code duplication
‣ Divergent change
‣ Shotgun surgery
‣ Feature Envy
‣ Data Clumps
…and many more

CODE SMELLS
‣ High cyclomatic complexity
‣ High nesting level
‣ Long parameter list
‣ Complex conditions
‣ Nested if`s
‣ Code duplication
‣ Divergent change
‣ Shotgun surgery
‣ Feature Envy
‣ Data Clumps
…and many more

REFACTORING

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

-Do you mostly need to keep parts
together in mind?
-Are the parts normally used together?
-Is it hard to understand one without
another
-Do they have shared state
(dependency, data model, backend)
-Do they have a common object of
manipulation
-Do they perform different operations?
-Do they perform on a different level
of abstraction?
-Do they have semantical separation
(general - special)?
TOGETHER SEPARATE(IF YES) (IF YES)

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
URL
Components
Query
Query Parameter
Host
Deep Link
Path
OBJECT
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

URL DeepLink
openURL()
Components
Host Path Query
Query Parameter
Specific Deep Link
OBJECT HIERARCHY

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host, configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}
let processedURL = urlComponents. url ?? url

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}
OBJECT
URL
Components
Query
Query Parameter
Host
Deep Link
Path
Specific Deep Link

func preprocessedURL(url: URL) -> URL {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return url
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host,
configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}

return urlComponents.url ?? url
}

func preprocessedURL(url: URL) -> URL {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return url
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host,
configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}

return urlComponents.url ?? url
}

func preprocessedURL(url: URL) -> URL {
guard var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL : true) else {
return url
}
if var queryItems = urlComponents. queryItems,
let marketingID = queryItems. first(where: { $0.name == tracker.marketingIDParamName }) {
tracker.marketingID = marketingID.value
queryItems = queryItems. filter { $0.name != tracker.marketingIDParamName }
}
urlComponents. queryItems = queryItems.isEmpty ? nil : queryItems

if let host = urlComponents. host,
configuration.allowedHosts.contains(host) {
var path = urlComponents. path
pathsToReplace.forEach {
path = path. replacingOccurrences (of: $0.initialPath, with: $0.replacementPath)
}
urlComponents. path = path
}

return urlComponents.url ?? url
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)

guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

processOriginAwareDeepLink (deepLink: deepLink)
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func processOriginAwareDeepLink (deepLink: DeepLink) {
if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)

guard var deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

deepLink = processedOriginAwareDeepLink (deepLink: deepLink)
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func processedOriginAwareDeepLink (deepLink: DeepLink) -> DeepLink {
if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
return originAwareDeepLink
}
return deepLink
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)
guard let deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)

guard var deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
openDeepLink(deepLink: deepLink)
}

func openDeepLink(deepLink: DeepLink) {
tracker.trackElements([ElementOnPage(type: "external deep link" ,
content: "deeplink",
action: Analytics.tappedAction,
position: "")],
page: Analytics.page)
urlHandler.open(applicationUrl: deepLink)
}

func open(url: URL) {
let processedURL = preprocessedURL(url: url)

guard var deepLink = urlHandler.knownExternalDeepLink(url: processedURL) else {
// show Alert
return
}

if let originAwareDeepLink = deepLink as? DeepLinkOriginAware {
originAwareDeepLink. shouldTriggerProfileSelector = configuration.shouldTriggerProfileSelector
}
openDeepLink(deepLink: deepLink)
}

URL DeepLink
openURL()
Components
Host Path Query
Query Parameter
Specific Deep Link
OBJECT HIERARCHY

-Do you mostly need to keep parts
together in mind?
-Are the parts normally used together?
-Is it hard to understand one without
another
-Do they have shared state
(dependency, data model, backend)
-Do they have a common object of
manipulation
-Do they perform different operations?
-Do they have a different level of
detailization?
-Do they have semantical separation
(general - special)?
TOGETHER SEPARATE(IF YES) (IF YES)

-Do you mostly need to keep parts
together in mind?
-Are the parts normally used together?
-Is it hard to understand one without
another
-Do they have shared state
(dependency, data model, backend)
-Do they have a common object of
manipulation
-Do they perform different operations?
-Do they have a different level of
detailization?
-Do they have semantical separation
(general - special)?
COHESION COUPLING
how closely related and focused responsibilities of an item are how tight are the connections between the independent items

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

PROBLEM-SOLUTION DISCREPANCY
▸Not optimal or typical
solution
▸Outdated solution (the
problem evolved)
▸Typical solution for
atypical problem

PROBLEM-SOLUTION DISCREPANCY
▸Inconsistency → Extra
cognitive load
▸Workarounds to align

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

OUR WORLD IS COMPLEX - SO WE MODEL IT

OUR WORLD IS COMPLEX - SO WE MODEL IT
“All models are wrong, but some are useful”
George Box
British statistician

CAR SIMULATOR
▸Car as a moving point
▸Car as a moving point (start/end, acceleration/deceleration)
▸Car as a 2D-model (2D-size)
▸Car as a 3D-model (3D-size)
▸Car as a (very complex) 3D-model (engine, brakes, tires,…)

PICKING PROPER ABSTRACTION LEVEL
Not enough
Details
Too much
Details
Your ideal
abstraction level
Not performing
correctly
Redundant
Added
Complexity

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

MVC
ARCHITECTURE
MVP
MVVM
Clean Architecture
VIP
RIBs

ARCHITECTURE
Presentation layer
Business layer
Data layer

ARCHITECTURE
Modularisation
Scalability
Testability
Dependency
injection Separation
of concerns
Single
responsibility

PRINCIPLES RELATED TO SIMPLICITY
▸KISS - Keep it simple, stupid
▸YAGNI - You ain't gonna  need it
▸DRY - Don't repeat yourself
▸SRP - Single responsibility principle (part of SOLID)
▸The Unix Philosophy
▸Idea of microservices

AGILE WORK PROCESS
Requirements
Design
Implementation
Testing
Launch

ARCHITECTURAL MISALIGNMENT

AGILE ARCHITECTURE
Evolutionary architecture
Fluid architecture
Design for change
Plug-in architecture
Software should be designed to
evolve over time as business
priorities change, customer
demands shift, and new
technologies emerge

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

COGNITIVE BIASES
- mental shortcuts that trick our brain into thinking
things are true, even when they’re not

COGNITIVE BIASES IN SOFTWARE DEVELOPMENT
▸Complexity bias - discarding the simple solutions
▸Foreseeing the future (over engineering, premature optimisations)
▸Conformism (following trends, Cargo-cults)
▸Anchoring Bias - fixating on one solution, sometimes subconsciously)
▸Confirmation Bias - picking the information based on the existing beliefs
▸Sunk Cost Fallacy - sticking to a solution because of the previous investments
▸Pattern recognition

CONTEXT-SOLUTION MISALIGNMENT

“Developers are drawn to complexity like moths to a flame, often
with the same outcome”
Neal Ford
author, director @ThoughtWorks
DEVELOPERS LIKE COMPLEXITY

DEVELOPERS LIKE COMPLEXITY
▸Simple solutions are boring

GOD SYNDROME

DEVELOPERS LIKE COMPLEXITY
▸Simple solutions are boring
▸God syndrome
▸Social reinforcement of complexity

REINVENTING THE WHEEL

DEVELOPERS LIKE COMPLEXITY
▸Simple solutions are boring
▸God syndrome
▸Social reinforcement of complexity
▸Love to reinventing the wheel
▸CV-driven development

(OVERCOMING) HUMAN NATURE
▸Self-reflect, realise, admit
▸Create safe space for discussion and learning.
▸Discuss your solutions more often
▸Be open to critique and contra-arguments
▸Utilise Decision-Support Systems
▸Rely more on data than on opinions and assumptions
▸Complexity bias: utilise Occam’s Razor, use iterative approach

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

ADDING NEW FEATURES
Additional complexity Multiplicative complexity
Feature 2Feature 3Feature 1
Complexity 1 Complexity 2 Complexity 3
Feature 4 Complexity 1* Complexity 2* Complexity3*
Feature 2Feature 3Feature 1
Complexity 1 Complexity 2 Complexity 3
Feature 4
Complexity 4
+ x

TESLER'S LAW
“Every application or every feature has an inherent amount of
complexity that cannot be removed or hidden. Instead, it must be
dealt with, either in product development or in user interaction"
Larry Tesler (mid-1980s)
computer scientist,
Ex Xerox PARC, Apple, Amazon, Yahoo!

TESLER'S LAW

Complexity
Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
What brings it?
How to deal with it?

Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code
Complexity
What brings it?
How to deal with it?

AI-GENERATED CODE - SITUATION
~35%-55% increase in speed of
writing code
Code written with AI-assistance
~10%~30% of our time we spend
on writing code

AI FOR CODE QUALITY
▸Static Code Analysis
▸Dynamic Code Analysis
▸Natural Language Processing (NLP)
▸Suggestions when writing code, or on
the code review

Complexity
What brings it?
How to deal with it?
Specific decisions in codeLogic/code distribution
Problem-solution discrepancyWrong abstraction level
Architectural approach Human nature
Product evolution AI-generated code

Inconsistencies
Bad interfaces
Organisation Dependencies
Technical debt Assumptions
Essentialism Prioritisation
MORE SOURCES OF COMPLEXITY
…AND WAYS TO DEAL WITH IT
DecompositionArtificial restrictions
Explicitness
Decreasing the scope
Learning
Simplicity-first mindset

INCEPTION

IF NOT MANAGED
COMPLEXITY MAY TURN OUR PROJECTS
INTO CHAOS
Tags