Storing the size of an array in the structure itself

  • Thread starter Wynand Winterbach
  • Start date
R

Rob Thorpe

Mike Wahler said:
I wouldn't call it (lack of a memory access 'safety net)'
a 'hole' in the language at all. Some might deem having it
a nicety, but it's certainly not needed. It would also impose
an unnecessary restriction on implementations, especially those
tailored for maximum efficiency (rather than 'safety').
Someone here recently said "C is a sharp tool". I agree, and
I like it that way. :)

-Mike

Just out of curiosity, why do you like it that way?

I've always found it irritating, but tolerable.
 
D

Dan Pop

In said:
Just out of curiosity, why do you like it that way?

Because correct code doesn't have to suffer from the overhead related to
bound checking.

Because such checking is next to impossible to get right in a language
like C. I have seen a confused poster: his code was correct, but the
compiler got the bound checking wrong.

Because people tend to be less careful when they know a "safety net"
exists, no matter how large the holes in this safety net are.

Dan
 
R

Rob Thorpe

Because correct code doesn't have to suffer from the overhead related to
bound checking.

Why should it anyway?
Because such checking is next to impossible to get right in a language
like C. I have seen a confused poster: his code was correct, but the
compiler got the bound checking wrong.

No it isn't. See the link I sent last time we discussed this.
Because people tend to be less careful when they know a "safety net"
exists, no matter how large the holes in this safety net are

Maybe people tend to be less careful driving cars with airbags in than
those without. It doesn't make it a bad idea.
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top