Tools that helps, but can lead to complication
My programming experience has started from Java, then C# with .NET MVC. When I wrote using this strictly typed languages, I, probably, used autocomplete with choosing a method from list more than coding by input chars of code. And that was amazing. I can’t make a typo. I can’t accidentally swap method arguments, or use wrong type. Linter always helped me before I can even think about the mistake.
With all these nice tools I wasn’t afraid of fabrics of fabrics that get an object of a not so trivial class, and returning an object with complex internal state and methods that returns complex objects of different classes and get objects of classes that can be created using other fabrics. You got it.
I shouldn’t keep all these complex structures in mind. Just click Ctrl-Space and here are all the possible steps to do.
It was really hard. I thought, how is it possible that there is a language where you can call the method that doesn’t exist. And you should run the application and go to the specific state to see the error (I was too young for unit-test, but, in general, it still true). And what should I put in arguments?
I was anger, complaining about how I hate Js to colleagues. All libraries are written in very different ways. So much magic in them. And it hard to understand it without types. Instead of nice and very quick docs, I often need to go to web and search for info about simple things. And sometimes I go to source code to be sure about what library does. With C#, I almost never saw sources of external modules.
But once, it started to changing. I’ve started to understand JS, we’ve had a contact. Many of libraries are really bad written, but now I can see it and avoid them.
In JS, you can’t code too complex. It will be impossible to use.
I found that most of what I use are simple. I still have to look web docs. But mostly this is a thing that is possible to understand and to remember. Average complexity of Js libraries API is less than average complexity in C#. So I can do the same, but it’s easier to get.
There is always a better way. When your solution is far from good and simple, Js wants you to think about it and fix it. And usually it actually possible to make it straightforward, without unnecessary abstractions or types ceremonies.
Technically it possible to do it such nice in both languages. The issue isn’t the syntax. It’s 100% human factor.
Strict typing should be a small but very nice addition to stability and code usability. But not the requirement for its users.
My conclusion is that you should think about interfaces, make it simpler. And just as an example of the place where you forced to do so is dynamic languages where your interfaces should be simple enough to be possible to work with them without type checks and autocomplete.
It’s not about dynamic vs static typing. It’s about me, and how different it feels to write in two very different languages.