SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Let the symbols do the work
Computing's core challenge is how not to make a mess of it
Move fast and break things
Think like a computer
func inlineCount(fetchedCount: Int, totalCount: Int) -> Int {
if (fetchedCount == totalCount) {
return fetchedCount
}
let inlineCount = fetchedCount - 1
let overflowCount = totalCount - inlineCount
if overflowCount < minimumOverflowCount {
return totalCount - minimumOverflowCount
} else {
return inlineCount
}
}
func inlineCount(fetchedCount: Int, totalCount: Int) -> Int {
if (fetchedCount == totalCount) {
return fetchedCount
}
let inlineCount = fetchedCount - 1
if totalCount - inlineCount < minimumOverflowCount {
return totalCount - minimumOverflowCount
} else {
return inlineCount
}
}
func inlineCount(fetchedCount: Int, totalCount: Int) -> Int {
if (fetchedCount == totalCount) {
return fetchedCount
}
let inlineCount = fetchedCount - 1
if totalCount - minimumOverflowCount < inlineCount {
return totalCount - minimumOverflowCount
} else {
return inlineCount
}
}
func inlineCount(fetchedCount: Int, totalCount: Int) -> Int {
if (fetchedCount == totalCount) {
return fetchedCount
}
let inlineCount = fetchedCount - 1
return min(inlineCount, totalCount - minimumOverflowCount)
}
func inlineCount(fetchedCount: Int, totalCount: Int) -> Int {
if (fetchedCount == totalCount) {
return fetchedCount
} else {
return min(fetchedCount - 1, totalCount - minimumOverflowCount)
}
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
if let selectedIndexPath = selectedIndexPath {
if let tappedIndexPath = tappedIndexPath {
if tappedIndexPath == selectedIndexPath {
return [selectedIndexPath]
} else {
return [selectedIndexPath, tappedIndexPath]
}
} else {
return [selectedIndexPath]
}
} else {
if let tappedIndexPath = tappedIndexPath {
return [tappedIndexPath]
} else {
return []
}
}
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
var rows = Set<NSIndexPath>()
if let selectedIndexPath = selectedIndexPath {
if let tappedIndexPath = tappedIndexPath {
if tappedIndexPath == selectedIndexPath {
rows.insert(selectedIndexPath)
} else {
rows.insert(selectedIndexPath)
rows.insert(tappedIndexPath)
}
} else {
rows.insert(selectedIndexPath)
}
} else {
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
}
return rows
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
var rows = Set<NSIndexPath>()
if let selectedIndexPath = selectedIndexPath {
if let tappedIndexPath = tappedIndexPath {
if tappedIndexPath == selectedIndexPath {
rows.insert(selectedIndexPath)
rows.insert(tappedIndexPath)
} else {
rows.insert(selectedIndexPath)
rows.insert(tappedIndexPath)
}
} else {
rows.insert(selectedIndexPath)
}
} else {
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
}
return rows
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
var rows = Set<NSIndexPath>()
if let selectedIndexPath = selectedIndexPath {
if let tappedIndexPath = tappedIndexPath {
rows.insert(selectedIndexPath)
rows.insert(tappedIndexPath)
} else {
rows.insert(selectedIndexPath)
}
} else {
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
}
return rows
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
var rows = Set<NSIndexPath>()
if let selectedIndexPath = selectedIndexPath {
rows.insert(selectedIndexPath)
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
} else {
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
}
return rows
}
func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> {
var rows = Set<NSIndexPath>()
if let selectedIndexPath = selectedIndexPath {
rows.insert(selectedIndexPath)
}
if let tappedIndexPath = tappedIndexPath {
rows.insert(tappedIndexPath)
}
return rows
}
if condition {
doSomething()
doSomethingElse()
} else {
doSomething()
}
➡
doSomething()
if condition {
doSomethingElse()
}
Add Parameter - Change Bidirectional Association to Unidirectional - Change Reference to Value - Change Unidirectional Association to Bidirectional
- Change Value to Reference - Collapse Hierarchy - Consolidate Conditional Expression - Consolidate Duplicate Conditional Fragments - Decompose
Conditional - Duplicate Observed Data - Dynamic Method Definition - Eagerly Initialized Attribute - Encapsulate Collection - Encapsulate Downcast -
Encapsulate Field - Extract Class - Extract Interface - Extract Method - Extract Module - Extract Subclass - Extract Superclass - Extract Surrounding
Method - Extract Variable - Form Template Method - Hide Delegate - Hide Method - Inline Temp - Inline Class - Inline Method - Inline Module -
Introduce Assertion - Introduce Class Annotation - Introduce Expression Builder - Introduce Foreign Method - Introduce Gateway - Introduce Local
Extension - Introduce Named Parameter - Introduce Null Object - Introduce Parameter Object - Isolate Dynamic Receptor - Lazily Initialized Attribute
- Move Eval from Runtime to Parse Time - Move Field - Move Method - Parameterize Method - Preserve Whole Object - Pull Up Constructor Body - Pull
Up Field - Pull Up Method - Push Down Field - Push Down Method - Recompose Conditional - Remove Assignments to Parameters - Remove Control
Flag - Remove Middle Man - Remove Named Parameter - Remove Parameter - Remove Setting Method - Remove Unused Default Parameter - Rename
Method - Replace Abstract Superclass with Module - Replace Array with Object - Replace Conditional with Polymorphism - Replace Constructor with
Factory Method - Replace Data Value with Object - Replace Delegation With Hierarchy - Replace Delegation with Inheritance - Replace Dynamic
Receptor with Dynamic Method Definition - Replace Error Code with Exception - Replace Exception with Test - Replace Hash with Object - Replace
Inheritance with Delegation - Replace Loop with Collection Closure Method - Replace Magic Number with Symbolic Constant - Replace Method with
Method Object - Replace Nested Conditional with Guard Clause - Replace Parameter with Explicit Methods - Replace Parameter with Method -
Replace Record with Data Class - Replace Subclass with Fields - Replace Temp with Chain - Replace Temp with Query - Replace Type Code with Class
- Replace Type Code with Module Extension - Replace Type Code With Polymorphism - Replace Type Code with State/Strategy - Replace Type Code
with Subclasses - Self Encapsulate Field - Separate Query from Modifier - Split Temporary Variable - Substitute Algorithm
Sure why not?
A leap of faith
The fear of introducing the wrong abstraction
The code is the truth
Let the computer do the work?
The Refactoring Browser
virtual bool VisitDeclStmt(DeclStmt *st) {
if (st->isSingleDecl()) {
if (VarDecl *varDecl = dyn_cast<VarDecl>(st->getSingleDecl())) {
if (varDecl->getName() == variableName) {
value = rewriter.getRewrittenText(varDecl->getInit()->getSourceRange());
rewriter.RemoveText(st->getSourceRange());
}
}
}
return true;
}
virtual bool VisitExpr(Expr *expr) {
if (DeclRefExpr *refExpr = dyn_cast<DeclRefExpr>(expr)) {
if (refExpr->getNameInfo().getName().getAsString() == variableName) {
rewriter.ReplaceText(refExpr->getSourceRange(), value);
}
}
return true;
}
What's next?
What else?
Questions

Weitere ähnliche Inhalte

Was ist angesagt?

Humble introduction to category theory in haskell
Humble introduction to category theory in haskellHumble introduction to category theory in haskell
Humble introduction to category theory in haskellJongsoo Lee
 
Functional programming basics
Functional programming basicsFunctional programming basics
Functional programming basicsopenbala
 
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016Comsysto Reply GmbH
 
Gpars concepts explained
Gpars concepts explainedGpars concepts explained
Gpars concepts explainedVaclav Pech
 
Applying Real-time SQL Changes in your Hazelcast Data Grid
Applying Real-time SQL Changes in your Hazelcast Data GridApplying Real-time SQL Changes in your Hazelcast Data Grid
Applying Real-time SQL Changes in your Hazelcast Data GridHazelcast
 
Swift Tutorial 2
Swift Tutorial  2Swift Tutorial  2
Swift Tutorial 2Jintin Lin
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovyTed Leung
 
Implementing pseudo-keywords through Functional Programing
Implementing pseudo-keywords through Functional ProgramingImplementing pseudo-keywords through Functional Programing
Implementing pseudo-keywords through Functional ProgramingVincent Pradeilles
 
Grid search (parameter tuning)
Grid search (parameter tuning)Grid search (parameter tuning)
Grid search (parameter tuning)Akhilesh Joshi
 
The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185Mahmoud Samir Fayed
 
Lessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmarkLessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmarkSergey Petrunya
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript ObjectsReem Alattas
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions Reem Alattas
 
6. Generics. Collections. Streams
6. Generics. Collections. Streams6. Generics. Collections. Streams
6. Generics. Collections. StreamsDEVTYPE
 
MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZENorvald Ryeng
 
Python For Data Science Cheat Sheet
Python For Data Science Cheat SheetPython For Data Science Cheat Sheet
Python For Data Science Cheat SheetKarlijn Willems
 

Was ist angesagt? (20)

Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Humble introduction to category theory in haskell
Humble introduction to category theory in haskellHumble introduction to category theory in haskell
Humble introduction to category theory in haskell
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
Functional programming basics
Functional programming basicsFunctional programming basics
Functional programming basics
 
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
Spark RDD-DF-SQL-DS-Spark Hadoop User Group Munich Meetup 2016
 
Gpars concepts explained
Gpars concepts explainedGpars concepts explained
Gpars concepts explained
 
R: Apply Functions
R: Apply FunctionsR: Apply Functions
R: Apply Functions
 
Applying Real-time SQL Changes in your Hazelcast Data Grid
Applying Real-time SQL Changes in your Hazelcast Data GridApplying Real-time SQL Changes in your Hazelcast Data Grid
Applying Real-time SQL Changes in your Hazelcast Data Grid
 
Java operators
Java operatorsJava operators
Java operators
 
Swift Tutorial 2
Swift Tutorial  2Swift Tutorial  2
Swift Tutorial 2
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - Groovy
 
Implementing pseudo-keywords through Functional Programing
Implementing pseudo-keywords through Functional ProgramingImplementing pseudo-keywords through Functional Programing
Implementing pseudo-keywords through Functional Programing
 
Grid search (parameter tuning)
Grid search (parameter tuning)Grid search (parameter tuning)
Grid search (parameter tuning)
 
The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185
 
Lessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmarkLessons for the optimizer from running the TPC-DS benchmark
Lessons for the optimizer from running the TPC-DS benchmark
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 
6. Generics. Collections. Streams
6. Generics. Collections. Streams6. Generics. Collections. Streams
6. Generics. Collections. Streams
 
MySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZEMySQL 8.0 EXPLAIN ANALYZE
MySQL 8.0 EXPLAIN ANALYZE
 
Python For Data Science Cheat Sheet
Python For Data Science Cheat SheetPython For Data Science Cheat Sheet
Python For Data Science Cheat Sheet
 

Ähnlich wie MCE^3 - Hannes Verlinde - Let The Symbols Do The Work

PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)Jerome Eteve
 
Legacy lambda code
Legacy lambda codeLegacy lambda code
Legacy lambda codePeter Lawrey
 
GeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetGeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetJose Perez
 
Flink Batch Processing and Iterations
Flink Batch Processing and IterationsFlink Batch Processing and Iterations
Flink Batch Processing and IterationsSameer Wadkar
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2jomerson remorosa
 
Threads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSThreads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSTechWell
 
Generics and Inference
Generics and InferenceGenerics and Inference
Generics and InferenceRichard Fox
 
I want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfI want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfbermanbeancolungak45
 
KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7phuphax
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on AndroidTomáš Kypta
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJavaJobaer Chowdhury
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Cocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftCocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftMichele Titolo
 

Ähnlich wie MCE^3 - Hannes Verlinde - Let The Symbols Do The Work (20)

SOLID Java Code
SOLID Java CodeSOLID Java Code
SOLID Java Code
 
PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
 
Legacy lambda code
Legacy lambda codeLegacy lambda code
Legacy lambda code
 
GeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetGeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheet
 
Flink Batch Processing and Iterations
Flink Batch Processing and IterationsFlink Batch Processing and Iterations
Flink Batch Processing and Iterations
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
05-stack_queue.ppt
05-stack_queue.ppt05-stack_queue.ppt
05-stack_queue.ppt
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2
 
Threads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOSThreads, Queues, and More: Async Programming in iOS
Threads, Queues, and More: Async Programming in iOS
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Generics and Inference
Generics and InferenceGenerics and Inference
Generics and Inference
 
I want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdfI want help in the following C++ programming task. Please do coding .pdf
I want help in the following C++ programming task. Please do coding .pdf
 
Twig tips and tricks
Twig tips and tricksTwig tips and tricks
Twig tips and tricks
 
KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7KMUTNB - Internet Programming 6/7
KMUTNB - Internet Programming 6/7
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 
Reactive programming with RxJava
Reactive programming with RxJavaReactive programming with RxJava
Reactive programming with RxJava
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Cocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftCocoa Design Patterns in Swift
Cocoa Design Patterns in Swift
 

Kürzlich hochgeladen

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

MCE^3 - Hannes Verlinde - Let The Symbols Do The Work

  • 1. Let the symbols do the work
  • 2. Computing's core challenge is how not to make a mess of it
  • 3. Move fast and break things
  • 4.
  • 5.
  • 6. Think like a computer
  • 7.
  • 8. func inlineCount(fetchedCount: Int, totalCount: Int) -> Int { if (fetchedCount == totalCount) { return fetchedCount } let inlineCount = fetchedCount - 1 let overflowCount = totalCount - inlineCount if overflowCount < minimumOverflowCount { return totalCount - minimumOverflowCount } else { return inlineCount } }
  • 9. func inlineCount(fetchedCount: Int, totalCount: Int) -> Int { if (fetchedCount == totalCount) { return fetchedCount } let inlineCount = fetchedCount - 1 if totalCount - inlineCount < minimumOverflowCount { return totalCount - minimumOverflowCount } else { return inlineCount } }
  • 10. func inlineCount(fetchedCount: Int, totalCount: Int) -> Int { if (fetchedCount == totalCount) { return fetchedCount } let inlineCount = fetchedCount - 1 if totalCount - minimumOverflowCount < inlineCount { return totalCount - minimumOverflowCount } else { return inlineCount } }
  • 11. func inlineCount(fetchedCount: Int, totalCount: Int) -> Int { if (fetchedCount == totalCount) { return fetchedCount } let inlineCount = fetchedCount - 1 return min(inlineCount, totalCount - minimumOverflowCount) }
  • 12. func inlineCount(fetchedCount: Int, totalCount: Int) -> Int { if (fetchedCount == totalCount) { return fetchedCount } else { return min(fetchedCount - 1, totalCount - minimumOverflowCount) } }
  • 13.
  • 14. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { if let selectedIndexPath = selectedIndexPath { if let tappedIndexPath = tappedIndexPath { if tappedIndexPath == selectedIndexPath { return [selectedIndexPath] } else { return [selectedIndexPath, tappedIndexPath] } } else { return [selectedIndexPath] } } else { if let tappedIndexPath = tappedIndexPath { return [tappedIndexPath] } else { return [] } } }
  • 15. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { var rows = Set<NSIndexPath>() if let selectedIndexPath = selectedIndexPath { if let tappedIndexPath = tappedIndexPath { if tappedIndexPath == selectedIndexPath { rows.insert(selectedIndexPath) } else { rows.insert(selectedIndexPath) rows.insert(tappedIndexPath) } } else { rows.insert(selectedIndexPath) } } else { if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } } return rows }
  • 16. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { var rows = Set<NSIndexPath>() if let selectedIndexPath = selectedIndexPath { if let tappedIndexPath = tappedIndexPath { if tappedIndexPath == selectedIndexPath { rows.insert(selectedIndexPath) rows.insert(tappedIndexPath) } else { rows.insert(selectedIndexPath) rows.insert(tappedIndexPath) } } else { rows.insert(selectedIndexPath) } } else { if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } } return rows }
  • 17. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { var rows = Set<NSIndexPath>() if let selectedIndexPath = selectedIndexPath { if let tappedIndexPath = tappedIndexPath { rows.insert(selectedIndexPath) rows.insert(tappedIndexPath) } else { rows.insert(selectedIndexPath) } } else { if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } } return rows }
  • 18. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { var rows = Set<NSIndexPath>() if let selectedIndexPath = selectedIndexPath { rows.insert(selectedIndexPath) if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } } else { if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } } return rows }
  • 19. func affectedRows(tappedIndexPath: NSIndexPath?) -> Set<NSIndexPath> { var rows = Set<NSIndexPath>() if let selectedIndexPath = selectedIndexPath { rows.insert(selectedIndexPath) } if let tappedIndexPath = tappedIndexPath { rows.insert(tappedIndexPath) } return rows }
  • 20. if condition { doSomething() doSomethingElse() } else { doSomething() } ➡ doSomething() if condition { doSomethingElse() }
  • 21. Add Parameter - Change Bidirectional Association to Unidirectional - Change Reference to Value - Change Unidirectional Association to Bidirectional - Change Value to Reference - Collapse Hierarchy - Consolidate Conditional Expression - Consolidate Duplicate Conditional Fragments - Decompose Conditional - Duplicate Observed Data - Dynamic Method Definition - Eagerly Initialized Attribute - Encapsulate Collection - Encapsulate Downcast - Encapsulate Field - Extract Class - Extract Interface - Extract Method - Extract Module - Extract Subclass - Extract Superclass - Extract Surrounding Method - Extract Variable - Form Template Method - Hide Delegate - Hide Method - Inline Temp - Inline Class - Inline Method - Inline Module - Introduce Assertion - Introduce Class Annotation - Introduce Expression Builder - Introduce Foreign Method - Introduce Gateway - Introduce Local Extension - Introduce Named Parameter - Introduce Null Object - Introduce Parameter Object - Isolate Dynamic Receptor - Lazily Initialized Attribute - Move Eval from Runtime to Parse Time - Move Field - Move Method - Parameterize Method - Preserve Whole Object - Pull Up Constructor Body - Pull Up Field - Pull Up Method - Push Down Field - Push Down Method - Recompose Conditional - Remove Assignments to Parameters - Remove Control Flag - Remove Middle Man - Remove Named Parameter - Remove Parameter - Remove Setting Method - Remove Unused Default Parameter - Rename Method - Replace Abstract Superclass with Module - Replace Array with Object - Replace Conditional with Polymorphism - Replace Constructor with Factory Method - Replace Data Value with Object - Replace Delegation With Hierarchy - Replace Delegation with Inheritance - Replace Dynamic Receptor with Dynamic Method Definition - Replace Error Code with Exception - Replace Exception with Test - Replace Hash with Object - Replace Inheritance with Delegation - Replace Loop with Collection Closure Method - Replace Magic Number with Symbolic Constant - Replace Method with Method Object - Replace Nested Conditional with Guard Clause - Replace Parameter with Explicit Methods - Replace Parameter with Method - Replace Record with Data Class - Replace Subclass with Fields - Replace Temp with Chain - Replace Temp with Query - Replace Type Code with Class - Replace Type Code with Module Extension - Replace Type Code With Polymorphism - Replace Type Code with State/Strategy - Replace Type Code with Subclasses - Self Encapsulate Field - Separate Query from Modifier - Split Temporary Variable - Substitute Algorithm
  • 23. A leap of faith
  • 24. The fear of introducing the wrong abstraction
  • 25. The code is the truth
  • 26. Let the computer do the work?
  • 28.
  • 29.
  • 30. virtual bool VisitDeclStmt(DeclStmt *st) { if (st->isSingleDecl()) { if (VarDecl *varDecl = dyn_cast<VarDecl>(st->getSingleDecl())) { if (varDecl->getName() == variableName) { value = rewriter.getRewrittenText(varDecl->getInit()->getSourceRange()); rewriter.RemoveText(st->getSourceRange()); } } } return true; } virtual bool VisitExpr(Expr *expr) { if (DeclRefExpr *refExpr = dyn_cast<DeclRefExpr>(expr)) { if (refExpr->getNameInfo().getName().getAsString() == variableName) { rewriter.ReplaceText(refExpr->getSourceRange(), value); } } return true; }