I favor statically typed languages over dynamically typed languages. I never seen a reason to use a dynamically typed language, it never made sense to me. Maybe by learning lisp in the future, my view will change cause of muh power…

But generally speaking, dynamic languages offer more headache with less pain killer than static languages. Plus, most statically typed languages contain strict data structures that can be used to verify malicious inputs.

For example, Let’s say data structure for a Person is the following:

first_name
last_name
age
sex

Well, you could assign a strict type for each field. As follows:

type Person struct {
	first_name: string
	last_name: string
	age: uint8 // or just a normal int
	sex: bool // either true for female, or false for male. Or the opposite...
}

You might argue for a need of static types, you might say something like ‘I write unit tests to test out my functions, and I am very patient/focus while developing.. Why use static types?’

Because of the following reasons:

  • Easier Debugging
  • Allows for easy collaboration between teams
  • Optimization by the compiler
  • Design becomes more comprehensible.

There are some dynamic programming languages that have contributed to the world a big deal, examples of this are: [PHP, Javascript, Python, Ruby, Lua] among others…

And it’s not an explicit rule that ‘dynamic programming language == bad program’, but in any case using a statically typed language I think improves the program’s readibility which improves(by assiociation) the program(though it’s not necessary).