This is a migrated thread and some comments may be shown as answers.

Not Implicitly Typed Local Variable

4 Answers 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joel Palmer
Top achievements
Rank 2
Joel Palmer asked on 16 Dec 2015, 06:05 PM
I like my local variables explicit.  I'm actually not sure why this is the default but, I want the "Not Implicitly Typed Local Variable" message and underline turned off.  How do I do this?

4 Answers, 1 is accepted

Sort by
0
Svetlozar
Telerik team
answered on 21 Dec 2015, 03:12 PM
Hello,

Thank you for your feedback!

I assume you are using Visual Studio 2015. You can set how you prefer your variable declarations from JustCode Options | Code Style | C# | General | 'Use implicitly typed variable declarations'.

Then you can disable the warning from JustCode Options | Code Analysis | Problems | C# |  'Arrange variable declaration type' if you don't want JustCode to enforce variable declarations. 

Let me know if you have other questions.

Regards,
Svetlozar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
WaldenL
Top achievements
Rank 2
answered on 08 Feb 2016, 08:38 PM

>you can disable the warning from JustCode Options

I'd missed that along the way, I can't tell you how happy that makes us! Yes, standards are a great thing, but we're also not going to change code just for the sake of changing code, and this makes all those yellow squiggly lines go away. Awesome! 

 -Walden

0
Chris May
Top achievements
Rank 1
answered on 23 Aug 2016, 06:21 PM

I'm curious why implicit would be preferred over explicit, in terms of it being the default rule.

Is there a reason why it's deemed preferable to use VAR instead of the concrete type?

0
Svetlozar
Telerik team
answered on 26 Aug 2016, 02:48 PM
Hello,

There is nothing special about it, the default value is just our internal coding convention and it turned out to be well accepted by our clients.

The var vs explicit type debate doesn't have a clear winner as both camps have their own opinions. 

Regards,
Svetlozar
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Joel Palmer
Top achievements
Rank 2
Answers by
Svetlozar
Telerik team
WaldenL
Top achievements
Rank 2
Chris May
Top achievements
Rank 1
Share this question
or