Getting Started in Programming & Scripting

J

John W. Kennedy

Jussi said:
Malcolm wrote:




Is it possible to code anything without the concept of pointers?

Yes. Pointers did not even appear in high-level languages until the
mid-60's, except to the extent that they are implied in LISP. A good
many COBOL-turned-to-PL/I programmers don't even know anything to do
with pointers except to subvert the type system.

Even as late as the mid-80's, the designers of Ada felt the need to
justify including pointers in the language, experiences with PL/I and
ALGOL 68 having been bad. (PL/I has been improved since then.)
 
J

John W. Kennedy

Francis said:
To the best of my knowledge Cobol has no pointers and Cobol programmers
have no need of the concept (indeed many of them find the idea of a
pointer quite bizarre)

Well, IBM mainframe COBOL has long included some semi-documented pointer
functions intended for use with CICS.

COBOL 2003 includes OO, and, consequently, references.
 
C

Chris Hills

Francis Glassborow said:
I wish it were that simple. A great deal of bad C has been written by
those who learnt Pascal as their first language. There is a lot to be
said for NOT protecting students from the consequences of lack of
understanding.

But as Pascal is a "safe" language you can't write bad Pascal.... the
compiler won't let you :)

There are still far to many people who think that with some languages if
it compiler it must be "good".

I agree that protecting students with a "safe" language makes matters a
lot worse as they rely on the compiler for error checking and safety.
 
C

Chris Hills

John W. Kennedy said:
Well, IBM mainframe COBOL has long included some semi-documented pointer
functions intended for use with CICS.

COBOL 2003 includes OO, and, consequently, references.

I recall seeing OO Cobol around 1995 though I don't know if it had
pointers/references then.
 
J

J French

But as Pascal is a "safe" language you can't write bad Pascal.... the
compiler won't let you :)
There are still far to many people who think that with some languages if
it compiler it must be "good".

You mean if the code compiles it must be good ?
I agree that protecting students with a "safe" language makes matters a
lot worse as they rely on the compiler for error checking and safety.

So you drive a car with dodgy brakes, no airbags and no seat belts ?

There is a lot to be said for strong type checking, it shows up stupid
errors rapidly

Gawd, I remember having to write my own call parameter checking
utility
 
R

Richard Heathfield

Chris Hills said:
I recall seeing OO Cobol around 1995 though I don't know if it had
pointers/references then.

It's time for the post-increment joke again, if someone would be so kind.
 
C

Christopher Benson-Manica

In comp.lang.c J French said:
There is a lot to be said for strong type checking, it shows up stupid
errors rapidly

It catches type errors at compile time (for compiled languages), but
it can also be a hinderance at times. I have taken advantage of the
lax typing of JavaScript many times.
 
S

Steve O'Hara-Smith

On Thu, 15 Sep 2005 08:47:50 +0000 (UTC)
Agreed.

So you drive a car with dodgy brakes, no airbags and no seat belts ?

Absolutely not - but those who learn their road sense on a bicycle
(dodgy brakes, no airbags, no seatbelts and worse) are probably safer
drivers than those who learned it in a Volvo.
There is a lot to be said for strong type checking, it shows up stupid
errors rapidly

Yes but there's a lot to be said for learning the art of
programming with something dangerous like BCPL or C where careless
coding gets rewarded with core dumps and other program crashes.
Gawd, I remember having to write my own call parameter checking
utility

Doing something like that teaches a lot.
 
C

Chris Hills

J French said:
You mean if the code compiles it must be good ?


So you drive a car with dodgy brakes, no airbags and no seat belts ?

Not the same thing at all. Also in many cases you turn OFF the airbags
and don't use seat belts. Though you always want working breaks.
There is a lot to be said for strong type checking, it shows up stupid
errors rapidly

Agreed. I use PC-lint
 
K

Keith Thompson

Chris Hills said:
J French said:
[...]
I agree that protecting students with a "safe" language makes matters a
lot worse as they rely on the compiler for error checking and safety.

So you drive a car with dodgy brakes, no airbags and no seat belts ?

Not the same thing at all. Also in many cases you turn OFF the airbags
and don't use seat belts. Though you always want working breaks.

I hope that's just an overstretched metaphor. If you're actually
talking about driving, I don't know if it's even possible to turn off
the airbags, and I *always* wear my seatbelt and insist that my
passengers do likewise. I might consider turning off the airbags in a
dire emergence if it made the car go faster, but of course it doesn't.

Getting back to programming, yes, it's often possible to disable
checks for faster performance. Whether it's a good idea is another
matter.
 
R

Richard Heathfield

Keith Thompson said:
I hope that's just an overstretched metaphor. If you're actually
talking about driving, I don't know if it's even possible to turn off
the airbags,

It is, at least in some cars. Often this will result in the tripping of a
warning light on your dashboard.
 
W

Walter Roberson

Keith Thompson said:
It is, at least in some cars. Often this will result in the tripping of a
warning light on your dashboard.

[OT]

Turning off of airbags is recommended in some circumstances, mostly
having to do with having low-mass or fragile people in the front
passenger seat. The airbags come out with a lot of force, and can
themselves be a source of injury (or even death.)

[NB: I am -not- advocating turning off airbags, just indicating that
there are circumstances under which some "reasonable people" might
choose to do so.]
 
S

Steve O'Hara-Smith

On Thu, 15 Sep 2005 18:42:37 +0000 (UTC)
Keith Thompson said:
It is, at least in some cars. Often this will result in the tripping of a
warning light on your dashboard.

[OT]

Turning off of airbags is recommended in some circumstances, mostly
having to do with having low-mass or fragile people in the front

It is required if you have a rear facing baby seat in the front,
an airbag going off in front of one of those will ram the baby into
the back of the seat with just about certain death as a result. For
this reason the front passenger seat airbag usually has an off switch.
 
D

Default User

Richard said:
Keith Thompson said:


It is, at least in some cars. Often this will result in the tripping
of a warning light on your dashboard.

Really? I don't believe that's the case in the US. In fact, most repair
places will refuse to install switches, as they are concerned about
liability.



Brian
 
W

Walter Roberson

Richard Heathfield wrote:
Really? I don't believe that's the case in the US. In fact, most repair
places will refuse to install switches, as they are concerned about
liability.

[OT]

Really. Here's how to find an official description of the rules.
[I can't just post a link because the final URL contains several
session tokens]

http://www.nhtsa.dot.gov/
-> [Vehicles and Equipment] tab
-> [Air Bags] "Browse Topics"
-> [Questions and Answers on Air Bag On-Off Switches] Frequently Asked Questions
-> [8. Who can get an on-off switch?]
 
D

Default User

Walter said:
Richard Heathfield wrote:
Really? I don't believe that's the case in the US. In fact, most
repair places will refuse to install switches, as they are
concerned about liability.

[OT]

Really. Here's how to find an official description of the rules.


Nothing there contradicts what I said. I didn't say it wasn't possible
to INSTALL a switch, but that they don't come that way. I also said
that many repair shops will refuse to install said switches.



Brian
 
A

Alan Balmer

So you drive a car with dodgy brakes, no airbags and no seat belts ?

Airbags and seat belts don't prevent accidents. Inadequate brakes will
definitely cause me to drive more carefully.

I see too many "programmers" who throw code at the compiler and tweak
it until the errors go away. Unfortunately, the compiler can't be
counted on to detect logic errors.
 
M

Michael Mair

Keith said:
Chris Hills said:
[...]
I agree that protecting students with a "safe" language makes matters a
lot worse as they rely on the compiler for error checking and safety.

So you drive a car with dodgy brakes, no airbags and no seat belts ?

Not the same thing at all. Also in many cases you turn OFF the airbags
and don't use seat belts. Though you always want working breaks.

I hope that's just an overstretched metaphor. If you're actually
talking about driving, I don't know if it's even possible to turn off
the airbags, and I *always* wear my seatbelt and insist that my
passengers do likewise. I might consider turning off the airbags in a
dire emergence if it made the car go faster, but of course it doesn't.

Getting back to programming, yes, it's often possible to disable
checks for faster performance. Whether it's a good idea is another
matter.

As Walter indirectly mentioned, if you want to transport children below
a certain weight in the front seat, you should turn off the respective
passenger airbag.
And with some vehicles, backing into a parking lot may be easier without
seat-belt -- so, the metaphor is not too overstretched. Keeping the
car in excellent technical condition but knowing when it is better to
neglect some safety gadget sounds not too far from C programming.
The converse metaphor is a completely different thing, of course.

Cheers
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top