Re: int/long unification hides bugs

From: kartik vaddadi (kartick_vaddadi_at_yahoo.com)
Date: 10/27/04


Date: Tue, 26 Oct 2004 20:14:49 -0700 (PDT)
To: Josiah Carlson <jcarlson@uci.edu>, python-list@python.org


--- Josiah Carlson <jcarlson@uci.edu> wrote:

>
> kartick_vaddadi@yahoo.com (kartik) wrote:
>
> > integers are used in different ways from strings.
> i may expect file
> > paths to be around 100 characters, and if i get a
> 500-character path,
> > i have no problem just because of the length. but
> if a person's age is
> > 500 where i expect it to be less than 100, then
> **definitely**
> > something's wrong.
>
> So *you* need to do bounds checking.

do you check every assignment for bounds? can you?
overflow errors catch bugs when you dont do the
checks.

> > as i look at my code, i rarely have an issue with
> string sizes, but if
> > an integer variable gets very large (say > 2**31
> or 2**63), it
> > generally reflects a bug in my code.
>
> And you should check that, and not rely on a
> misfeature and a mistake.

why do u want me to check something that the language
can do? for precisely this reason, i consider this not
to be a misfeature or a mistake.

> I don't rely on overflow errors. [...]
> I prefer to check my variables when I rely on them.

i never talked about *relying* on overflow errors to
ensure the correctness of code. it's only a mechanism
that catches bugs in some cases - & that's valuable.

-kartik

                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail



Relevant Pages

  • Re: c / c++ : is it end of era ?
    ... When you start talking about "bugs in the language", ... Zero terminated strings. ... array information is never destroyed. ...
    (comp.lang.c)
  • Re: Lots of noise about user agent strings
    ... it appears to be someone who has made a serious mistake complaining about the reality that made it a mistake. ... | had unique User-Agent strings which let the server know ... HTTP clients have not had unique UA strings for well over a decade now, and even UA strings that were distinct from others were explicitly designed to prevent the server from knowing which client was being used. ... I may not get to look at mobile device browsers that often but to date the vast majority of the scriptable browsers I have examined have had UA strings that were more or less indistinguishable from those of IE 6. ...
    (comp.lang.javascript)
  • Re: FireFox: Typing Address NAME ONLY In Address Bar No Longer Works
    ... Frank, I had just been in the about:config area on a tip the keyword.url ... I did find some yahoo strings. ... the Yahoo search has replaced the Google "I'm Lucky" search. ...
    (alt.sys.pc-clone.dell)
  • Re: Cohens paper on byte order
    ... > And make mistake. ... FIPS-197 specifies neither interface nor implementation. ... strings. ... > indirect definition only. ...
    (sci.crypt)
  • Re: Zero terminated strings
    ... What bugs me the most about this thread is that it pushes ... zero terminated strings is impossible. ... Isn't this a forum for discussing the C language? ... got any arguments Mr Pitcher. ...
    (comp.lang.c)