lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
> From: "spir" <denis.spir@gmail.com>
> To: lua-l@lists.lua.org
> Sent: Tuesday, 23 October, 2012 1:29:10 AM
> Subject: Re: how to prevent bugs without static type checking?
> 
> 2. way of thinking
> I noticed the following: after programming for a long time only in
> dynamic
> languages, when I then switch to static typing, for a while I have
> about no type
> error (at compile-time, indeed); then they start to happen, and
> finally I have
> many. I think, maybe, after some time we start "programming-thinking"
> differently. Dynamic programmers may have a clearer awareness about
> types --that
> is, ultimately, the meaning of symbols-- and unconsciously pay more
> attention to
> their coherence in the model. Conversely, after some time, static
> programmers
> may start to rely on the machine to do this job; and it does it well,
> provided
> your typing is correct and clear. They become so-to-say lazy about
> that, not
> uselessly spending their "neuronic power" in what a machine can do
> (better).
> Both are good, in my opinion.

Yes, I agree. I do very little Lua programming and program mainly in Erlang which is also dynamically typed. And I find that I make very few type errors or significant spelling errors. For Erlang we have a type checking tool (and other checks), dialyzer, and I find that running that on my applications finds very few errors.

I think that just because the system is dynamically typed doesn't mean you don't think about types, of course you do. If your application is to work properly the types must be correct. "Hacking" the types usually results in a right mess at the end. Perhaps not having static type checking forces you to be more careful about types.

Robert