Results 1 to 2 of 2

Thread: ery very small question.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    ery very small question.

    Hey i was wondering, is it better practice to include checks before doing something?

    for ex

    Code:
     If InStr(payamt.Text, "$") > 0 Then
                payamt.Text = payamt.Text.Replace("$", String.Empty)
                MsgBox(payamt.Text)
                Return False
            End If
    as opposed to taking out the if, and doing a straight replace
    obviously something like that wont hurt performance, but still.. you know? lol

    Note: THIS IS JUST AN EXAMPLE. Please do not say "it will throw an exception if you try to replace something thats not there". I am talking about a general case

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: ery very small question.

    Yes!
    Foolproof you applications.
    You should catch all expected errors on your own.
    Users have a way of inadvertantly testing your application for you.

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