rspec/rules/S1663/vb6/rule.adoc

21 lines
406 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Declaring a variable without specifying its data type leaves the compiler to assign the type that seems the most appropriate - whether it's what you need or not. Therefore you should always specify the data type.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
Const MyVar = "459"
'...
Dim NumberOfEmployees
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
Const MyVar as String = "459"
'...
Dim NumberOfEmployees As Integer
----