Not Implicitly Typed Local Variable

5 posts, 0 answers
  1. Joel Palmer
    Joel Palmer avatar
    164 posts
    Member since:
    May 2009

    Posted 16 Dec 2015 Link to this post

    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?
  2. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 21 Dec 2015 Link to this post

    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
  3. DevCraft banner
  4. WaldenL
    WaldenL avatar
    3 posts
    Member since:
    Apr 2007

    Posted 08 Feb Link to this post

    >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

  5. Chris May
    Chris May avatar
    31 posts
    Member since:
    Nov 2009

    Posted 23 Aug in reply to Svetlozar Link to this post

    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?

  6. Svetlozar
    Admin
    Svetlozar avatar
    269 posts

    Posted 26 Aug Link to this post

    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
Back to Top
DevCraft banner