Any ReSharper users out there?



  • How are you supposed to feel when you open up a file in a project and see this in the margin?

    [img]http://img403.imageshack.us/img403/2340/uhohlr6.png[/img]



  • I'm going to guess that this is similar to the error and warning highlighting in Eclipse?

    You're probably just missing a library or something. 



  • Either that, or it's showing where people have made changes to the code since the last time you've seen it. Anyway, that much highlighting just can't be caused by something healthy.



  • Yup, error and warning highlighting. Nope, not missing a library. The code actually builds. ReSharper highlights things like unused variables and values, conditional tests that are always true/false, redundant scope/namespace qualifiers, empty catch blocks, etc..



  • Depending on how I felt at the time of opening, It would either put a dent in my attitude or even make me break down and cry. I guess fix a few of them at a time, otherwise you will go stark raving mad.

     



  • @djork said:

    Yup, error and warning highlighting. Nope, not missing a library. The code actually builds. ReSharper highlights things like unused variables and values, conditional tests that are always true/false, redundant scope/namespace qualifiers, empty catch blocks, etc..

    I may be naive, but shouldn't you, as an experienced, professional programmer have the skills to detect such things when you think up your code?

    I mean, I can understand the unused variables thing, if you maybe just declare all variables, planning to use them later and then forget about them. But this is usually reported by compilers and/or IDEs without any plugins already.

    But constant conditionals? Redundant qualifiers? Hello? This seems about as reasonable to me as installing a gadget in a truck driver's cabin that will remind him when he forgets if they drive on the left or on the right...



  • @PSWorx said:

    @djork said:

    Yup, error and warning highlighting. Nope, not missing a library. The code actually builds. ReSharper highlights things like unused variables and values, conditional tests that are always true/false, redundant scope/namespace qualifiers, empty catch blocks, etc..

    I may be naive, but shouldn't you, as an experienced, professional programmer have the skills to detect such things when you think up your code?

    I mean, I can understand the unused variables thing, if you maybe just declare all variables, planning to use them later and then forget about them. But this is usually reported by compilers and/or IDEs without any plugins already.

    But constant conditionals? Redundant qualifiers? Hello? This seems about as reasonable to me as installing a gadget in a truck driver's cabin that will remind him when he forgets if they drive on the left or on the right...

    Sure, I don't have a problem with analyzing my own code. ReSharper doesn't do much for me in that department when I'm writing something new... but this stuff is not MY code, and I'm thankful for the highlighting in that case!



  • Yeah, I'm working with a lot of code I didn't write... it's amazing how much can be fixed by cleaning up redundant "this" references and fully specified namespaces on classes.

    But ReSharper does occasionally get mixed up and fail to find a reference, even though it compiles.  Once I had a warning about a namespace name not matching a directory name, but the namespace it thought I was using was one I was formerly using, and I could not find any reference to that name in any file.  It kept popping up with that warning (metaphorically) even after deleting all the resharper files associated with my project so it regenerated from scratch (two or three times) .



  • @PSWorx said:

    @djork said:

    Yup, error and warning highlighting. Nope, not missing a library. The code actually builds. ReSharper highlights things like unused variables and values, conditional tests that are always true/false, redundant scope/namespace qualifiers, empty catch blocks, etc..

    I may be naive, but shouldn't you, as an experienced, professional programmer have the skills to detect such things when you think up your code?

    I mean, I can understand the unused variables thing, if you maybe just declare all variables, planning to use them later and then forget about them. But this is usually reported by compilers and/or IDEs without any plugins already.

    But constant conditionals? Redundant qualifiers? Hello? This seems about as reasonable to me as installing a gadget in a truck driver's cabin that will remind him when he forgets if they drive on the left or on the right...

     
    Spoken like a true amateur.  He's obviously talking about opening someone else's code.



  • @djork said:

    conditional tests that are always true/false

    My conditional tests always return true or false. Unless they return FILE_NOT_FOUND.

     



  • @djork said:

    conditional tests that are always true/false


     

    Then they would throw a ZeroDivideException, would they not?   Unless evaluated in IEEE 754 with exceptions turned off, when they'd return +inf.  Conditional tests that are always false/true would be always false, so the test would seem redundant and could be removed if it had no side-effects†.

     

     † If you encounter disturbing side-effects, discontinue use and see your doctor.

     

     



  • @PSWorx said:

    @djork said:

    Yup, error and warning highlighting. Nope, not missing a library. The code actually builds. ReSharper highlights things like unused variables and values, conditional tests that are always true/false, redundant scope/namespace qualifiers, empty catch blocks, etc..

    I may be naive, but shouldn't you, as an experienced, professional programmer have the skills to detect such things when you think up your code?

    I mean, I can understand the unused variables thing, if you maybe just declare all variables, planning to use them later and then forget about them. But this is usually reported by compilers and/or IDEs without any plugins already.

    But constant conditionals? Redundant qualifiers? Hello? This seems about as reasonable to me as installing a gadget in a truck driver's cabin that will remind him when he forgets if they drive on the left or on the right...

    If redundant qualifiers includes things like:

    class SomeClass
    {
        static int doSomething () { ... }
        int doSomethingElse () { ... }
        void redundafyQualifiers () {
           this.doSomethingElse ();
           SomeClass.doSomething ();
        }

    }

    then there's a simple reason: intellisense.
         



  • @bstorer said:

    then there's a simple reason: intellisense.
         

    And if it's things like "System.Exception" and "mshtml.IHTMLDocument" when the namespaces are included?

    How about this gem:

    o = (object)0;
    foo = (IHTMLElement)elements.item(o, (object)0);
    


  • Try creating a Strongly Typed Dataset and look at all the warnings in the generated code.  It is pretty much a solid orange bar.

    Also, speaking of resharper, I sometimes get errors along the lines of "Argument type 'Microsoft.Interop.Word.Document' cannot be converted to parameter type 'Microsoft.Interop.Word.Document'".

    It has something to do with it not recognizing the COM references correctly.



  • Don't the red lines show compile errors?



  • Yes, but sometimes resharper gets confused (especially with complex reference graphs or com references) and thinks there is an error, but it really compiles just fine.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.