5 ms·
Leveraging Static Typing to Manage Object State
- gsg 12y agoAh, a clear instance of http://blogs.msdn.com/b/oldnewthing/archive/2011/01/26/10120297.aspx http://blogs.msdn.com/b/oldnewthing/archive/2011/01/26/10120...
- kristianp 12y agoMy pet piece of "Microspeak" is the word "Performant", although it isn't mentioned in the oldnewthing blog tag of that name: http://blogs.msdn.com/b/oldnewthing/archive/tags/microspeak/ http://blogs.msdn.com/b/oldnewthing/archive/tags/microspeak/
- ENGNR 12y agoSee also: Scala case classes
- fsloth 12y ago"...whose type indicates its state" This is one of my favorite scenarios facilitated by static types. And one of the reasons I like languages with ML-like syntax for algebraic datatypes and pattern matching - this pattern is so easy to implement in them http://en.wikipedia.org/wiki/Algebraic_data_type http://en.wikipedia.org/wiki/Algebraic_data_type An concise example of the usage can be found in http://queue.acm.org/detail.cfm?id=2038036 http://queue.acm.org/detail.cfm?id=2038036 (Section starting with the sentence "Consider as an example the following types for representing the state of a network connection:") That's in Ocaml but the same syntax applies more or less to all languages with ADT:s.