Talk in English - US at PHPBenelux Virtual Meetup - September 2020
View Slides: https://speakerdeck.com/aboks/of-representation-and-interpretation-a-unified-theory-phpbenelux-meetup
Short URL: https://joind.in/talk/109ec
(QR-Code (opens in new window))
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.
Comments
Comments are closed.
Interesting topic, despite the youtube stream staring partway through; but a good explanation leading up to the benefits of value objects
Lots of information on how easy it is to misinterpret data. And how trying to detect interpretation can still fail.
Fortunately we can use value objects, so we only need to know exactly what something is when the value object is created. After that, it's all stored in the object itself.