Types As Premature Optimization
As programmers, when are we designing the software and when are we building it? What is the separation between these activities? Does it matter? What if we used two different languages: one to experiment with the basic structure of the program and one to build the software that is deployed? Consider these questions in the context of other creative activities. No buildings are built with clay; they are built with materials like steel, bricks, concrete blocks, or concrete and rebar. These materials are rigid and largely inflexible, properties that make them difficult to work with but are essential for the integrity and safety of the buildings. On the other hand, clay is a preeminent modeling material. It holds its shape but is easily malleable when experimenting with structure and relationships. In Ruby, we often use IRB to experiment with code or explore an API. We experiment with relationships and structure in our code. We make the software do something and that helps us better understand what we're trying to do. We write tests and code and iterate. Ruby's malleability makes it a preeminent clay for experimenting and learning, for designing the software. But what about building the software? What provides the rigidity we need for integrity and safety? Can a single language be both our clay and our steel and concrete?