• Tsaukpaetra (disco)

    I thought that kind of behavior was just impractical, until I found a copy-pasted snippit of:

    MyObject.destroy();
    MyObject.close();
    MyObject = null;
    

    Apparently, somehow in a previous compilation of the project this was perfectly reasonable, until I upgraded the library packages and everything fell flat on its face.

  • Yazeran (disco)

    Well the big question is what this sfd thing is (Im' no expert on c#). If it is some custom complex object with a large ToString function which would give a string with spaces (potentially containing specific setup information such as a path), then it could make some sense (barely though, and hope that the path contains no spaces...). however if it is an object which only ever returns a string without spaces (as any sane numeric object should with the potential exception of complex numbers), then yes WTF indeed....

  • Michael_Mahn (disco)
    Comment held for moderation.
  • Choonster (disco) in reply to Yazeran
    Comment held for moderation.
  • Steve_The_Cynic (disco) in reply to Choonster
    Comment held for moderation.
  • PWolff (disco) in reply to Steve_The_Cynic
    Steve_The_Cynic:
    online help

    What if the author of that code snippet didn't have online access to microsoft.com, and having a look into the Object Browser was considered un-enterprisey?

  • JBert (disco) in reply to PWolff

    Then he should be fired.

     

    Out of a cannon.

     

    Into the nearest pit of mute killer rabits.

    Seriously, just install the MSDN docs locally if you know you're on a spotty Internet connection.

  • RFoxmich (disco) in reply to Michael_Mahn

    Though very trying this code is.

  • Tsaukpaetra (disco) in reply to PWolff

    Look at the Object Browser? How dare you even mention such dark magics!

  • Magus (disco) in reply to Tsaukpaetra

    I prefer looking at the disassembly generated by dotPeek.

  • Guru_Evi (disco)

    The real WTF is: Why didn't the compiler catch this? If you try to do something similar in C or Java, heck perhaps even JavaScript, your compiler, if not the IDE would've barfed all over it. I know Eclipse does for certain languages point out that this won't work.

  • dkf (disco) in reply to Guru_Evi
    Guru_Evi:
    Why didn't the compiler catch this?

    That would require the compiler to do accurate tracing of what is null. That sort of thing is often just a warning, and thus susceptible to being disabled in the IDE options…

  • Tsaukpaetra (disco) in reply to dkf

    Yeah, the warning was probably overridden under the same umbrella that forbids the compiler from complaining about unreachable code.

  • blakeyrat (disco) in reply to Tsaukpaetra

    I've had to integrate a DLL into a project once using only the Object Browser. It kind of sucks. It works, but it sucks.

    I to this day do not understand why there's no option in VS to grab the Obejct Browser meta-data and put it in the Intellisense meta-data. That alone would make it 10 times easier.

  • Tsaukpaetra (disco) in reply to blakeyrat

    :heart_eyes_cat: If you could do that....

    For some reason I had in my mind that you could generate .map files for objects. I don't think that actually works for DLL imports (?) but if it did, you could fudge the issue by querying OB and writing out the translation into a .map file.

  • TheCPUWizard (disco) in reply to blakeyrat
    blakeyrat:
    to this day do not understand why there's no option in VS to grab the Obejct Browser meta-data and put it in the Intellisense meta-data. That alone would make it 10 times easier.

    There are utilities/add-ins that will do exactly this.

  • boomzilla (disco) in reply to TheCPUWizard
    TheCPUWizard:
    There are utilities/add-ins that will do exactly this.

    Please be ReSharper. Please be ReSharper. Please be ReSharper. Please be ReSharper. Please be ReSharper.

Leave a comment on “Save Yourselves!”

Log In or post as a guest

Replying to comment #:

« Return to Article