Getting Started in Programming & Scripting

M

Mark B

Default User said:
Walter said:
Richard Heathfield wrote:
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.
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.
Sure it did... otherwise, what did you mean by
'I don't believe that's the case in the US' ???
I didn't say it wasn't possible
to INSTALL a switch, but that they don't come that way.

Depending on vehicle make/model... you're still wrong.
FORD F150 comes standard with a passenger side 'deactivation
switch' and I'm certain it's not the only model that comes with it.
There is also a switch in the seat to temporarily disable the bag
when no-one is sitting in the passenger seat. (Quick web search
finds that the F250 also comes standard with the switch:
http://www.automotive.com/2005/43/ford/f-250/reviews/interior/)
I also said
that many repair shops will refuse to install said switches.
But it's not because of 'liability issues' as you
claimed, they aren't allowed to disable the airbag systems
in any vehicle unless prior approval is received from NHTSA -
nothing however prevents manufacturers from installing the
switches themselves, and as I've pointed out... some do.

That makes you... 0 for 3. Way to go ;)
Had you perused the NHTSA site, you may have seen that
they actually *RECOMMEND* that people in certain
'risk groups' have switches installed to prevent 'air bag deaths'.
http://www.nhtsa.dot.gov/cars/testing/ncap/airbags/Brochure/index.html

That being the case, I wouldn't be surprised to see these switches
installed as standard equipment on more vehicles in the future.


Mark
[followups set to /dev/null :p]
 
J

John W. Kennedy

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

Yes, the feature crept into many compilers long before COBOL 2003 was
finished.
 
C

Chris Hills

Steve O'Hara- said:
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.

As some one said to me a long time ago: Motorcyclists make good car
drivers. Because bad motorcyclists don't survive that long.

It is a pity the same is not true in SW Engineering.
 
C

Chris Hills

Keith Thompson <kst- said:
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,

Yes in some cars. In others you have to have them modified. There are
tow good reasons for doing this.
and I *always* wear my seatbelt and insist that my
passengers do likewise.

*Usually* so do I. However there are times when you do not want them.
These are unsuall circumstances

However there is no occasion when you would want dodgy breaks. If you
don't want to slow down you dont push so hard on the peddle

I might consider turning off the airbags in a
dire emergence if it made the car go faster, but of course it doesn't.

They are not turned of to get more speed. There are two other reasons.
One common and one not so common.

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

No the metaphor is the same you are removing "saftey" for a good
reason. In the case of a care Speed was not the reason. In a similar
vein you do not want some "safe" parts fo the language for some specific
reasons of good engineering.

Remember the rules are for the guidance of wise men and the obedience of
idiots. The problem is 90% think they are the 10%.
 
C

Chris Hills

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.
This is true. Others have to be modified to turn them off.
 
C

Chris Hills

Walter Roberson 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.

[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.]

Also when carrying a child in the front passenger seat a rear facing
child seat.

The other time is when doing security work. If you have to ram, or are
rammed by another vehicle the air bag gets in the way (and can stun you)
and slows you up by a quite few seconds. This can be fatal to you and
your principal. In this situation you NEED the seat belt and working
breaks.

This is a special situation involving experts. Much like C can have the
air bags take off and seat belts removed.

Rather C does not come with set belts and air bags. The trouble is the
"young drivers" are not told to taught to fit them and like al young
drives try trick driving without. That is why we get bad habits.
 
J

J French

Rather C does not come with set belts and air bags. The trouble is the
"young drivers" are not told to taught to fit them and like al young
drives try trick driving without. That is why we get bad habits.

Well put
 
D

Dan

John W. Kennedy said:
Yes, the feature crept into many compilers long before COBOL 2003 was
finished.

Is anyone actually using COBOL 2003? My impression was that very little new
development was being done in COBOL these days. Most shops don't want to
pay to upgrade to a new version if all they are doing is maintaining legacy
code.
 
D

Default User

Mark said:
Depending on vehicle make/model... you're still wrong.
FORD F150 comes standard with a passenger side 'deactivation
switch' and I'm certain it's not the only model that comes with it.
Ok.
But it's not because of 'liability issues' as you
claimed, they aren't allowed to disable the airbag systems
in any vehicle unless prior approval is received from NHTSA -
nothing however prevents manufacturers from installing the
switches themselves, and as I've pointed out... some do.

How does that mean that repair shops refuse to install cutout switches?
Many do for liability reasons.



Brian
 
C

Chris Sonnack

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

"Didja hear about the new Object-Oriented version of COBOL?"
"No!"
"It's called POST-INCREMENT-COBOL-BY-ONE."
 
W

Walter Roberson

[OT]
How does that mean that repair shops refuse to install cutout switches?
Many do for liability reasons.

Depends what you mean by "liability reasons". If a US car repair shop
is not presented with an appropriate letter from NHTSA authorizing the
installation of the airbag cutoff switch, then the shop is disallowed
by law from installing said switch. If the shop goes ahead and installs
the switch anyhow without the proper paperwork, then they are liable
to fines, and possible loss of mechanics license, and possibly
even to lawsuits from distraught relatives alleging that the
unauthorized modification was the -cause- of someone's death
("Sure he was going 80 miles an hour on a wet curve signed for 40 mph --
but he would have survived the 30 foot cliff if his airbag hadn't
been illegally disabled!")

If the proper NHTSA paperwork has been presented, then it just
becomes a standard matter of whether the work was performed
competently, same as any other potential liability that mechanics
face all the time.
 
R

Richard Heathfield

Chris Sonnack said:
"Didja hear about the new Object-Oriented version of COBOL?"
"No!"
"It's called POST-INCREMENT-COBOL-BY-ONE."

Thank you very much for giving an old joke a home.

/me passes the collection plate round.
 
K

Keith Thompson

Chris Sonnack said:
"Didja hear about the new Object-Oriented version of COBOL?"
"No!"
"It's called POST-INCREMENT-COBOL-BY-ONE."

I heard ADD ONE TO COBOL GIVIN COBOL.

Isn't this in the FTJ (Frequently Told Joke) list?
 
D

Default User

Walter said:
[OT]
How does that mean that repair shops refuse to install cutout
switches? Many do for liability reasons.

Depends what you mean by "liability reasons". If a US car repair shop
is not presented with an appropriate letter from NHTSA authorizing the
installation of the airbag cutoff switch, then the shop is disallowed
by law from installing said switch. If the shop goes ahead and
installs the switch anyhow without the proper paperwork, then they
are liable to fines, and possible loss of mechanics license, and
possibly even to lawsuits from distraught relatives alleging that the
unauthorized modification was the -cause- of someone's death
("Sure he was going 80 miles an hour on a wet curve signed for 40 mph
-- but he would have survived the 30 foot cliff if his airbag hadn't
been illegally disabled!")

If the proper NHTSA paperwork has been presented, then it just
becomes a standard matter of whether the work was performed
competently, same as any other potential liability that mechanics
face all the time.

Do you have legal precedent or law that says that if presented with
said documents the installer cannot be held liable for injuries
resulting from the non-presence of the switch?

I'm not being pedantic. I have read of many shops refusing to install
the switches even with signed releases because they (or their insurers)
feared being sued anyway.

Granted, this was some time ago and the "steps" required to get the
switch permits may have alleviated those worries.



Brian
 
J

John W. Kennedy

Dan said:
Is anyone actually using COBOL 2003? My impression was that very little new
development was being done in COBOL these days. Most shops don't want to
pay to upgrade to a new version if all they are doing is maintaining legacy
code.

I think that depends on the shop -- I was working for a place that was
still using COBOL '68 for development when IBM pulled the plug.

--
John W. Kennedy
"Give up vows and dogmas, and fixed things, and you may grow like That.
....you may come to think a blow bad, because it hurts, and not because
it humiliates. You may come to think murder wrong, because it is
violent, and not because it is unjust."
-- G. K. Chesterton. "The Ball and the Cross"
 
D

Dave Thompson

On 12 Sep 2005 15:47:25 -0700, "Rob Thorpe"
Yes. Several programming languages have no concept of pointer that's
visible to the programmer. For example Lisp, Java and Perl have no
pointers. Perl has references which refer, somehow, to another perl
object - effectively equivalent to a pointer.
And in Java _all_ objects use (aliasing) references. (Classic and I'm
pretty sure standard) BASIC has no pointers. FWIW awk has no pointers,
although arrays (not scalars) are by-reference to functions.

Classic FORTRAN and COBOL have no manipulable pointers; they do have
call-by-reference (formally FORTRAN also allows value-result but
that's not feasible for large data). F90 added pointers that are very
type-strict but still can dangle, plus F90 added and F95 and a TR
incorporated into F03 enhanced a more restricted form that are
memory-safe; I haven't checked on recent COBOL.
Lisp's don't have pointers per se. Each name in a lisp program and
almost everything else is "bound" to a piece of data of some type, and
can be freely rebound. Some of these data types can store sequences of
values. So, altogether there is no need for visible pointers.

(There are naturally tons of pointers in actual implementation, but
they're invisible to the programmer).
Lisp "pointers" are quite visible, although (at least classically)
they refer only to cons cells, so might as well be cell ids. E.g.
; A is bound to list (1 2 3) which is a cell whose left (CAR) is 1
; and right (CDR) is a pointer to a cell with left 2
; and right pointer to cell with left 3 and right NIL.
; This can also be written explicitly (1 . (2 . (3 . NIL)))
(SETQ B (CDR A))
(RPLACA B 9)
; A (or what it is bound to) is now (1 9 3)

Conventionally a lot of Lisp code is pure-functional and never
modifies existing data structures, so aliasing doesn't matter, except
when you compare cells for identity (EQ).
Yes, because it's how real machines work.

Concur.

- David.Thompson1 at worldnet.att.net
 
R

Rob Thorpe

On 12 Sep 2005 15:47:25 -0700, "Rob Thorpe"

And in Java _all_ objects use (aliasing) references. (Classic and I'm
pretty sure standard) BASIC has no pointers. FWIW awk has no pointers,
although arrays (not scalars) are by-reference to functions.

Classic FORTRAN and COBOL have no manipulable pointers; they do have
call-by-reference (formally FORTRAN also allows value-result but
that's not feasible for large data). F90 added pointers that are very
type-strict but still can dangle, plus F90 added and F95 and a TR
incorporated into F03 enhanced a more restricted form that are
memory-safe; I haven't checked on recent COBOL.

Ah, I'd forgotten about Basic, and didn't know about recent versions of
Fortran or Cobol.
Lisp "pointers" are quite visible, although (at least classically)
they refer only to cons cells, so might as well be cell ids. E.g.
; A is bound to list (1 2 3) which is a cell whose left (CAR) is 1
; and right (CDR) is a pointer to a cell with left 2
; and right pointer to cell with left 3 and right NIL.
; This can also be written explicitly (1 . (2 . (3 . NIL)))
(SETQ B (CDR A))
(RPLACA B 9)
; A (or what it is bound to) is now (1 9 3)

No, not quite CAR refers to the first element of a pair, CDR the second
element of that pair. A list is formed by a list of pairs. The data is
stored in the CARs and the link to the next pair being stored in the
CDR. This leads to CAR and CDR being called FIRST and REST.

In the above code if A is (1 2 3):
(setq A '(1 2 3))

(car A) is 1
(cdr A) is the list (2 3) , *not* 2

If I do:
(setq b (cdr A)) b is set to (2 3)
then:
(rplaca b 9) b is set to (9 3) because rplaca is a destructive
operation.

These functions can be thought of as implying pointer operations, but
the concept isn't really necessary. Conceptually CAR and CDR access
the elements of a pair, which the lisp implementation deals with.

They need not be implemented quite as the programmer may expect either.
There have been lisp implementations where pairs & lists are
represented in quite subtle ways.

I think programmers of lower level languages like C are more
comfortable thinking of this as pointer manipulation, which is OK.
Conventionally a lot of Lisp code is pure-functional and never
modifies existing data structures, so aliasing doesn't matter, except
when you compare cells for identity (EQ).

Yep, and use the few modifying operations that exist for efficiency.
 
R

Rotes Sapiens

"Didja hear about the new Object-Oriented version of COBOL?"
"No!"
"It's called POST-INCREMENT-COBOL-BY-ONE."

I think I'll try COmmon Business Upgraded Legacy Language.


Sig:
"The cat was once revered as a god. They have never forgotten this" - Anon
 
A

apg

Christopher said:
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.

Really what it all comes down to is good programming. It was suggested
that pointers are valuable to circumvent good programming after all you
wouldn't need to bypass type checking if your programming was logically
correct.

To say that if source code compiles without error means the program is
correct is an error in it's self, there are too many reasons why the
program may be bad. It may be logically incorrect as many are, it may
not have checks on bounds or other sources of overrun to name but a few.
Lastly and I come across this one often it just doesn't fulfill the
customers needs and expectations.

There is nothing wrong with using pointers if they are used properly.
Pointers (indexes) are used in assembler frequently. There should be no
need for pointers in a high level language other than an index to a
record or similar requirement. Strong typing I agree is a pain at times
but if you can't express what you are attempting to achieve without
breaking the rules then there is something wrong and it's probably not
the rules.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top