olka
olka

Reputation:

Do you use strict off in your projects?

Do you use 'strict off' option, 'explicit off'? Or may be 'strict custom' and some other options like 'Implicit type. Object assumed', 'Late binding', 'Implicit conversion'?

Upvotes: 3

Views: 449

Answers (8)

John Donoghue
John Donoghue

Reputation: 63

I usually have Strict OFF if I'm doing some quick-and-dirty prototype or spike where I know I won't have to maintain the code in future.

The word "know" is key here though, if there's any chance the code will migrate into something you need to support then set Strict ON and deal with any errors before they come back to bite you.

Upvotes: 0

Matt Wilko
Matt Wilko

Reputation: 27322

Option Strict Off and Option Explicit Off are False Economies in production code.

You will spend more time chasing strange bugs than it takes to write your code error and warning free in the first place. My experience has taught me this.

The only exceptions is when I need to use late binding in which case I have to switch it off.

Upvotes: 0

Anthony
Anthony

Reputation: 923

I have done it both ways. Always have it on. I did not have it on when was doing some quick and dirty vbscripts and it cost me debugging time. Turn it on, keep it on

Upvotes: 0

Cruachan
Cruachan

Reputation: 15971

Always develop in any language with full warnings and restrictions on. No exceptions, ever.

To do otherwise is a false economy, sure it may seem to work, but sure as hell it'll come back to bite you later

(currently debugging a series of PHP web applications where the original 'coder' had suppressed all errors and which, literally, display several hundred errors per page when enabled. "Make sure variables are defined before using them in tests? Why would I do that when i can just suppress the error and not have to think?" )

Upvotes: 5

Fredou
Fredou

Reputation: 20090

I always turn Strict ON when I start a new project or when I receive an active project

I will never provide support on a project with that OFF, ever

Upvotes: 0

JaredPar
JaredPar

Reputation: 754545

Generally I leave Option Strict On at the project level because in general I want strict semantic checking. In the cases where I do want to use late binding I will turn Option Strict Off at the file level.

Upvotes: 3

John Saunders
John Saunders

Reputation: 161773

Never. OPTIONS STRICT OFF is the same as OPTIONS BADPROGRAMMING ON.

OPTIONS STRICT OFF relaxes some of the checks that VB.NET makes. It relaxes language rules. Those rules are there to save you from yourself. Don't ever prevent the language from saving you from yourself. This is especially true if you're coming from a more releaxed environment, in which case chances are that you need saving.

Another thing to note is that most programming languages don't have a switch to say: please allow me to shoot myself in the foot.

Upvotes: 15

Iain Hoult
Iain Hoult

Reputation: 4005

I like to use Strict=On, so my code fails at compile time rather than when it's gone live, and Explicit=On because in a static language it would be kind of weird not to declare your variables.

Upvotes: 2

Related Questions