Tuesday, July 14, 2020

Jigsaw Puzzles

For most of my career as a software developer, I have used statically typed programming languages such as Pascal, Ada, Java, and TypeScript.  Recently, however, I briefly dabbled in using the dynamically typed languages JavaScript and Python.  Debugging all of the run-time errors in the dynamically typed code reminded me of my earliest years of programming in BASIC in which I would have to spend time searching for misplaced commas.

When I switched from JavaScript back to TypeScript, I sensed an increase in my productivity and my confidence in the correctness of my code.  To explain to a layman the difference between programming in a dynamically typed language as compared to a statically typed language, I came up with the following analogy.  It is the difference between assembling a jigsaw puzzle in which all of the tiles are square versus one in which the pieces are of a variety of different shapes that can only interlock in the correct way.

No comments: