[vc_row][vc_column][nz_btn text=”Software Resiliency” link=”http://casthighlight.wpengine.com/software-resiliency/” target=”_self” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”normal” hover_normal=”fill” hover_ghost=”fill” icon=”icon-dashboard”][nz_btn text=”Code Reliability” target=”_self” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”ghost” hover_normal=”fill” hover_ghost=”screen” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-resiliency/code-reliability/” icon=”icon-code”][vc_empty_space height=”12px”][vc_row_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Why you should care
[/vc_column_text][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]VB has specific behavior that enable the developer to use variables even if these variables have not been previously declared and typed. However, it is possible to avoid this default behavior using the Option Explicit : in this case, all variables will require a declaration prior use.
This provides 2 main benefits.
The first benefit is a lower memory consumption improving other all application’s performance. This is due to the fact that undeclared variables are automatically created as Variant (large memory consumption).
The second benefit is that this option helps the developer to detect typing errors when writing code. [/vc_column_text][/vc_column_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Business Impacts
Option Explicit is recommended because it greatly increases productivity and makes the code more efficient and less consuming.
[/vc_column_text][nz_btn text=”Production Risk” target=”_self” animate=”false” animation_type=”ghost” color=”pink” size=”small” shape=”rounded” type=”normal” hover_normal=”opacity” hover_ghost=”fill” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/risk/” icon=”icon-office”][/vc_column_inner][/vc_row_inner][vc_empty_space height=”12px”][vc_empty_space height=”32px”][vc_single_image image=”5362″ img_link_large=”” img_link_target=”_self” img_size=”full” alignment=”none”][vc_row_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
CAST Recommendations
Option Explicit is recommended for VB users as it allows for improving the business aspects of the application portfolios that are developed in the company. As such, Option Explicit should be utilized in the company’s style guides that encourage developers to focus on lowering memory consumption and improving performance for their respective applications.[/vc_column_text][/vc_column_inner][vc_column_inner width=”1/2″][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
References
https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/option-explicit-statement[/vc_column_text][nz_btn text=”Style Guide” target=”_self” animate=”false” animation_type=”ghost” color=”turquoise” size=”small” shape=”rounded” type=”ghost” hover_normal=”fill” hover_ghost=”fill” link=”https://github.com/Kristories/awesome-guidelines” icon=”icon-book”][/vc_column_inner][/vc_row_inner][vc_separator color=”grey” align=”align_center” style=”” border_width=”” el_width=””][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
How we detect
[/vc_column_text][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
This code insight retrieves all VB Modules and Frames not using the Option explicit.
[/vc_column_text][vc_empty_space height=”12px”][vc_separator color=”grey” align=”align_center” style=”” border_width=”” el_width=””][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Impacts
[/vc_column_text][nz_btn text=”Cloud” target=”_self” animate=”false” animation_type=”ghost” color=”sky” size=”small” shape=”rounded” type=”normal” hover_normal=”opacity” hover_ghost=”fill” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/Efficiency/”][nz_btn text=”Memory, Network, & Disk Space Management” target=”_self” animate=”false” animation_type=”ghost” color=”peacoc” size=”small” shape=”rounded” type=”ghost” hover_normal=”opacity” hover_ghost=”fill” link=”http://casthighlight.wpengine.com/category/product/indicators-methodology/Efficiency/”][vc_empty_space height=”12px”][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
Physical Environments referenced in Code: Option Explicit ensures resources, and memory, are not being wasted when portfolios are being adopted for Cloud-Computing purposes.
[/vc_column_text][vc_empty_space height=”12px”][vc_row_inner][vc_column_inner width=”1/1″][vc_single_image image=”5362″ img_link_large=”” img_link_target=”_self” img_size=”full” alignment=”none”][vc_column_text pl=”0″ pr=”0″ pt=”0″ pb=”0″]
About CAST and Highlight’s Code Insights
Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.
[/vc_column_text][vc_empty_space height=”16px”][nz_btn text=”See features” link=”http://casthighlight.wpengine.com/outputs-analytics/” target=”_self” icon=”icon-stats” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”normal” hover_normal=”fill” hover_ghost=”fill”][nz_btn text=”How it works” link=”http://casthighlight.wpengine.com/how-it-works/” target=”_self” icon=”icon-cog” animate=”false” animation_type=”ghost” color=”black” size=”small” shape=”rounded” type=”ghost” hover_normal=”fill” hover_ghost=”fill”][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row]
Leave a Reply