Comment by realusername

5 years ago

The ideal for me would be some strong static typing mode for the main code providing all the guarantees you want and some dynamic typing mode for the tests which lets you test everything well.

The main downside for me of the static typing is that it's close to impossible to provide a good testing experience, DSLs, mocks and spy objects kind of require some form of dynamic typing to be usable.

That’s exactly what the decade old Java for code and Groovy for tests is. Though it’s not used too often nowadays, mostly because Java is enough for testing for most people.

That is demonstrably false.

You can absolutely write DSLs, mocks, and spies in a statically-typed language.

  • Maybe that's possible in theory but I've never encountered a statically language where I consider the testing frameworks "good enough".

    • I'm not sure what to make of that. Maybe you just haven't bothered to look? You personally not knowing about something is a reflection of your own knowledge, and not of the state of the world.

      3 replies →