Slide 1

Slide 1 text

Alles bleibt anders 
 Timeless Wisdom for Software Developers Frank Gerberding, 05.05.202

Slide 2

Slide 2 text

@ MilesBehind69 2 "Give someone a program, you frustrate them for a day; 
 teach them how to program, you frustrate them for a lifetime." ( David Leinweber)

Slide 3

Slide 3 text

@ MilesBehind69 3

Slide 4

Slide 4 text

@ MilesBehind69 4 Muss ich ständig etwas Neues lernen? 
 Muss ich ständig von Neuem lernen? 𐄂 ✓

Slide 5

Slide 5 text

@ MilesBehind69 5 Small is beautiful „Small is beautiful, Size is the #1 enemy of agility; keep your systems as small as you reasonably can (but no smaller)“ ( Stefan Tilkov)

Slide 6

Slide 6 text

@ MilesBehind69 6 Methode aus Code-Review

Slide 7

Slide 7 text

@ MilesBehind69 7 Single Responsibility Principle „Do not try to do everything. Do one thing well.“ ( Steve Jobs)

Slide 8

Slide 8 text

@ MilesBehind69 8 Single Responsibility Principle book flight 
 cancel flight FlightService Client Code FlightRepository CancelFlight FlightRepository TimeService CustomerService MessageService book flight cancel flight store bookings find customer store 
 bookings get system time send messages BookFlight

Slide 9

Slide 9 text

@ MilesBehind69 9 Side effects can be worse than the disease „Can placebos cause side effects? If so, are the side effects real?“ ( George Carlin)

Slide 10

Slide 10 text

@ MilesBehind69 10 Side effects can be worse than the disease Component-A Client Code Component-B Component-A call result 
 (depends on state of A and B ) call result 
 (depends on 
 state of B ) Component-B modifies some 
 internal data of B modifies some 
 internal data of A call result 
 (depends only on call arguments) call result 
 (depends only on call arguments)

Slide 11

Slide 11 text

@ MilesBehind69 11 Avoid accidental complexity “Any darn fool can make something complex; it takes a genius to make something simple.” ( Pete Seeger)

Slide 12

Slide 12 text

@ MilesBehind69 12 Avoid accidental complexity A Problem 
 Complexity Minimum 
 Solution 
 Complexity Accidental 
 Solution 
 Complexity

Slide 13

Slide 13 text

@ MilesBehind69 13 Dependencies prevent flexibility „The cheapest, fastest, and most reliable components are those that aren’t there.“ ( Gordon Bell)

Slide 14

Slide 14 text

@ MilesBehind69 14 Dependencies prevent flexibility depends on Component Component Component Component Component Component Component Component Component depends on Component Component Component Component Component Component Component transitively depends on

Slide 15

Slide 15 text

@ MilesBehind69 15 Divide and conquer through modularization „The whole is more than the sum of its parts.“ ( Aristoteles)

Slide 16

Slide 16 text

@ MilesBehind69 Base-Application 16 Divide and conquer through modularization Module-A - Interface Module-A Module-B - Interface Module-B Module-C - Interface Module-C Plugin-A Plugin-B Plugin-C Plugin-D Plugin-E

Slide 17

Slide 17 text

@ MilesBehind69 17 Loose coupling prevents fire of change from spreading „Architecture is the tension 
 between coupling and cohesion.“ ( Neal Ford)

Slide 18

Slide 18 text

@ MilesBehind69 18 Loose coupling prevents fire of change from spreading depends on Abstraction Component-A Component-B Component-A Component-B depends on implements

Slide 19

Slide 19 text

@ MilesBehind69 19 The Open-Closed-Principle prepares you for the future „A good design is not the one that correctly predicts the future, it’s one that makes adapting to the future affordable.“ ( Venkat Subramaniam)

Slide 20

Slide 20 text

@ MilesBehind69 20 The Open-Closed-Principle prepares you for the future Abstraction Component Component depends on implements Component Component implements implements

Slide 21

Slide 21 text

@ MilesBehind69 21 Ignorance is a bliss „I know this steak doesn't exist. 
 I know that when I put it in my mouth, 
 the Matrix is telling my brain that it is juicy and delicious. 
 After nine years, you know what I realize? 
 Ignorance is bliss.“ ( Cypher, The Matrix)

Slide 22

Slide 22 text

@ MilesBehind69 What ( Visible) 22 Ignorance is a bliss How 
 ( Hidden) Client 
 Code

Slide 23

Slide 23 text

@ MilesBehind69 23 Avoid unnecessary work „Remember that there is no code faster 
 than no code.“ ( Taligent’s Guide to Designing Programs)

Slide 24

Slide 24 text

@ MilesBehind69 24 Avoid unnecessary work persons.filter {"a" in it.lastName } .map {"${it.firstName} ${it.lastName}" } .filter {it.length > 15 } .take(5) persons.stream( ) .filter {"a" in it.lastName } .map {"${it.firstName} ${it.lastName}" } .filter {it.length > 15 } .limit(5 ) .collect(Collectors.toList()) persons.asSequence( ) .filter {"a" in it.lastName } .map {"${it.firstName} ${it.lastName}" } .filter {it.length > 15 } .take(5 ) .toList() Evaluation Duration 0 ms 20 ms 40 ms 60 ms Person Count 100 10.000 1.000.000 Kotlin List Kotlin Sequence/Java Stream Kotlin 
 Lists Kotlin 
 Sequences Java 
 Streams

Slide 25

Slide 25 text

@ MilesBehind69 25 I/O is slow „Nothing travels faster than the speed of light with the possible exception of bad news.“ ( Douglas Adams)

Slide 26

Slide 26 text

@ MilesBehind69 26 I/O is slow 1 MByte/sec 100 MByte/sec 10.000 MByte/sec 2000 2010 2020 Storage Network Memory 50 ⨉ 400 ⨉

Slide 27

Slide 27 text

@ MilesBehind69 27 Quality leads to productivity „The paradox is that when you focus on productivity, long- term improvements are rarely made. 
 On the other hand, when you focus on quality, productivity improves continuously.“ ( John Seddon)

Slide 28

Slide 28 text

@ MilesBehind69 Aufwand pro Feature Zeit Kein Fokus auf Qualität/Tests Fokus auf Qualität/Tests 28 Quality leads to productivity Mehraufwand mit Fokus auf Qualität Mehraufwand ohne Fokus 
 auf Qualität Produktivität

Slide 29

Slide 29 text

@ MilesBehind69 29 Immutability is your code’s armor „One of the most difficult elements of program design 
 is reasoning about the possible states of complex objects. Reasoning about the state of immutable objects, 
 on the other hand, is trivial.“ ( Brian Goetz)

Slide 30

Slide 30 text

@ MilesBehind69 30 Immutability is your code’s armor ImmutableItem ImmutableItem MutableItem modify modify = copy ImmutableCollection ImmutableCollection modify = create changes reference previous version

Slide 31

Slide 31 text

@ MilesBehind69 31 Improving testability improves design „Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.“ ( John F. Woods)

Slide 32

Slide 32 text

@ MilesBehind69 32 Improving testability improves design Loose Coupling Immutability Keep things small Open-Closed- Principle Avoid Dependencies Single Responsibility Principle Quality is 
 Productivity Make things 
 easily testable Avoid side effects

Slide 33

Slide 33 text

@ MilesBehind69 33 Good names improve readability „There are 2 hard problems in computer science: 
 cache invalidation, 
 naming things, 
 and off-by-1 errors.“ ( Leon Bambrick)

Slide 34

Slide 34 text

@ MilesBehind69 34 Documentation is a love letter to your future self „A person who won't read 
 has no advantage over one who can't read.“ ( Mark Twain)

Slide 35

Slide 35 text

@ MilesBehind69 35 Modularization Loose Coupling Immutability Keep things small Open-Closed- Principle I/O is slow Lazy Evaluation Avoid Dependencies Quality is 
 Productivity Make things 
 easily testable Name things well Documentation Avoid accidental 
 complexity Avoid side effects Information Hiding Single Responsibility Principle

Slide 36

Slide 36 text

@ MilesBehind69 36 „One of the best programming skills you can have 
 is knowing when to walk away for awhile.“ ( Oscar Godson)

Slide 37

Slide 37 text

Vielen Dank für 
 Eure Aufmerksamkeit! https://speakerdeck.com/milesbehind69 
 http://frank.gerberding.blog https://twitter.com/milesbehin69 Zeichnungen von Sandra & Frank Gerberding