From: Peter J. Holzer on
On 2010-03-10 21:22, J�rgen Exner <jurgenex(a)hotmail.com> wrote:
> John Bokma <john(a)castleamber.com> wrote:
>>J�rgen Exner <jurgenex(a)hotmail.com> writes:
>>> ccc31807 <cartercc(a)gmail.com> wrote:
>>>>This isn't harder than C pointers.
>>>
>>> Saying something isn't harder than C pointers is like saying a desease
>>> isn't worse than the Bubonic plague: it gives very little comfort to
>>> people suffering from it.
>>> Actually C pointers are probably among the worst concepts ever invented
>>> in computer science.
>>
>>They are not "invented" they are somewhat a 1:1 mapping to
>>assembly.
>
> Exactly. You can hardly do worse than that ;-)
>
> But in all fairness, when C was developed in the early 70s it was a
> major step forward and Kerningham and Ritchie could not possibly have
> known as much as we do today.

That and they had to fit the compiler into 64k of memory. And it had to
finish in a reasonable time on a PDP-11. That somewhat limits what you
can do even if you know how to write a better language in theory.

(I do remember the MFII COBOL compiler on an 8086 - compiling our
program took half an hour)

> For its time it was a great concept and
> implementation. It's just that it is way outdated 40 years later.

Yup.


>>I do agree, however, that it would've been nice if C had references like
>>Perl, and (harder to get to) pointers as they are now.
>
> Or even Pascal or Modula or Haskell or pick pretty much any more modern
> language.

Pascal is older than C. And its pointers are (were?) particularly useless.
Modula-2 was actually quite nice. One can see that Wirth used it to
write real code and not just for teaching :-).

hp

From: Tim Bradshaw on
On 2010-03-11 18:24:32 +0000, Ron Garret said:

> C++ is clearly
> harder to learn than, say, Scheme, and yet I'm pretty sure that more
> people know C++ than know Scheme.

On what basis is it then harder to learn? I think you may be confusing
"has a small definition" with "is easy to learn". That would make,
say, general relativity, something that is very easy to learn (much
easier than being able to cook competently, say), but I don't think
that is true.

From: Tim Bradshaw on
On 2010-03-11 22:28:40 +0000, Peter J. Holzer said:

> [Ron wrote]
>> It violates universally accepted conventions
>> about what, for example, double quotes mean. For example, this:
>>
>> print "The widget costs $12.75.";
>>
>> The actual behavior of that code snippet is not justifiable under any
>> sane language semantics.
>
> "Universally accepted" is rather strong given that most shells, most
> templating languages and many scripting languages use a similar
> expansion mechanism.

I think this is close to the core of this argument. It seems to me
that for people who don't come from a Unix background, then various
things about Perl might just seem impossibly weird. But for people who
do come from that background, many of Perl's constructs - such as the
way double-quoted strings work - seem like naturual rationalisations of
the way these things work in other tools, specifically the shells and
awk / sed. May be Ron has never used these tools, I'm not sure.

From: Pascal J. Bourguignon on
Tim Bradshaw <tfb(a)tfeb.org> writes:

> On 2010-03-11 22:28:40 +0000, Peter J. Holzer said:
>
>> [Ron wrote]
>>> It violates universally accepted conventions
>>> about what, for example, double quotes mean. For example, this:
>>>
>>> print "The widget costs $12.75.";
>>>
>>> The actual behavior of that code snippet is not justifiable under any
>>> sane language semantics.
>>
>> "Universally accepted" is rather strong given that most shells, most
>> templating languages and many scripting languages use a similar
>> expansion mechanism.
>
> I think this is close to the core of this argument. It seems to me
> that for people who don't come from a Unix background, then various
> things about Perl might just seem impossibly weird. But for people
> who do come from that background, many of Perl's constructs - such as
> the way double-quoted strings work - seem like naturual
> rationalisations of the way these things work in other tools,
> specifically the shells and awk / sed. May be Ron has never used these
> tools, I'm not sure.

"Rationalization" and "handling of double-quotes in unix shells" in the
same sentence?


--
__Pascal Bourguignon__
From: John Bokma on
"Peter J. Holzer" <hjp-usenet2(a)hjp.at> writes:

> On 2010-03-10 20:54, John Bokma <john(a)castleamber.com> wrote:

[..]

> I started with BASIC (think early 1980's here - line numbers and
> goto),

ZX Spectrum, 1983 here

> then did a little bit of Pascal and assembly (6502 and Z80) before

More or less same here, Z80, Comal, Pascal, 6800, 6809, 68000 ...

>> I do agree, however, that it would've been nice if C had references like
>> Perl, and (harder to get to) pointers as they are now.
>
> Actually, C pointers are quite ok in theory (for example, you can't make
> a pointer into an array point outside of the array (except "just after"
> it).

How does C prevent this? Or I don't understand what a pointer into an
array is.

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development