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

Saturday, May 26, 2007
  We really have a lot in common


Tell me what you like about static typing, and I’ll tell you what I like about functional programming.

Tell me what you like about automated refactoring in your IDE, and I’ll tell you what I like about referential transparency.

Tell me what you like about imperative programming, and I’ll tell you what I like about dynamic typing.

Tell me what you like about objects that execute methods, and I’ll tell you what I like about components that execute domain-specific languages.

Tell me what you like about configuring your programs with XML, and I’ll tell you what I like about writing literate software.

Tell me what you like about Inversion of Control, and I’ll tell you what I like about first-class functions.

And hey, if you tell me why dynamically extending and changing classes bothers you, I’ll tell you why mutable local variables bother me.

See? We have a lot in common. Is there anything else I’ve missed?
 

Comments on “We really have a lot in common:
So are "mutable vocal variables" ones that scream when you step on them? Granted I know what you really meant, but the idea of logs being filled with "Variable foo really doesn't like to be touched" is really amusing.
 
I need a new "The LazyWeb is my SpellCheckr" tee shirt.

Thanks!
 
One thing I've been trying to wrap my brain around lately is the way that, in a good-sized code base, you may not want to have to commit to certain architectural choices for the entire code base.

Static typing -- especially when you use type inference to minimalize type annotation -- rocks for a lot of code, especially when you have things like higher order functions that operate on other higher-order functions.

But in other cases, dynamic typing may be the best choice. In fact, in some cases what you really need is not just dynamic, but runtime-extensible types.

In some code, you may want the ability to ban mutable local variables and keep all your state and other side effects very carefully encapsulated.

But other blocks of code virtually beg for the elaborate state designs of an object system.

I think what I want is a code base where it's easy to localize these decisions, perhaps on a per-module basis. I don't have a code base like that yet, but I think that's where I want to go.
 
I'm experimenting with JRuby in the hope that I can bundle it up into a JAR and install it alongside a J2EE server (not Rails for BigCo reasons).

I can then use the Ruby-Java API, or even better, wrap the Ruby component up as a "web service."
 
I'm getting ready to pilot a similar solution using IronPython for .Net. The main thing I'm currently looking at is a content-management-system-like approach to managing Python scripts that provide runtime-customizable presentation-level extensions.

In the long term, though, I can't help thinking that all of these features could be provided by a single language with optional type annotations in which you could enforce things like static typing and immutable variables using module-level declarations.
 




<< 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 /