Results 1 to 8 of 8

Thread: ? Numerology ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Question

    Hi.

    When you all develop apps, do you make sure that your app will perform correctly when the maximum possible values for numbers, text boxes, masked edit boxes, etc. are entered?

    Or do you just program for reasonable values entered by the user?

    Thanks, in advance, for your feedback.

  2. #2
    Guest
    If you mean declaring a Byte or Integer instead of Long, yes I always do that.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    I guess I should be more specific.

    For example, on 1 form you let the user enter the price of an item into a masked edit control. On another form, the user enters the quantity that he/she wants of that item.

    Now, when testing my app, if I enter the [/b]the maximum numbers[/b] (99999, etc.) as the price and do the same for the quantity of items being purchased, I get a ridiculously large number that may even cause errors in my program because of the amount that variables can hold.

    So, my question is, should I even worry about these super-large numbers that will probably never be entered? Or should I code the app in such a way that the user can't enter any values large enough to cause an error.

    I hope you get my drift.

  4. #4
    Guest
    Yes, always be prepared for the unexpected (even though the numbers might be ridiculous). My suggestion is for you to go with the Error Handling method. For example, if you are using an Integer, make sure the number is less than 32,767

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    It depends of what i'm doing, mostly i take time for checking correct input but that doesn't go for experimental apps and making temporary developing tools
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Thanks.

    Kedaman and Megatron.

    I guess I should program for those "ridiculous numbers." But it will probably help me smile later when I don't get unexpected errors.

  7. #7
    Guest
    It is a race between software engineers to produce idiot-
    proof software with the Universe to produce more powerful
    idiots....the Universe is winning.

    Yeah, you gotta go to the bounds of the possible and one
    step beyond. Also, always test for what happens if the
    idiots send Null.


    Good Luck (You'll need it!)
    DerFarm

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Unhappy

    DerFarm, thanks for your reply....I think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width