Of representation and interpretation: A unified theory

Many hard problems in programming originate from one single source: not properly distinguishing the representation of data from the way it is interpreted. Have you ever written code that filters $_GET for SQL injection attempts? Struggled with timezones? Tried to get escaping right for Javascript in HTML? Detected the character encoding of a string? All are examples of this one problem.

In this talk we will look at some examples of the representation-interpretation problem and find the general pattern behind it. We will see how primitive types make it so hard for us to get this right, and how we can use value objects to steer us in the right direction. You’ll start finding many more examples of this pattern and understand them more easily.

Contains: math, character sets, strong opinions on string escaping, and an almost illegal slide.

Praise

Fantastic talk by @arnoutboks at #phpday on how data (mis-)interpretation is at core in software design. pic.twitter.com/asUJcwIOs7

— Imported Domain Event (@Ocramius) May 11, 2019

I deeply recommend this talk.

It's one of these talks that gives you that "eureka" feeling of better understanding several things with a higher level and more elegant explanation.

Great job @arnoutboks ! https://t.co/Cj61aO4E7p

— Benoit Jacquemont (@BJacquemont) October 21, 2019

Presented at

Date Talk Event Location Links
10 Sep 2020 Of representation and interpretation: A unified theory PHPBenelux virtual meetup Online slides
Cancelled (COVID-19) Of representation and interpretation: A unified theory PHP Yorkshire 2020 gb York
07 Jun 2019 Of representation and interpretation: A unified theory Dutch PHP Conference 2019 nl Amsterdam slides
feedback
video
11 May 2019 Of representation and interpretation: A unified theory phpDay 2019 it Verona slides
feedback
video
25 Apr 2019 Of representation and interpretation: A unified theory Ode aan de Code meetup nl Apeldoorn slides
video
28 Oct 2018 Of representation and interpretation: A unified theory PHP Central Europe 2018 cz Prague slides
feedback
video