From: Jan Panteltje on
On a sunny day (Wed, 31 Jan 2007 17:04:14 -0800) it happened John Larkin
<jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in
<oje2s2hjisrbo8soro56n0bqbp1p8lp15h(a)4ax.com>:

>>>And yes, I'd expect a printf() to use that many bytes - printf() is a
>>>freakin' monstrosity in any case. What does puts() compile to?
>>
>>It is extremely simple.
>>http://www.koders.com/c/fid61148695142D20F84C4E83E059EEED5677E7CD79.aspx
>
>
>Monkeys with typewriters. Most of the functions say nothing about what
>they do, and many are effectively or entirely comment-free.

No, you have to be able to read 'C'!!!!!!
I sort of like that link, maybe it is because I used DJ Delorie's C compiler
djgpp on MS DOS many many years ago...
:-)
http://en.wikipedia.org/wiki/DJGPP
From: John Larkin on
On Thu, 01 Feb 2007 10:49:09 GMT, Jan Panteltje
<pNaonStpealmtje(a)yahoo.com> wrote:

>On a sunny day (Wed, 31 Jan 2007 17:04:14 -0800) it happened John Larkin
><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in
><oje2s2hjisrbo8soro56n0bqbp1p8lp15h(a)4ax.com>:
>
>>>>And yes, I'd expect a printf() to use that many bytes - printf() is a
>>>>freakin' monstrosity in any case. What does puts() compile to?
>>>
>>>It is extremely simple.
>>>http://www.koders.com/c/fid61148695142D20F84C4E83E059EEED5677E7CD79.aspx
>>
>>
>>Monkeys with typewriters. Most of the functions say nothing about what
>>they do, and many are effectively or entirely comment-free.
>
>No, you have to be able to read 'C'!!!!!!

To even tell what the intent of a 100-line function is? The fact that
the comments are so few, and generally misspelled, suggest that what's
going on here is beyond simple inarticulateness.

Face it: the current state of software is an unholy mess, and the
paradigm doesn't work. Windows source code looks like this.

John


From: Robert Adsett on
On Feb 1, 11:53 am, John Larkin
<jjlar...(a)highNOTlandTHIStechnologyPART.com> wrote:
> On Thu, 01 Feb 2007 10:49:09 GMT, Jan Panteltje
>
> <pNaonStpealm...(a)yahoo.com> wrote:
> >On a sunny day (Wed, 31 Jan 2007 17:04:14 -0800) it happened John Larkin
> ><jjlar...(a)highNOTlandTHIStechnologyPART.com> wrote in
> ><oje2s2hjisrbo8soro56n0bqbp1p8lp...(a)4ax.com>:
>
> >>>>And yes, I'd expect a printf() to use that many bytes - printf() is a
> >>>>freakin' monstrosity in any case. What does puts() compile to?
>
> >>>It is extremely simple.
> >>>http://www.koders.com/c/fid61148695142D20F84C4E83E059EEED5677E7CD79.aspx
>
> >>Monkeys with typewriters. Most of the functions say nothing about what
> >>they do, and many are effectively or entirely comment-free.
>
> >No, you have to be able to read 'C'!!!!!!
>
> To even tell what the intent of a 100-line function is? The fact that
> the comments are so few, and generally misspelled, suggest that what's
> going on here is beyond simple inarticulateness.

I use C, it's now probably my 'mother tongue' for programming and I
have to agree with John on this. The comments are too sparse and
worse in the one other function I looked at (to see if more complex
functions were done better), the file header comment was completely
wrong. It's the sort of file where if you already know what's
happening and what it's supposed to do you can follow it but if you
are new to it or have been away for a long enough period to have
forgotten then you will be in for a hard time. The functions assume a
lot of knowledge that is not in the files and there are no pointers
external references containing the missing information.

Robert

From: Vladimir Vassilevsky on


Jan Panteltje wrote:


> BOOL calculate_current(double resistance, double voltage, double *current)
> {
> if(debug)
> {
> fprintf(stderr,\
> "calculate_current: arg resistance, voltage\n",\
> resistance, voltage);
> }
>
> if(resistance < 0.0)
> {
> fprintf(stderr,\
> "My-Program: calculate_current():\n\
> Your resistance is negative (%.2f), you must be kidding right? Aborting.\n",\
> resistance);
>
> return SUCKS;
> }
>
> *current = voltage / resistance;
>
> if(debug)
> {
> fprintf(stderr, "calculate_current(): calculated current=%.2f\n", *current);
> }
>
> return OK
> }

What a shamefull nonportable, unsafe and murky piece of code.

This is a way to go:

CURRENT calculate_current(VOLTAGE voltage, RESISTANCE resistance)
{
CURRENT current;

if(fabs(resistance) < VERY_SMALL_NUMBER)
{
throw BAD_RESISTANCE;
}
else
{
current = voltage/resistance;
}
return current;
}



Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
From: John Devereux on
John Larkin <jjlarkin(a)highNOTlandTHIStechnologyPART.com> writes:

> On Thu, 01 Feb 2007 10:49:09 GMT, Jan Panteltje
> <pNaonStpealmtje(a)yahoo.com> wrote:
>
>>On a sunny day (Wed, 31 Jan 2007 17:04:14 -0800) it happened John Larkin
>><jjlarkin(a)highNOTlandTHIStechnologyPART.com> wrote in
>><oje2s2hjisrbo8soro56n0bqbp1p8lp15h(a)4ax.com>:
>>
>>>>>And yes, I'd expect a printf() to use that many bytes - printf() is a
>>>>>freakin' monstrosity in any case. What does puts() compile to?
>>>>
>>>>It is extremely simple.
>>>>http://www.koders.com/c/fid61148695142D20F84C4E83E059EEED5677E7CD79.aspx
>>>
>>>
>>>Monkeys with typewriters. Most of the functions say nothing about what
>>>they do, and many are effectively or entirely comment-free.
>>
>>No, you have to be able to read 'C'!!!!!!
>
> To even tell what the intent of a 100-line function is? The fact that
> the comments are so few, and generally misspelled, suggest that what's
> going on here is beyond simple inarticulateness.

You do realise that this is an implementation of the C standard
library? The behaviour of the functions is spelled out, in detail, in
the C standard, and any number of C reference books and online
references.

> Face it: the current state of software is an unholy mess, and the
> paradigm doesn't work.

What would you do, rewrite Windows XP in 68k assembler? :)

> Windows source code looks like this.

If Only...


--

John Devereux
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Prev: I2C Firmware Code for TI MSP430F2013
Next: CRC calculation