View mode: basic / threaded / horizontal-split · Log in · Help
February 09, 2012
Re: Carmack about static analysis
Bruno Medeiros:

> the needs of large, long-lived, multi-programmer 
> projects are just different than the quick work you do for yourself."
> that throws a jab at a lot of the obsession with dynamic languages that 
> goes on out there.
> It's something I've echoed in the past, especially when people start 
> comparing languages to one another using small code snippets, and 
> picking on issues/advantages that actually are only significant when 
> writing small sized code, but not at all for medium/large sized apps. 
> (the Hello-World Snippet Fallacy?)

Many programs are small or very small, and they will keep being small. I write many of those. So there are many situations where paying for a lot of "infrastructure" and bondage in your code isn't good. (Haskell programmers sometimes don't agree with this idea, but the world of programming is large enough to allow two persons with very different opinions to be both "acceptably right", both are able to find a way to write code in a good enough way).

From my experience dynamic languages as Python are very good (often better than D, unless the problem being explored requires a large amount of computations) for exploratory programming. Usual such "explorations" are done on short programs, so this is also a special case of the precedent point.

Comparing languages with small code snippets doesn't tell you all you want to know about how a language scales for very large programs, of course, so they aren't enough. But such small snippets are very useful any way because large programs are mostly made of small parts; and it's still true that being able to remove one line from a group of 4 lines sometimes means reducing the size of a large program by 10% or more. So little syntax niceties matter even for huge programs. This is also why (as example) Python list comps are very useful for programs one million lines of code long too.

Bye,
bearophile
February 10, 2012
Re: Carmack about static analysis
On 2/9/2012 12:09 PM, Bruno Medeiros wrote:
> Nice article! I particularly liked this comment:
> "The classic hacker disdain for “bondage and discipline languages” is short
> sighted – the needs of large, long-lived, multi-programmer projects are just
> different than the quick work you do for yourself."

I implicitly agree with you. But people have written large programs in dynamic 
languages, and claim it works out equivalently for them. I don't have enough 
experience in that direction to decide if that's baloney or not.
February 10, 2012
Re: Carmack about static analysis
Le 10/02/2012 05:37, Walter Bright a écrit :
> On 2/9/2012 12:09 PM, Bruno Medeiros wrote:
>> Nice article! I particularly liked this comment:
>> "The classic hacker disdain for “bondage and discipline languages” is
>> short
>> sighted – the needs of large, long-lived, multi-programmer projects
>> are just
>> different than the quick work you do for yourself."
>
> I implicitly agree with you. But people have written large programs in
> dynamic languages, and claim it works out equivalently for them. I don't
> have enough experience in that direction to decide if that's baloney or
> not.

Well I did that. The language doesn't replace programmer discipline and 
skills. Or, to say thing another way : the programmer is more important 
than the language.

But it is clear that successful code in non typed languages ends up 
beeign typed anyway, just based on discipline, in most of the code.

Typeless is great when sketching some piece of code, but you'll way more 
problem at the end.
February 10, 2012
Re: Carmack about static analysis
On 2/10/2012 3:10 AM, deadalnix wrote:
> Typeless is great when sketching some piece of code, but you'll way more problem
> at the end.

I've heard people say that typeless is just as good, because you load them up 
with unit tests that verify the types. To me, this doesn't seem like any 
advantage. I'd rather have the language automatically check things for me, 
rather than worrying about having complete unit test coverage, let alone the 
bother of writing them.
February 10, 2012
Re: Carmack about static analysis
On Fri, Feb 10, 2012 at 10:19:11AM -0800, Walter Bright wrote:
> On 2/10/2012 3:10 AM, deadalnix wrote:
> >Typeless is great when sketching some piece of code, but you'll way more problem
> >at the end.
> 
> I've heard people say that typeless is just as good, because you
> load them up with unit tests that verify the types. To me, this
> doesn't seem like any advantage. I'd rather have the language
> automatically check things for me, rather than worrying about having
> complete unit test coverage, let alone the bother of writing them.

Though if it were D, it'd be so easy to write unittests that this
wouldn't be a problem. But then D is strongly-typed anyway. :)


T

-- 
Some days you win; most days you lose.
February 10, 2012
Re: Carmack about static analysis
On 10/02/2012 18:19, Walter Bright wrote:
> On 2/10/2012 3:10 AM, deadalnix wrote:
>> Typeless is great when sketching some piece of code, but you'll way
>> more problem
>> at the end.
>
> I've heard people say that typeless is just as good, because you load
> them up with unit tests that verify the types. To me, this doesn't seem
> like any advantage. I'd rather have the language automatically check
> things for me, rather than worrying about having complete unit test
> coverage, let alone the bother of writing them.

That why I tell those people to just not think of static typing as 
static typing, but as "compile-time unit tests"... ;)


-- 
Bruno Medeiros - Software Engineer
February 10, 2012
Re: Carmack about static analysis
On Fri, Feb 10, 2012 at 11:19 AM, Walter Bright
<newshound2@digitalmars.com>wrote:

> On 2/10/2012 3:10 AM, deadalnix wrote:
>
>> Typeless is great when sketching some piece of code, but you'll way more
>> problem
>> at the end.
>>
>
> I've heard people say that typeless is just as good, because you load them
> up with unit tests that verify the types. To me, this doesn't seem like any
> advantage. I'd rather have the language automatically check things for me,
> rather than worrying about having complete unit test coverage, let alone
> the bother of writing them.
>

I actually read an article recently from someone who had written large
applications in dynamic languages and had come to the conclusion that the
productivity gains you have with the dynamic typing are pretty much lost to
the additional unit testing you must do to ensure everything works.  I've
always had an uneasy feeling when working in dynamic languages but chalked
it up to my own inexperience.

Regards,
Brad Anderson
February 10, 2012
Re: Carmack about static analysis
On 09/02/2012 22:34, bearophile wrote:
> Comparing languages with small code snippets doesn't tell you all you want to know about how a language scales for very large programs, of course, so they aren't enough. But such small snippets are very useful any way because large programs are mostly made of small parts; and it's still true that being able to remove one line from a group of 4 lines sometimes means reducing the size of a large program by 10% or more. So little syntax niceties matter even for huge programs. This is also why (as example) Python list comps are very useful for programs one million lines of code long too.

Yeah, I'm not saying comparing small snippets is not useful... Clear it 
is, I mean, it's not practical to write a full application just to 
compare languages, obviously. Rather it's the mindset when examining 
such snippets that is important: one should be thinking of the impact 
the language has not just on code like the snippet, but on a 
medium-large sized code as well (and code written by multiple people). 
And I've seen several sites and discussions where such a mindset is 
completely ignored... (like people dissing the fact that in Java you 
can't write a function outside a class, you have to use a static method, 
and thus have a class wrapping it around...)


-- 
Bruno Medeiros - Software Engineer
February 10, 2012
Re: Carmack about static analysis
On Friday, February 10, 2012 12:08:19 Brad Anderson wrote:
> I actually read an article recently from someone who had written large
> applications in dynamic languages and had come to the conclusion that the
> productivity gains you have with the dynamic typing are pretty much lost to
> the additional unit testing you must do to ensure everything works. I've
> always had an uneasy feeling when working in dynamic languages but chalked
> it up to my own inexperience.

I just can't stand the idea that whether an if statement is true or not could 
change the type of a variable (e.g. it's set to a string in one branch and an 
int in the other). I consider dynamic typing to be a _huge_ negative. It may 
be fine for short scripts and the like, but I'll never write anything serious 
using a dynamically typed language if I can avoid it.

- Jonathan M Davis
February 10, 2012
Re: Carmack about static analysis
On 2012-02-10 20:08, Brad Anderson wrote:
> On Fri, Feb 10, 2012 at 11:19 AM, Walter Bright
> <newshound2@digitalmars.com <mailto:newshound2@digitalmars.com>> wrote:
>
>     On 2/10/2012 3:10 AM, deadalnix wrote:
>
>         Typeless is great when sketching some piece of code, but you'll
>         way more problem
>         at the end.
>
>
>     I've heard people say that typeless is just as good, because you
>     load them up with unit tests that verify the types. To me, this
>     doesn't seem like any advantage. I'd rather have the language
>     automatically check things for me, rather than worrying about having
>     complete unit test coverage, let alone the bother of writing them.
>
>
> I actually read an article recently from someone who had written large
> applications in dynamic languages and had come to the conclusion that
> the productivity gains you have with the dynamic typing are pretty much
> lost to the additional unit testing you must do to ensure everything
> works.  I've always had an uneasy feeling when working in dynamic
> languages but chalked it up to my own inexperience.
>
> Regards,
> Brad Anderson

I completely agree. I've many times wanted to have static typing in Ruby 
and JavaScript.

-- 
/Jacob Carlborg
4 5 6 7 8 9
Top | Discussion index | About this forum | D home