A couple of Visual Studio WTFs - Warning:Large Images



  • This happened yesterday when I attempted to use help (of course Google is far better at searching MSDN than anything Microsoft makes):


    objectmoved.png

     

    Then this today... I noticed that "System.DBNull" expands to itself, which expands to... itself, and so on... Couldn't get it to crash though...

    dbnull.png



  • Just click help for more information, like its gonna solve all your problems.



  • Sorry to do this, but someone had to say it:

     The Real WTF is that you appear to be writing code in Visual Basic
     



  • @TheRubyWarlock said:

    Sorry to do this, but someone had to say it:

     The Real WTF is that you appear to be writing code in Visual Basic 

    and most of the IDE seems to be covered by a black box.  Personally, I'd look into those things and see if the DBNull issue doesn't resolve itself.

    </sarcasm>



  • @TheRubyWarlock said:

    Sorry to do this, but someone had to say it:

     The Real WTF is that you appear to be writing code in Visual Basic
     

    Nothing wrong with VB in the hands of an experienced coder.  But once you're an experienced coder, you should move on to a new language.  Personally, I've moved on to Java, but almost any non-VB language will suffice.

    Making no comment on the programming skills of the OP. 



  • @belgariontheking said:

    Nothing wrong with VB in the hands of an experienced coder.  But once you're an experienced coder, you should move on to a new language.

    Is it just because it's earlier than 8am, or does that contradict itself?



  • @rbowes said:

    @belgariontheking said:

    Nothing wrong with VB in the hands of an experienced coder.  But once you're an experienced coder, you should move on to a new language.

    Is it just because it's earlier than 8am, or does that contradict itself?

    I was trying to say two different things.  

    VB gives an inexperienced coder (or someone who's not even a coder) the power to do really neat things, but since they're inexperienced coders, they create WTFs, like 30-page long functions with 3/4 of them being repeated code.  Think VBA.  Other languages are complex enough that you need to know a thing or two about coding to use them.  Think C++, Java, etc.

    Once you've mastered coding in VB, it's time to move on to what I'd call a "real language" like Java, C++, C#.  VB is great for teaching how to code.  I first learned how to code with QBasic in the 90s, but as I moved up to more and more complex languages, I learned more about how to code.  I also learned how simple and english-like code could be with COBOL and SQL.

    In essence, I agree with the poster I quoted in saying that "VB is for n00bs."  Also, I'd like to add that "Microsoft sucks!"

    </excitement> 



  • @belgariontheking said:

    VB is great for teaching how to code.

    I really don't think so. It teaches bad habits and sloppy work. 



  • There is only one instance of System.DBNull, accesses thru the value property. It's a singleton implementation. Not a wtf. You'll find this in many classes. It takes an extra "special" kind of person to take the time to keep traversing an obvious singleton model though, Did you expect it would suddenly change with the 101st child? Do you repeatedly add 1 and 1 on your calculator waiting for "3" to come up?

     



  • @asuffield said:

    @belgariontheking said:

    VB is great for teaching how to code.

    I really don't think so. It teaches bad habits and sloppy work. 

    Ridiculous. People teach bad habits, not languages. Anyone can use a tool incorrectly, just as anyone can use a tool correctly. The difference between a good carpenter and a bad one does not lie in their hammers.



  • @asuffield said:

    @belgariontheking said:

    VB is great for teaching how to code.

    I really don't think so. It teaches bad habits and sloppy work. 

    That has more to do with the teacher than the tool.  Unfortunately, some people use poor teachers (some books and online tutorials, poor programmers) to learn the tool.  I used to code in VB, and I think I had good habits and clean code, and I credit my teachers in college.  I've since moved on to other languages, but I would still suggest VB as a beginner's language, if it's taught properly right from the start.



  • I'd just like to add that I made my comment as a joke at the myriad of folks who point out in the frontpage articles that "The Real WTF is VB" or such nonsense.  I firmly believe there's nothing bad with VB, just that the majority of people who use it really have no business being programmers in any language.  I wasn't actually saying that VB sucks (hell, I know it myself and taught myself to program using it, although I now prefer C#).

     Although I think everyone knew that already.
     



  • @belgariontheking said:

    @TheRubyWarlock said:

    Sorry to do this, but someone had to say it:

     The Real WTF is that you appear to be writing code in Visual Basic
     

    Nothing wrong with VB in the hands of an experienced coder.  But once you're an experienced coder, you should move on to a new language.  Personally, I've moved on to Java, but almost any non-VB language will suffice.

    Making no comment on the programming skills of the OP. 

    Hah! Because nobody ever writes WTFs of monumental proportions in Java (i.e. the most bloated, over-engineered, Enterprisey crap ever written). I think that saying "now that I'm [i]experienced[/i] I have moved from VB to Java" is kind like saying "now that I'm a [i]genius[/i] I've graduated from elementary school to junior high" in this context.



  • @unklegwar said:

    There is only one instance of System.DBNull, accesses thru the value property. It's a singleton implementation. Not a wtf. You'll find this in many classes. It takes an extra "special" kind of person to take the time to keep traversing an obvious singleton model though, Did you expect it would suddenly change with the 101st child? Do you repeatedly add 1 and 1 on your calculator waiting for "3" to come up?

    Actually, I was thinking "how many of these expansions can VS handle before breaking" unfortunately the answer seems to be "a lot". The WTF is not that it's a singleton, but the way that VS allows me to keep expanding it.

    Surprised nobody is commenting on the help system breakage though... Any other VS users experienced that problem? 

    Oh and the use of VB is nothing to do with me, I'm just maintaining the thing, I had nothing to do with its conception.
     



  • @asuffield said:

    @belgariontheking said:

    VB is great for teaching how to code.

    I really don't think so. It teaches bad habits and sloppy work. 

     

    It does no such thing.  Bad habits and sloppy work are caused by lack of training and a non-aptitude for programming.  VB *allows* people to program who maybe shouldn't be, but it's not evil.

    The other comment that once you learn how to program, you should move on to another language, is complete BS.  I am an experienced programmer who sometimes uses VB.NET 2005, and I would not benefit one whit from writing the code in C#, just to pick another language at random.  (The IL can be exactly the same between a program written in VB and one written in C#, so I don't like hearing complaints (although not from anyone here) that "VB is slow".)

     

    David Walker



  • @DWalker59 said:

    (The IL can be exactly the same between a program written in VB and one written in C#, so I don't like hearing complaints (although not from anyone here) that "VB is slow".)

    VB and C# are slow. 



  • Did you install the MSDN documentation? Because if you didn't, it's going to look it up on the internet, and since MS is always moving the pages, you won't get to them.

    Also, you could get a few thousands of those DBNull values open and it still wouldn't crash. It's just referencing itself, and Unklegwar already explained it well.

    It can eventually lead to an error if you keep expanding the value again and again because you're getting more and more instances of the class that brings that value to the screen, but its memory footprint is so small that you could lose more than a work day on that, I bet.



  • @asuffield said:

    @DWalker59 said:

    (The IL can be exactly the same between a program written in VB and one written in C#, so I don't like hearing complaints (although not from anyone here) that "VB is slow".)

    VB *and* C# are slow. 

    [flame]But they're still faster than Java.[/flame]





  • And BTW, David, since you asked for it:

    <font size="72">VB IS SLOW</font>



  • It's not the language that is slow, it's the people using it.



  • While VB sucks for several of reasons, it really is the fastest way to knock out certain kinds of simple windows desktop apps, (e.g. wizards).


     



  • @merreborn said:

    While VB sucks for several of reasons, it really is the fastest way to knock out certain kinds of simple windows desktop apps, (e.g. wizards).

    Now that just might be true. It's pathetic, disappointing, and inexcusable - but anybody who has studied the history and current state of language design knows that languages usually are pathetic, disappointing, and inexcusable.

    We still have not managed to create a mainstream language that can beat the performance of FORTRAN-77 for certain types of software. Once you realise that, you stop expecting things not to suck.



  • @JvdL said:

    As Einstein pointed out, speed depends on your frame of reference.

    Conclusive proof that BASIC is faster than C#
    Conclusive proof that C++ is faster than BASIC

    The shootout is not a very good cross-language benchmark. Their conditions and tests aren't particularly well thought out and tend to be biased. It's the sort of thing that would be created by somebody who lives in a world of Ada descendants.

    You can rely on it for comparing highly similar Ada-family languages like C and Fortran, or C++ and Java, but it's pretty much meaningless for a comparison between radically different languages like C and Prolog, and it's not desperately good on the lisp and ML families because the tests don't showcase their relative strengths and weaknesses compared to each other. It also has trouble with the more ancient, arcane languages, because they don't have decent compilers on the test platform - you would see radically different results if you were using research supercomputer or enterprise mainframe hardware.

    Nobody has been able to come up with a good benchmark for unrelated languages, because it isn't something that you can put a hard number on. Certain pairs (like C and Java) can be shown analytically to be superior in speed for all possible workloads, but for most pairs of languages it depends heavily on the type of hardware and type of problem.

    We can be pretty sure that assembly, C, and Fortran are way ahead of the pack (and C++-pretending-to-be-C, obviously) because they permit more or less any sequence of machine code to be generated and all of the others are more limited, but the rest of the relationships are too complicated to give a simple ordering.

    For example, Prolog beats almost everything else hands-down on certain specialised workloads, and is completely useless for any other purposes.


    Conclusive proof that C# is faster than C++ 

    I think this is just conclusive proof that Visual C++ is a crappy compiler. That really isn't surprising.



  • All you got to do... is restart your computer... If that does not help then its simple, just re-install windows. YAY!



  • @JvdL said:

    Joke@asuffield said:
    Whine
    WTF



  • @dlikhten said:

    All you got to do... is restart your computer... If that does not help then its simple, just re-install windows. YAY!

    Having trouble with this last one because I bought a 300 GB hard drive.  Apparently my Windows installation wasn't set up to address hard drives larger than 127 GB, so I had to install a program that would allow it to.  I'm afraid to reformat the small hard drive (the one on which Windows is installed) because I'm afraid the new installation of Windows would have to reformat the 300 GB hard drive again, and we can't have that.

    Anyone ever come up against this?

    Also,  @JvdL said:


    JvdL:
    Joke
    asuffield:
    Whine

    WTF

    I'm pretty sure asuffield just likes hearing his own voice, or in this case, seeing his own words on the interwebs.

    Also, I was wondering when someone was going to make the "Java is slow" comment.  Whoever made that comment is absolutely right.  I love Java.  It's easy to code, and translates from one platform to another with ease, but damn it's slow!
     

     



  • @belgariontheking said:

    Also, I was wondering when someone was going to make the "Java is slow" comment.  Whoever made that comment is absolutely right.  I love Java.  It's easy to code, and translates from one platform to another with ease, but damn it's slow!

    Then you must be doing something wrong. It hasn't been slow for me since Java 1.3 came out. And I typically run on four-year-old hardware.



  • @belgariontheking said:

    @dlikhten said:

    All you got to do... is restart your computer... If that does not help then its simple, just re-install windows. YAY!

    Having trouble with this last one because I bought a 300 GB hard drive.  Apparently my Windows installation wasn't set up to address hard drives larger than 127 GB, so I had to install a program that would allow it to.  I'm afraid to reformat the small hard drive (the one on which Windows is installed) because I'm afraid the new installation of Windows would have to reformat the 300 GB hard drive again, and we can't have that.

    What version of Windows are you using? Also, if you're going to install Windows on a drive, even if it's a partition of a disk, you don't have to format the rest.



  • @unklegwar said:

    There is only one instance of System.DBNull, accesses thru the value property. It's a singleton implementation. Not a wtf. You'll find this in many classes. It takes an extra "special" kind of person to take the time to keep traversing an obvious singleton model though, Did you expect it would suddenly change with the 101st child? Do you repeatedly add 1 and 1 on your calculator waiting for "3" to come up?

    The Value property is static ("shared" in VB). The Real WTF is that the IntelliTips (or whatever the name) show static/shared members, especially those of the type of the class they're in. I already noticed that, having worked myself in Visual Basic 2005 (which I pretty much abandoned - I'm a real programmer now!).



  • It usually is the case that source interpretted is slower than byte code is slower than native code. It isn't that difficult to get c++ code to be interpretted, and having vb code compiled (literally).


    The only difference would be the use of type constraints and behaviour constraints that tend to be facilitated in runtime be languages like VB and at compile time by languages like C.

    The only real difference then is a languages ability to more precisely describe an action so that irrelevant checks can be optimized out of the running code.



  • Hmm... What happens if you hit * to expand the tree on a singleton expression..?

     



  • @FraGag said:

    @unklegwar said:

    There is only one instance of System.DBNull, accesses thru the value property. It's a singleton implementation. Not a wtf. You'll find this in many classes. It takes an extra "special" kind of person to take the time to keep traversing an obvious singleton model though, Did you expect it would suddenly change with the 101st child? Do you repeatedly add 1 and 1 on your calculator waiting for "3" to come up?

    The Value property is static ("shared" in VB). The Real WTF is that the IntelliTips (or whatever the name) show static/shared members, especially those of the type of the class they're in. I already noticed that, having worked myself in Visual Basic 2005 (which I pretty much abandoned - I'm a real programmer now!).

    IntelliSense. And it's used for code completion, not for debugging.

    Also, the debugger doesn't display static members unless you hover the mouse over a type. Using it on an object will only display instance members.



  • VB is sometimes fine. A year or two ago I had to code a DLL for something to be called from SQL (2000). I use C#, Java, VB & Coldfusion (and SQL, obviously).

    I don't know C++ so I used VB6. The DLL works fine, is an integral part of our website now and I've never had any issues with it, performance or otherwise. Would it be faster in C++? Maybe. But it's fast enough.

    VB has its uses, and used properly (well, as properly as you can) it's fine for many (but not all) uses.
     



  • [quote user="Renan "C#" Sousa"]

    Also, the debugger doesn't display static members unless you hover the mouse over a type. Using it on an object will only display instance members.

    [/quote]Yes, in VC#, hovering over an instance displays a category "Static members" (along with "Non-public members") which can be expanded to show the type's static members.
    VB, however, just lumps the static members with the instance members.



  • @benryves said:

    [quote user="Renan "C#" Sousa"]

    Also, the debugger doesn't display static members unless you hover the mouse over a type. Using it on an object will only display instance members.

    Yes, in VC#, hovering over an instance displays a category "Static members" (along with "Non-public members") which can be expanded to show the type's static members.
    VB, however, just lumps the static members with the instance members.

    [/quote]

    Okay, I checked, and you're right. Major WTF for the VB one; as for the static members in C#, I wasn't sure about it and had checked a few types of mine with members I decorated with attributes for not showing in the debugger. Looking at other types, I saw the Static Members node as in the pic. Living and learning, I suppose. Thank you for that.


Log in to reply
 

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