Tech Pick (Programming Language Affordance)
I am a huge fan of Sandi Metz. She’s like one of those Zen masters that snap their students out of their current perceptual ruts.
In a recent article (‘What Does OO Afford’) Sandi goes into a great reflection about Object Oriented programming and the affordances that this approach provides. It’s a great and worthwhile post. One section that strikes me is the following:
Just like varying styles of doorknob, different programming languages offer their own unique affordances. Language designers have preconceived ideas about the best way to model reality, and their creations reflect these biases. Thus, programming languages are explicitly designed to “enable” certain kinds of thinking.
I’m talking about something that’s deeper than syntax. Languages have points-of-view: they’re designed to be used in certain stylized ways. The mere fact that code compiles doesn’t mean it’s arranged as the language designer intended.
While it’s possible to warp most any programming language into use by an alternate way of thinking, working at cross-purposes from your language’s intentions is not the most efficient way to write code. Don’t roll this rock uphill. If you don’t understand your language’s affordances, learn them. If your coding inclinations conflict with the designer’s biases, yield.
The most recent Full Stack Radio podcast fits quite well with Sandi’s article. It features an interview with David Heinemeier Hansson.
Thoughts? Feedback? Let me know: @eli4d on Twitter