raganwald
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.)

Monday, February 12, 2007
  A complete pain



I’m not against types, but I don’t know of any type systems that aren’t a complete pain, so I still like dynamic typing.

—Dr. Alan Kay on The Meaning of “Object-Oriented Programming

 

Comments on “A complete pain:
The usual retort to someone who complains about static typechecking is to ask if they've tried ML. You trade type errors at runtime for the occasional incomprehensible message from the type inference engine.

Dynamic typechecking comes with its own pain, though: dumb type mistakes that you only find out about at runtime. For me, it's all about time. If you write some code and can test it immediately, then why not check types dynamically? If you write some code and then have to wait (say, for a slow compiler), then you probably want to rule out a large set of type errors statically.
 
The usual retort to someone who complains about static typechecking is to ask if they've tried ML.

I love The Little MLer, it has been a terrific introduction to thinking in types.

I have a gut feeling that it comes down to designing type systems against designing code systems. If what you're doing has a well-defined ontology, a proper static typing system will help.

I usually insert something about Java having a brain-dead type system in comments like this. The problem is that Java programmers who have not been exposed to more sophisticated static typing systems have no idea what I might be talking about: they get static vs. dynamic, but assume that all static systems work like Java (modulo inference).

My plea to anyone reading this who is used to Java, C#, and/or C++ is this: please look into ML, Haskell, or Ocaml. Ignore the functional stuff if you like. Ignore the inference stuff if you like. Look deeply into the flexibility of the type systems backing these languages. Don't let go until you experience the Aha!
 
I have a gut feeling that it comes down to designing type systems against designing code systems. If what you're doing has a well-defined ontology, a proper static typing system will help.

Bingo. A problem with a heavily explored solution space lends itself to static typing. Searching for a solution in code will feel awkward in that same type regime. The difference between those two sets of problems has generated a few decades of flames.
 
I did study a lot of languages, for living I write java. And no, I don't want to spend my time explaining my co-workers the intrinsic of enhanced type system. They still don't grasp the "super" in generics, and it's difficult to grasp that 2 sentence of the language denoting the same value doesn't always denote the same type (because the inference rules are based on the grammar, not on the value).

So no, I'll take those type systems for me, but not for everyone.
 




<< Home
Reg Braithwaite


Recent Writing
Homoiconic Technical Writing / raganwald.posterous.com

Books
What I‘ve Learned From Failure / Kestrels, Quirky Birds, and Hopeless Egocentricity

Share
rewrite_rails / andand / unfold.rb / string_to_proc.rb / dsl_and_let.rb / comprehension.rb / lazy_lists.rb

Beauty
IS-STRICTLY-EQUIVALENT-TO-A / Spaghetti-Western Coding / Golf is a good program spoiled / Programming conventions as signals / Not all functions should be object methods

The Not So Big Software Design / Writing programs for people to read / Why Why Functional Programming Matters Matters / But Y would I want to do a thing like this?

Work
The single most important thing you must do to improve your programming career / The Naïve Approach to Hiring People / No Disrespect / Take control of your interview / Three tips for getting a job through a recruiter / My favourite interview question

Management
Exception Handling in Software Development / What if powerful languages and idioms only work for small teams? / Bricks / Which theory fits the evidence? / Still failing, still learning / What I’ve learned from failure

Notation
The unary ampersand in Ruby / (1..100).inject(&:+) / The challenge of teaching yourself a programming language / The significance of the meta-circular interpreter / Block-Structured Javascript / Haskell, Ruby and Infinity / Closures and Higher-Order Functions

Opinion
Why Apple is more expensive than Amazon / Why we are the biggest obstacles to our own growth / Is software the documentation of business process mistakes? / We have lost control of the apparatus / What I’ve Learned From Sales I, II, III

Whimsey
The Narcissism of Small Code Differences / Billy Martin’s Technique for Managing his Manager / Three stories about The Tao / Programming Language Stories / Why You Need a Degree to Work For BigCo

History
06/04 / 07/04 / 08/04 / 09/04 / 10/04 / 11/04 / 12/04 / 01/05 / 02/05 / 03/05 / 04/05 / 06/05 / 07/05 / 08/05 / 09/05 / 10/05 / 11/05 / 01/06 / 02/06 / 03/06 / 04/06 / 05/06 / 06/06 / 07/06 / 08/06 / 09/06 / 10/06 / 11/06 / 12/06 / 01/07 / 02/07 / 03/07 / 04/07 / 05/07 / 06/07 / 07/07 / 08/07 / 09/07 / 10/07 / 11/07 / 12/07 / 01/08 / 02/08 / 03/08 / 04/08 / 05/08 / 06/08 / 07/08 /