Coding Fast and Slow: Applying Kahneman’s Insights to Improve Development Practices and Efficiency

A presentation at Geecon in May 2025 in Kraków, Poland by Baruch Sadogursky

Slide 1

Slide 1

Coding Fast and Slow

Slide 2

Slide 2

Slide 3

Slide 3

Prof. Daniel Kahneman Mar 5, 1934 – Mar 27, 2024

Slide 4

Slide 4

“for having integrated insights from psychological research into economic science, especially concerning human judgment and decision-making under uncertainty”

Slide 5

Slide 5

Economics? × × × × ECON101: People are rational; that’s why markets work. - Nope, they aren’t; here’s 50 years of study. - Oh, wow, they really aren’t. It probably has a profound effect on economics! Here’s a Nobel Prize for ya! ECON101: People are rational; that’s why markets work.

Slide 6

Slide 6

Slide 7

Slide 7

A bat and a ball cost $1.10 in total. The bat costs $1 more than the ball. How much does the ball cost?

Slide 8

Slide 8

How much does the ball cost? 0.10 + (1.00+0.10) = 1.20 0.05 + (1.00+0.05) = 1.10

Slide 9

Slide 9

Baruch Sadogursky - @jbaru ch × Head of DevRel at TuxCare (I am hiring!) × Developer Productivity Nerd × Development -> DevOps -> #DevProd

Slide 10

Slide 10

shownotes × × × × speaking.jbaru.ch Slides Video All the links!

Slide 11

Slide 11

Two systems x x x x x Fast Intuitive Automatic Emotional Cheap and eager x x x x x Slow Analytical Controlled Logical Expensive and lazy

Slide 12

Slide 12

Wait, let’s think about that! I recognize this pattern!

Slide 13

Slide 13

class UniqueWords { public static void main(String[] args) throws IOException { if (args.length != 1) { throw new IllegalArgumentException(“Invalid argument”); } Set<String> words = new HashSet<>(); for (String line : Files.readAllLines(Path.of(args[0]))) { // Ignore commented lines if (!line.startsWith(“#”) || !line.startsWith(“//”)) { Collections.addAll(words, line.split(“\W+”)); } } System.out.println(”Count of unique words: ” + words.size()); } }

Slide 14

Slide 14

Slide 15

Slide 15

Slide 16

Slide 16

Slide 17

Slide 17

Slide 18

Slide 18

Slide 19

Slide 19

You have “mental fuel”

Slide 20

Slide 20

Slide 21

Slide 21

Slide 22

Slide 22

Slide 23

Slide 23

Attention and Capacity Limits in Perception: A Cellular Metabolism Account × × × × BNIRS and oxCCO Cellular Metabolism as Mental Fuel Finite Energy Supply High Load Mode vs Low Load Mode

Slide 24

Slide 24

Which system do we use for co d ing? x x x x x Fast Intuitive Automatic Emotional Cheap and Eager x x x x x Slow Analytical Controlled Logical Expensive and Lazy

Slide 25

Slide 25

Slide 26

Slide 26

effortless

Slide 27

Slide 27

Slide 28

Slide 28

Slide 29

Slide 29

Slide 30

Slide 30

public class DiscountCalculator { public static void main(String[] args) { calculateDiscount(100, 15); } public static void calculateDiscount(double price, double discount) { double finalPrice = price - (price * discount / 100); System.out.println(“The final price after a ” + discount + “% discount is: ” + finalPrice); } }

Slide 31

Slide 31

How Many Triangles?

Slide 32

Slide 32

public class TaxCalculator { public static void main(String[] args) { calculateTax(100, 5); } } public static void calculateTax(double amount, double taxRate) { double totalAmount = amount + (amount * taxRate); System.out.println(“The total amount with tax: ” + totalAmount); }

Slide 33

Slide 33

The problem: × You deplete your fuel by contextswitching × You’re not in the flow because of context-switching × Loose-loose: you need more fuel needed, but you have less fuel

Slide 34

Slide 34

Slide 35

Slide 35

When we are tired, we produce worse code × “Developers are cutting corners on quality when fatigued.” (duh)

Slide 36

Slide 36

Slide 37

Slide 37

But We don’t know when to qu x x x x it Default parole decision: deny Fewer paroles when judges are tired/hungry Granting parole needs System 2 thinking Judges unaware of switching to System 1

Slide 38

Slide 38

Real-life outcome: you run on system one x x x x x Fast Intuitive Automatic Emotional Cheap and Eager x x x x x Slow Analytical Controlled Logical Expensive and Lazy

Slide 39

Slide 39

Slide 40

Slide 40

Real-life outcome: you run on system one x x x x x Fast Intuitive Automatic Emotional Cheap and Eager x x x x x Slow Analytical Controlled Logical Expensive and Lazy

Slide 41

Slide 41

Slide 42

Slide 42

Slide 43

Slide 43

× × × × × 10,000 hours of practice mov e some system 2 activities to sy stem 1 Driving Golf Tennis Music playing Safety drills for fire fighters

Slide 44

Slide 44

Wait, let’s think about that! I recognize this pattern!

Slide 45

Slide 45

Real-life outcome: you run on system one x x x x x Fast Intuitive Automatic Emotional Cheap and Eager x x x x x Slow Analytical Controlled Logical Expensive and Lazy

Slide 46

Slide 46

Slide 47

Slide 47

Which sucks less? Bad code “OK” code

Slide 48

Slide 48

The problem of “ok code” It looks “OK” to us System 1 It looks “OK” to PR review System 1 It looks “OK” to pipelines System 1

Slide 49

Slide 49

Next thing you know: You have an “ok” product

Slide 50

Slide 50

Invest in The goal: Have enough mental fuel to last all day

Slide 51

Slide 51

Time Management Strategies × Time Blocking × Pomodoro Technique

Slide 52

Slide 52

Slide 53

Slide 53

Time Management Strategies × Time Blocking × Pomodoro Technique × Task Batching

Slide 54

Slide 54

× Block time × Batch tasks × Allow access

Slide 55

Slide 55

Mindfulness and Cognitive Pra ctices × Mindfulness and Meditation × Reflective Practices × Single-tasking

Slide 56

Slide 56

Workspace and Interruption M anagement × Workspace Organization × Notification Management × Prioritization Techniques

Slide 57

Slide 57

Physical and Mental Well-bein g × Physical Exercise × Breaks and Downtime

Slide 58

Slide 58

Slide 59

Slide 59

Slide 60

Slide 60

Caffeine nap Drink caffeine Dark, cold, quite room Set alarm to 20 minutes Reserves taped!

Slide 61

Slide 61

Coding practices × Automate everything × Shorten feedback loops × Delegate to tools!

Slide 62

Slide 62

Use AI smartly! Right tool – right job Not all tools are created equal. Go deep, not wide ATM specialized beats generalized Local ai = control Better control and privacy.

Slide 63

Slide 63

Agentic AI is RAD if it does the right thing

Slide 64

Slide 64

Slide 65

Slide 65

Coding practices × × × × Automate everything Shorten feedback loops Delegate to tools! Delegate to pros!

Slide 66

Slide 66

when to delegate No Is it easy to learn? Do you have time to learn it? Delegate! Is the task your core expertise? No No Yes Yes Yes Learn it! Do it!

Slide 67

Slide 67

Slide 68

Slide 68

Slide 69

Slide 69

Save mental fuel! × × × × × Time management Workspace management Mental wellbeing Engineer fewer interruptions Delegate when needed

Slide 70

Slide 70

THANKS! Q&A and Twitter X/Bsky/Mastodon/LinkedIn ads: x @jbaruch x @Geecon x speaking.jbaru.ch