Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Enterprise
Expertise: Intermediate
May 5, 1998



Application Security Testing: An Integral Part of DevOps

Declare Your Objects Properly

Never declare a variable as a "New" of type "object," but always rather just as of type "object." If you do so you will always increment the reference count of the object, even though you do not use it. Also, always remember to set your objects to nothing when finished. The wrong way is:
Private Sub Foo()
    Dim oCust as New clsCust

    'do stuff with oCust

End Sub
The right way is:
Private Sub Foo()
    Dim oCust as clsCust

    Set oCust = New clsCust
    'do stuff with oCust
    Set oCust = Nothing

End Sub
Joe Karbowski
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date