Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are All Dynamic Languages Typo-friendly?

With Java on one side and Ruby/Groovy on the other, I know that in the second camp I'm free to make typos which will not get caught until run-time. Is this true of all dynamically-typed languages?

Edit: I've been asked to elaborate on the type of typo. In Ruby and in Groovy, you can assign to a variable with an accidental name that is never read. You can call methods that don't exist (obviously your tests should catch this, it's been said). You can refer to classes that don't exist, etc. etc. Basically any valid syntax, even with typographical errors, is valid in both Ruby and Groovy.

like image 987
Dan Rosenstark Avatar asked Mar 11 '10 22:03

Dan Rosenstark


1 Answers

In Perl, if you declare use strict in your code, then you must declare your variables with my. Typos in variable names will then be caught at compile-time. This is one of the biggest things I miss when coding in Python.

like image 65
ire_and_curses Avatar answered Sep 28 '22 01:09

ire_and_curses