2007-11-12

Weakly typed languages need more testing

I have to written and managed some projects using scripting languages. Those languages often have no strong typing or have duck typing like in python. This is their strength on one way, and weakness on another because it's easier to break the code giving mistaken parameter. Most of this errors are visible after running a buggy code.

Some of older programming languages have built coarse in error messages like in PHP or old ASP family. It doesn't help during debugging and can be really frustrating indeed.

Automatic testing is good, everybody can say even if they don't use it. So it's best to use unit testing specially for that kind of code. In that way simple errors caused by non checked and mistaken parameters can be easy found and unit functionality is checked also.

So once again I say- automatic tests are good. Scripting languages like python, perl or php need automatic tests as additional "safety net". Comparing code written in weakly and strong typed language both covered with tests both may have equal quality, so there is no real typed language quality advance over non typed one.Good tests are what gives you quality and confidence.

So next time if you are going to code something think about- how to test it.

No comments: