Results 1 to 10 of 10

Thread: Option Strict On

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Option Strict On

    Do you guys use it? I read in a VB.NET book that its highly recommended because it just makes for better code. It is somewhat of a pain in the ass because you have to convert values constantly from string to integer etc.

    I have been using it just because of the general rule that its good practice. I would have to image most people DONT use it though

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I don't use it because I feel that VB wasn't meant to be strict. If I want to deal with all the casting and conversion stuff, I use C#. If I just need to put something together and prove that it will work, I use VB without Option Strict.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    well being that im not a C# programmer, would you suggest using it for at least the production apps i build?

    I agree if im just doing something for fun or for testing I wouldnt bother

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    I use, and I'd recomment using.... same with Option Explicit On.... but to each their own.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    I use Option explicit but not option strict, also if often I try to write code as if option strict was ON. I prefer to be free to choose. Sometime is too comfortable don't have to respect that rigid rule!
    Live long and prosper (Mr. Spock)

  6. #6
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    The Big D
    Posts
    310
    I don't always use it because I have apps that use late binding to an Excel COM object and you can't late bind with Option Strict ON.

  7. #7

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    well its at the moduler level right? not the project level. so you could turn it off in a module that needed late binding or something like that

  8. #8
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    I use it because it helps me understand/learn .Net better by forcing me to realize some of the mechanics of what's going on.

  9. #9
    Lively Member TLord's Avatar
    Join Date
    Jun 2004
    Posts
    95
    I use option strict on.

    It just makes my code better and cleaner.
    Do you think my life is easy?
    Do you think it's good to win?
    do you think it's nice to kill?
    Do you think learning is a must?
    Do you think computers are nothing?
    Do you think this post is stupid?
    Do ypu think we're really humen?

    DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !

  10. #10
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    I always use Option Strict On, even though it can sometimes be a royal pain. It all helps with the learning process, and you get better code at the end IMHO.
    Nick.

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