LWN.net Logo

Language wars

Language wars

Posted Nov 17, 2009 22:34 UTC (Tue) by NAR (subscriber, #1313)
In reply to: Language wars by keithp
Parent article: The notmuch mail client

I expect the computer to detect and complain about my programming errors as soon as possible. Static typing errors can be detected during compilation and need not wait until execution time.

Don't forget that you have to execute the code anyway to test it. Now the real question is that which is faster: compile (and compile and compile...) C/C++/Java source and execute, or compile a perl/python/ruby/erlang/etc. source, execute, compile, execute, etc. It depends on the problem domain, but the later could be faster in the long run.

Type errors are probably found earlier with C (although the automatic numeric conversions could be tricky), but program logic errors might be found later. I work with a dynamically typed language and sometimes miss the compiler help with types - but certainly don't miss the "type make, then go for a coffee" days of C++ programming.

And I haven't even mentioned buffer overflows plaguing C programs since forever, where the compiler won't help much.


(Log in to post comments)

Smoke test

Posted Nov 18, 2009 21:49 UTC (Wed) by man_ls (subscriber, #15091) [Link]

To get the best of both worlds you just run an integrated test suite instead of or in addition to compiling. This way you can catch both type errors and other functional errors. It's not that hard to do, really, and it often takes less than compiling a lot of code. Just be sure to make it run real fast.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds