Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Why Option Strict On?

Hello

Does "Option Strict On" has any type of advantage while debugging? Less memory usage? Why should it be turned on?

Or it is just a good coding practise 🤦‍♂

There was one of my project which was ok with option strict off but there were around 62 errors when i turned on option strict on.

But they were solved by just Cstr and other problems .... 🤗
It is very usefull while coding. If it is explicit, you will need to do all cast manually.
Do you know what does it mean!? xD
Yes it is better for the performance of your application.
There are several reasons why you should have Option Strict On.

From MSDN
http://msdn.microsoft.com/en-us/library/...80%29.aspx Wrote:Data loss can occur when the value of one data type is converted to a data type with less precision or smaller capacity. A run-time error occurs if such a narrowing conversion fails. Option Strict ensures compile-time notification of these narrowing conversions so they can be avoided.

Because Option Strict On provides strong typing, prevents unintended type conversions with data loss, disallows late binding, and improves performance, its use is strongly recommended.
[Image: Xtddh8V.png]
Thanks felicinox, Aeonhack , Fake™ for the info


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersApr 29, 2024 05:37 AM 27 469 Apr 29, 2024 05:37 AM
Last Post: nucleo_type09
[.NET] by MoenApr 29, 2012 03:22 PM 4 196 Apr 29, 2012 03:22 PM
Last Post: Moen