lua-users home
lua-l archive

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

On Tue, Jul 1, 2014 at 10:37 AM, Pierre Chapuis <> wrote:
>> The author doesn't say it is impossible to maintain a large codebase in
>> dynamic languages.
>> He says that it is harder than with a static language.
> Not my experience if we are comparing, say, Lua to C.
> If we gave the same amount of time to two groups of
> programmers familiar with the two languages to accomplish
> the same task, I would expect:
> - the C code base to be larger in terms of LOC;
> - the C codebase to have more bugs;
> - the C codebase to have worse architecture.
> I think the same would be true of Java.

I would expect no such things systematically:

- The C code may well be shorter in terms of LOC if it's a task to
which C's extremely broad selection of available libraries may come to
- The C code will have fewer (though not zero, as such things as the
Apple OpenSSL bug illustrate) typo-based or syntax-based bugs due to
the presence of compile-time validation. Logic-based bugs will have
equal prevalence in both languages, given equally-competent
- The two codebases will have architecture of similar quality, though
certainly there will be differences in idioms.

Bringing Java into the comparison gets complicated; the architecture
will probably be more complex but will still be idiomatic to the
ecosystem and therefore hard to compare objectively.

> Moreover I would say C code is, in practice,
> often typed more weakly than Lua code.

C++ programmers already know this to be true, but there's a difference
between strong typing (which C++ has but C does not) and static typing
(which both languages have, although C's static typing isn't
expressive enough as you pointed out).

> More importantly, there
> are languages with much better type systems than C or
> Java (e.g. Haskell & friends) where I think those
> really make a difference in the large.

That statement agrees with the article, not disagrees with it.

> But "dynamic typing doesn't scale" should not be a
> reason to choose a language of the C family IMO.

Referring to "the C family" as a whole is a fallacy, as even the two
closest-related members of the class -- C and C++ -- diverge to such a
great extent that you can't argue about C++ based on failings of C.

/s/ Adam