Convert native character string to ASCII array of integers

  • Thread starter Tomás Ó hÉilidhe
  • Start date
I

Ian Collins

Tomás Ó hÉilidhe said:
Of course, things like ECC should be used for sending data across the
internet and for reading from drives... but I don't think we'd get
very far in programming if we didn't assume that the CPU and RAM
always do their job perfectly.

If RAM did its job "perfectly", we wouldn't have ECC RAM.
 
T

Tomás Ó hÉilidhe

If RAM did its job "perfectly", we wouldn't have ECC RAM.


RAM error-checking is a layer below programming. In programming, RAM
is assumed to be perfect.
 
R

Richard

Ian Collins said:
If RAM did its job "perfectly", we wouldn't have ECC RAM.

What on earth are you suggesting? You do NOT assume that RAM is working
perfectly? I'm impressed because with that level of paranoia then you
cant even program around it since the program itself could be
compromised.
 
S

santosh

Tomás Ó hÉilidhe said:
RAM error-checking is a layer below programming. In programming, RAM
is assumed to be perfect.

Not in all types of programming. System software (like BIOS) often do
several types of hardware checks routinely, before bringing up the
system. But yes, for application programming it's not appropriate to
check RAM, files, and network packets. This is what the hardware and
system software is for.
 
C

CBFalconer

Harald said:
.... snip ...

You knew the code wouldn't work without initialisation. You didn't
make the same assumption here, not even after Tomás told you the
initialisation wasn't missing in the original code. Why not?

I listed the things I found suspicious, as follows:

The missing terminal '\0' is serious, but possibly covered in
earlier articles. The lack of handling of 'char not found' is
still more serious. A simple mention of the earlier initialization
of pc and pos would have sufficed.

Are you all now recommending not criticizing any code seen here?
And I unconditionally reject advice to check other items in a
thread - this is Usenet, and they may never have arrived, and may
never arrive in the future. Besides which, even if present, doing
such checking is a pain. That's what quotes are for.
 
C

CBFalconer

Gordon said:
.... snip ...

I suppose that ECC memory for critical applications, CRCs on disk
sectors, and checksums on TCP packets are just wasted effort?

s/critical/all/
 
C

CBFalconer

Tomás Ó hÉilidhe said:
.... snip ...


RAM error-checking is a layer below programming. In programming,
RAM is assumed to be perfect.

Which is nicely approximated by installing an ECC system. Cheap.
 
H

Harald van Dijk

I listed the things I found suspicious, as follows:


The missing terminal '\0' is serious, but possibly covered in earlier
articles. The lack of handling of 'char not found' is still more
serious. A simple mention of the earlier initialization of pc and pos
would have sufficed.

Tomás _did_ respond that the initialisation was not missing. I told you
he said so, and I quoted where he said so. After that, you repeated that
the initialisation was missing. That's the part I object to.
 
C

CBFalconer

Harald said:
Tomás _did_ respond that the initialisation was not missing. I told
you he said so, and I quoted where he said so. After that, you repeated
that the initialisation was missing. That's the part I object to.

This is stoopid. As I recall, he made the statement, and backed it
up by showing the code without any initialization. This was not
especially believable.
 
H

Harald van Dijk

This is stoopid. As I recall, he made the statement, and backed it up
by showing the code without any initialization. This was not especially
believable.

As I read it, the code was backing up his other statements, and when
Tomás responded saying the initialisation was not missing, he didn't do
anything to try to back it up that specific statement. At that point I
believe you should be the one to demonstrate that pos and pc were
definitely used uninitialised, if you say they are. As I said, no
declaration was shown either, and you assumed one was present (which I
have no problem with). However, if you had seen or looked up the
declaration, you would have noticed it was a function parameter, and
function parameters _cannot_ be used uninitialised.

A possible reply, still without having to look at any older messages,
would have been to say
"Also, this code doesn't show the initializion of pc and pos."
instead of
"However, you are still failing to initialize pc and pos."
 
R

Richard Heathfield

CBFalconer said:

This is stoopid.

Yes. But if you would just remember to read before writing, you would have
a fair chance of avoiding stoopid.
As I recall, he made the statement, and backed it
up by showing the code without any initialization. This was not
especially believable.

It was perfectly believable to those who have *READ THE THREAD*.
 
C

CBFalconer

Richard said:
CBFalconer said:



Yes. But if you would just remember to read before writing, you
would have a fair chance of avoiding stoopid.


It was perfectly believable to those who have *READ THE THREAD*.

Nobody in their right mind spends time reading a whole Usenet
thread to reply to a single message. You have a right to criticize
if I missed something in the replied-to article (including
quotes).
 
R

Richard Heathfield

CBFalconer said:

Nobody in their right mind spends time reading a whole Usenet
thread to reply to a single message.

Nobody in their right mind wastes time replying to a single message in a
thread they haven't otherwise read, and then tries to justify their
failure to comprehend the discussion when that failure is clearly a
function of their own laziness.
You have a right to criticize
if I missed something in the replied-to article (including
quotes).

You have a right not to make an idiot of yourself. Please exercise it.
 
L

lawrence.jones

Ian Collins said:
If RAM did its job "perfectly", we wouldn't have ECC RAM.

Most of us don't. :-(

-Larry Jones

You can never really enjoy Sundays because in the back of your
mind you know you have to go to school the next day. -- Calvin
 
L

lawrence.jones

CBFalconer said:
And whose fault is that? Be specific.

There's lots of blame to go around: the consumers who don't demand it,
the manufacturers who don't supply it, the reliability of RAM which
makes it appear unnecessary (or at least not cost effective), and the
unreliability of software which makes it seem irrelevant. :)

-Larry Jones

Well, it's all a question of perspective. -- Calvin
 
C

CBFalconer

There's lots of blame to go around: the consumers who don't demand
it, the manufacturers who don't supply it, the reliability of RAM
which makes it appear unnecessary (or at least not cost effective),
and the unreliability of software which makes it seem irrelevant.
:)

I put it primarily on the consumer, who wants to save the last
fifteen dollars of the original price. Secondarily I put it on the
idiots who claim it is pointless. The moment the user has a
destroyed machine because of a silly transient memory error the
idiot is shown up, but only if that user has a good idea of what is
going on anyhow. The manufacturer is just filling a demand. The
unreliable software gets away with it because everything else is so
flakey.
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top