The debate around types often centers on simplicity. But since simplicity is subjective, is this debate just for show, or do we have any empirical evidence to support our assertions? And personally, do I prefer types or no types?

I see types as another form of documentation. When I type a dot in the editor, I get suggestions for what comes next in the code. This is the “killer feature” of types. Static type checking helpfully warns me when I’m about to make a mistake.

Go mostly stays out of the way until needed because it’s statically and strongly typed.

func main() {
	i := 1                                // int
	output := "hello: " + strconv.Itoa(i) // explicit conversion needed due to static typing
	fmt.Println(output)                   // hello: 1
}

Try the same thing in dynamically and strongly typed Ruby, however, and it crashes with no warning:

def main
  i = 1                  # Integer
  output = "hello: " + i # no implicit conversion of Integer into String (TypeError)
  puts output
end

JavaScript, a dynamically and weakly typed language, runs it with no error and no conversion needed:

function main() {
  const i = 1;                   // Number
  const output = "hello: " + i;  // Implicit conversion to string
  console.log(output);           // hello: 1
}

I find arguments against types difficult to process due to the nature of arguments in general.

To show that the absence of types is beneficial or that their presence is harmful requires empirical research. However:

  1. There might not be sufficient empirical research.
  2. The research could be flawed.

In the absence of solid research, we might elevate a subjective ideal. However:

  1. Subjective ideals tend to not convince anyone; either you agree, or you don’t.
  2. Defending a subjective ideal might derail the argument entirely.

Developers want a good experience reading and writing code. Many languages today owe some of their initial success to not having a type checker. Now, many of them are building type systems of their own. Are type systems inevitable as a language grows in popularity?