3 ms·
>No; The line has to be executed for the error to show up in a dynamic language. This is a common misperception: http://pychecker.sourceforge.net/ http://pych
by gte910h 17y ago
>No; The line has to be executed for the error to show up in a dynamic language.
This is a common misperception:
http://pychecker.sourceforge.net/ http://pychecker.sourceforge.net/
http://www.logilab.org/857 http://www.logilab.org/857 (pylint)
http://www.jslint.com/ http://www.jslint.com/
And to head off the common "But but but it's not the compiler", I contend you're doing something wrong if you're not also running lint against a C program, as C compilers do not catch tons of things that people do wrong, but lint does.
Both types of languages have common type errors. Some can only be caught at runtime in both, but some sorts of errors (signature errors), static type checkers can catch them.
I work in both types of languages. In the amount of time I spend fiddling with type system stuff in objective C, I could write 2 test harness classes in python, and happily would.
Now if you're talking Erlang, et al, then we can talk about static type systems. But for the algol languages, I don't think they have all the benefits of a strong, static type system that outweigh the productivity of dynamism.
If you use docstrings, doctests, etc, you can find quite a nice enterprise coding language in there. Remember dynamic are more expressive (by definition almost)than static languages per line of code. So that 20k Line java/C# program is something like 3-13k lines of python or 2-9k lines of ruby.
The dominant reason to use static languages usually has little to do with their static nature with regards to errors: They are often faster at execution time. Also, they tend to have cheaper programmers. Both of these often dominate any code quality issues.
I personally advocate mixed language situations (like python weave) for most situations like that so inner loops can get the speed of C, and the rest gets the development speed of a dynamic language.