Pat Helland has been talking about data inside the service versus data outside the service since at least 2005. I realised back then when I read his paper that the way to model “data inside the service” in C# was to use value types (structs) which could enforce the format and range of its data in the constructor. In this way you could have a value type, say EmailAddress, which had a single string, an email address, and if you passed an EmailAddress to a function, you know you don’t need to revalidate the data, it’s known safe and “inside the service”. Data outside the service is simply a string until it’s brought inside during the construction of a value type for any given domain. The really neat thing about this is how cheap the value types are, they don’t add any overhead, the EmailAddress example above still has only a single string value, and nothing new or additional needs to be allocated on the heap.
Category Archives: Programming
Don’t fight the browser preload scanner
I probably should have read this one closer than I did: Don’t fight the browser preload scanner.
Write an audio visualizer from scratch with vanilla JavaScript
This is great: Write an audio visualizer from scratch with vanilla JavaScript.
Distributed Systems Shibboleths
This via r/programming today: Distributed Systems Shibboleths.
The Code Review Pyramid
This via r/programming today: The Code Review Pyramid.
zq
If I had more time I would read this closely: Introducing zq: an Easier (and Faster) Alternative to jq.
CSS Tips
This is great: CSS tips and tricks you won’t see in most of the tutorials.
HTML attributes
Some doco about interesting HTML attributes over here: Those HTML Attributes You Never Use. Related: 5 HTML Tags many people are not using.
Modern PHP
Some notes on features in Modern PHP.
Quote for the day
I’m reading this and I liked this:
The obvious skill I learned was how to write tests using a fancy testing framework, but the meta-thing I learned which has been even more useful is the fact that writing a test-case generator and a checker is often much more productive than the manual test-case writing that passes for automated testing in most places.
Also good:
It’s not that these books aren’t useful, it’s that almost all of them are written to make sense without any particular background beyond what any random programmer might have, and you can only get so much out of reading your 50th book targeted at random programmers.