• (cs) in reply to Some guy
    Some guy:
    Spivonious:
    There is nothing you can do in C# that I can't do in VB.

    The real issue isn't that there is nothing you can do in C# that you can't do in VB. The issue is that there is plenty you CAN do in VB that you can't with C#.

    For example:

    Private Function _getFoo as Int Return 1 End Function

    Public Readonly Property Foo as Int Get _getFoo() End Get End Property

    The above would compile, and if you ever accessed Foo, you'd get 0.

    So? It's just doing (only) what you told it to, and it's immediately apparent that you're getting 0 because you didn't explicitly return anything. Implicitly, automatically returning the result of any last instruction is anything but intuitive.

    The beauty of a language that lets you "shoot yourself in the foot" is that it also actually shoots real bullets, making it just as much the shortest path to well-written code and solid functional design as to WTF material. Alternatively, just look at the multiple context-specific design patterns and gymnastic contortions one must undergo in strongly typed languages just to make interface calls mapping to dynamically initialized implementation. In a language like Perl or PHP, there would be no elegant architecture and only a handful of the most simplistic patterns ever used because you would just DO it--no coaxing or sleight of hand required. And yet the foe we are supposedly fighting with restrictions built into languages themselves shows no sign of weakness--bad programmers just learn the same limitation-overcoming contortions to write bad code as we learn to write good code.

    Speaking more generally, yes, a poor craftsman blames his tools. But the implication by that statement is that a good craftsman does better with the same tools. In reality, poor craftsmen often actually have bad tools because they cannot afford better with the prices they can charge. Good craftsman have better tools and their output benefits from that as well as from skill. What's more, both craftsman will limit their own quality of work to find a practical balance between quality and productivity, which means the "bad" craftsman may very well be most limited by his tools. You may be able to produce anything with an auger and a hand saw, but just try making an equitable profit building cabinets that way.

    In programming there is no equivalent situation except that programmers in junior or otherwise subjugated positions often cannot choose their own tools at all. The only time a programmer should be faulted for blaming his tools (without actually being able to review his output) is when said programmer chose the very tools he blames. After all, even good tools can be a bad fit, and only people doing the actual work are truly qualified to recognize when this is the case.

  • Uncle Al (unregistered) in reply to Bus Logic
    Bus Logic:
    Chris Haas:
    I'm a long time VB dev and I have never been confused over properties vs methods. I don't want to get into the old war of C# vs VB but except for the unsafe keyword, there's nothing in C# that VB can't do.
    For example, VB.NET supports weak typing (ugh) whereas C# cannot and will not.

    Not necessarily an "ugh" if you, say, want to work with multiple versions of Excel via the Office Automation API, taking advantage of later version features when available. (More about late binding than weak typing, but they're tightly-coupled features). I wouldn't want to write an entire application in VB.NET, but it can be useful for writing libraries that you can compile into a C# application through the magic of CLR interoperability.

    VB.NET certainly isn't the only language to support weak typing (LISP, anyone? Python?). I personally think the benefits of strong typing generally outweigh the benefits of weak typing -- but only generally, not 100% of the time. So, while there are plenty of reasons to criticize VB.NET, I'd say this isn't one of them.

  • (cs)

    I'm spamming because I have tried several times to post a proper answer and your stupid spam bot keeps rejecting it no matter what I do, without telling me WHY it thinks it's spam..

    Funny if doesn't detect real spam.

    So SPAM off.

  • SeeSharp (unregistered) in reply to Some guy

    That's a pretty lame example. What's the special awesome functionality here? Why isn't there a return statement in the property?

  • (cs) in reply to Bremer

    [quote user="Bremer"][quote user="Spivonious"] [...] and if you ask me, verbosity is much easier to read then stupid nipple brackets.[/quote] Now I don't use VB, but I do use PL/SQL, which has a verbose syntax that has been devised and implemented with the amount of thought that you would expect from Oracle.

    Quite frankly, I prefer the relatively sparse syntax that Java offers me. But it's a personal preference, of course.

  • (cs)

    Using () as an alternative to [] is something you can do in C++ too and has the advantage of allowing multiple parameters, thus you can write something like this

    Matrix<double> m(3, 3);
    m(1,2) = 0.5;
    

    see C++ FAQ

  • Cbuttias Lover (unregistered) in reply to Cbuttius
    Cbuttius:
    I'm spamming because I have tried several times to post a proper answer and your stupid spam bot keeps rejecting it no matter what I do, without telling me WHY it thinks it's spam..

    Funny if doesn't detect real spam.

    So SPAM off.

    Try pasting the entire article. See if Askimet likes that.
  • (cs)

    Now this is the WTF here:

    I was able to post what I originally wanted by first posting something, then editing my post to what I really wanted.

    Which is the above post about Matrix and overloading the brackets.

  • (cs) in reply to Sam Sneed
    Sam Sneed:
    How about plain old BASIC? ...like the one I used to use on the TTY?

    100 PRINT "HELLO WORLD" 200 GOTO 100

    I think this example will give them a more personal experience of the pain:

    100 LET I = 0 200 GO TO 700 300 IF I <> 51 GO TO 500 400 GO TO 900 500 PRINT "HELLO WORLD" 600 GO TO 200 700 LET I = I + 1 800 GO TO 300 900 END

    (Also known as the, "Validate this!" WTF.)

    (The astute reader might think the goto at 600 should jump directly to 700, or even be omitted entirely. The astute reader would be wrong: Obviously 200 is the top of the loop; and the increment must follow the loop; and the test must be before the loop. We must be structured! And, yes, I have seen code that bad.)

  • (cs) in reply to Larry David Jr
    Larry David Jr:
    Here's a challenge for you all then. Give a piece of code which is 'better' in C# than in VB (.NET).

    Go.

    I think you should curb your enthusiasm for VB.

  • (cs) in reply to Mojo
    Mojo:
    And of course, the average quality of developers for the language. For every good VB dev, there's a hell of a lot of bad ones. Why aren't there so many bad devs for C#? Nothing particularly unique to C#, rather that VB is a beginner lanugage - most of the bad devs in the world barely learnt VB, and will never learn C#.

    All I can say is... you've obviously never worked in software development in any capacity... or you're a troll.

    Not saying there aren't a lot of crap VB devs out there, but there's certainly just as many crap C# devs. If you don't see them, you must not have worked in the field. Or, I suppose you could BE one of them.

    I have to agree with this. I'm not defending VB (I personally don't like it), but it's annoying when people claim a particular language is "bad" because there are so many "crap devs" that use it, and swoon over another language because there aren't as many "crap devs" that use it.

    Crappy developers are everywhere, with VB or without. They use every language, every database, every OS, and work in every type of business of every size. This site only publishes stories about a tiny percentage of these developers.

    If you want to bash on VB, I'm all for it, but let's not try to compare languages by comparing how many "crap devs" we think use them.

  • wtf (unregistered) in reply to Severity One
    Severity One:
    ... tomorrow is my 41st birthday ...

    Happy birthday, by the way.

  • Buck Dharma (unregistered) in reply to Mojo

    I think the truth of the matter is that for those of us who have been around since early VB days, we liked the language until about VB6. That is because VB6 purported to be an oop language without actually being oop. There were "Classes" and (especially the WebClass) that seemed like VB was just being screwed with. Prior to VB6, at least for me, all VB apps were data-centric. After VB6, people starting looking to them to do more advanced stuff. Then you got this influx of horrible "coders" who had just designed their umpteenth webpage using Frontpage and ASP. They figured that with the bottom falling out of the DotCom boom, they'd better market themselves out of that sphere. So they started writing in VB6 and making those of us who have spent hours worrying about allocation/deallocation of memory, pointer math, and all that C/C++ stuff frustrated when we inevitably had to fix some horrible bug in that horrible code. So we harbor these bad feelings. I'll admit, that even today, if I have to touch VB.net code or someone says "I code in VB.Net", vile thoughts come immediately to mind. There are horrible coders working in all languages, let's jut hate THEM and not the language...does that work for everyone?

  • (cs) in reply to Bus Logic
    Bus Logic:
    This bizarre ambiguity between properties and functions is just one item on a very long list of inherent issues with VB.NET. I honestly have no idea why anyone would choose it over C# when targeting the .NET framework, unless they're just so bad at writing code that they can't make the switch from Microsoft's kiddie code to a real language.

    But properties and methods are the same thing in .Net, really. Properties are just syntatical sugar for getters and setters that can be abused to cause side effects and block indefinitely. The same is true for indexers. I'm not sure why you think C# is any better, because the underlying mechanism is the same. Disclaimer: I don't even like VB.Net.

  • JB (unregistered)

    TRWTF isn't VB, it's the coder. I haven't read very many of the comments on this one, but this is a classic example of when NOT to use a property. The fact that you can do this with a property has nothing to do with the language since VB, C#, etc can do this and makes many things much more simple (I'd rather use VB and C#'s properties than the stupid Get/Set functions that are forced upon us in Java, PHP, c/c++, etc).

  • anonym (unregistered)

    Private Function _getFoo as Int Return 1 End Function

    Public Readonly Property Foo as Int Get return _getFoo() End Get End Property

    fixed it for you

    now return 1

  • Pyroka (unregistered) in reply to HonoredMule
    HonoredMule:
    Some guy:
    Spivonious:
    There is nothing you can do in C# that I can't do in VB.

    The real issue isn't that there is nothing you can do in C# that you can't do in VB. The issue is that there is plenty you CAN do in VB that you can't with C#.

    For example:

    Private Function _getFoo as Int Return 1 End Function

    Public Readonly Property Foo as Int Get _getFoo() End Get End Property

    The above would compile, and if you ever accessed Foo, you'd get 0.

    So? It's just doing (only) what you told it to, and it's immediately apparent that you're getting 0 because you didn't explicitly return anything. Implicitly, automatically returning the result of any last instruction is anything but intuitive.

    The beauty of a language that lets you "shoot yourself in the foot" is that it also actually shoots real bullets, making it just as much the shortest path to well-written code and solid functional design as to WTF material. Alternatively, just look at the multiple context-specific design patterns and gymnastic contortions one must undergo in strongly typed languages just to make interface calls mapping to dynamically initialized implementation. In a language like Perl or PHP, there would be no elegant architecture and only a handful of the most simplistic patterns ever used because you would just DO it--no coaxing or sleight of hand required. And yet the foe we are supposedly fighting with restrictions built into languages themselves shows no sign of weakness--bad programmers just learn the same limitation-overcoming contortions to write bad code as we learn to write good code.

    Speaking more generally, yes, a poor craftsman blames his tools. But the implication by that statement is that a good craftsman does better with the same tools. In reality, poor craftsmen often actually have bad tools because they cannot afford better with the prices they can charge. Good craftsman have better tools and their output benefits from that as well as from skill. What's more, both craftsman will limit their own quality of work to find a practical balance between quality and productivity, which means the "bad" craftsman may very well be most limited by his tools. You may be able to produce anything with an auger and a hand saw, but just try making an equitable profit building cabinets that way.

    In programming there is no equivalent situation except that programmers in junior or otherwise subjugated positions often cannot choose their own tools at all. The only time a programmer should be faulted for blaming his tools (without actually being able to review his output) is when said programmer chose the very tools he blames. After all, even good tools can be a bad fit, and only people doing the actual work are truly qualified to recognize when this is the case.

    TRWTF is that that code compiles. I mean, the Property and Get means it has to return something right? (I'm none too familiar with VB), so the fact that you've not explicitly returned anything should be a syntax error, it should never compile. There is no way any reasonable developer should use the fact that it implicitly returns 0. (I said /reasonable/) So that code will surely be a case of coding sans caffeine and missing a 'return'

  • McGee (unregistered) in reply to Billy The Squid
    Billy The Squid:
    we don't allow developers to write their own SQL

    Oh, cool, you probably have something like activerecord or maybe a good DBA around!

    (instead use our SQL management toolset - generates queries, sanitizes inputs, prevents "something bad" from happening)

    Ooops...

    captcha: ingenium. Speaks for itself.

  • Oh THAT Brian! (unregistered) in reply to Anonymous
    Anonymous:
    English Man:
    Anonymous:
    Awww, "beginner-targeted language" makes it sound so cute! Much better than "ungodly piece of crap" or "used exclusively by school children and bad CS students".

    As for todays WTF, well, that's exactly what you get from an ungodly piece of crap that is used exlusively by school children and bad CS students.

    It's entertaining when ignoramuses talk with such arrogance. Well done.
    It's entertaining when VB coders talk with such clarity, instead of just screeching and flinging feces at each other like normal C# programmers. Well done.
    There - I fixed it for you.

  • (cs) in reply to Larry David Jr
    Larry David Jr:
    Here's a challenge for you all then. Give a piece of code which is 'better' in C# than in VB (.NET).

    Go.

    public boolean IsDemo { get; set; }

    or maybe

    public boolean IsDemo { get; private set; }

    if you wanted to restrict who could set it.

  • JohnFx (unregistered)

    Usability is for end-users, not programmers. Death to VB!

    On a related note: Isn't Ruby often touted for it's simplicity also? I guess Ruby is still too new for its haters club to have as many members.

  • Bus Logic (unregistered) in reply to Uncle Al
    Uncle Al:
    Bus Logic:
    Chris Haas:
    I'm a long time VB dev and I have never been confused over properties vs methods. I don't want to get into the old war of C# vs VB but except for the unsafe keyword, there's nothing in C# that VB can't do.
    For example, VB.NET supports weak typing (ugh) whereas C# cannot and will not.

    Not necessarily an "ugh" if you, say, want to work with multiple versions of Excel via the Office Automation API, taking advantage of later version features when available. (More about late binding than weak typing, but they're tightly-coupled features). I wouldn't want to write an entire application in VB.NET, but it can be useful for writing libraries that you can compile into a C# application through the magic of CLR interoperability.

    You've provided an interesting example of where weak typing can be useful (I work with Office interop a lot myself so I understand what you're saying). However, there are other ways of achieving this that can be done in a type safe manner, even though it would require a bit more code, so this doesn't convince me that allowing weak typing is a sound design decision for a modern programming language. To my mind, the risk of runtime errors far outweighs the benefit of those very few cases where it may actually be legitimate and beneficial to use weak typing.

  • F (unregistered) in reply to Buck Dharma
    Buck Dharma:
    I think the truth of the matter is that for those of us who have been around since early VB days, we liked the language until about VB6. That is because VB6 purported to be an oop language without actually being oop. There were "Classes" and (especially the WebClass) that seemed like VB was just being screwed with. Prior to VB6, at least for me, all VB apps were data-centric. After VB6, people starting looking to them to do more advanced stuff. Then you got this influx of horrible "coders" who had just designed their umpteenth webpage using Frontpage and ASP. They figured that with the bottom falling out of the DotCom boom, they'd better market themselves out of that sphere. So they started writing in VB6 and making those of us who have spent hours worrying about allocation/deallocation of memory, pointer math, and all that C/C++ stuff frustrated when we inevitably had to fix some horrible bug in that horrible code. So we harbor these bad feelings. I'll admit, that even today, if I have to touch VB.net code or someone says "I code in VB.Net", vile thoughts come immediately to mind. There are horrible coders working in all languages, let's jut hate THEM and not the language...does that work for everyone?
    Spoilsport
  • Schoolkids everywhere... (unregistered) in reply to Oh THAT Brian!
    Oh THAT Brian!:
    Anonymous:
    English Man:
    Anonymous:
    Awww, "beginner-targeted language" makes it sound so cute! Much better than "ungodly piece of crap" or "used exclusively by school children and bad CS students".

    As for todays WTF, well, that's exactly what you get from an ungodly piece of crap that is used exlusively by school children and bad CS students.

    It's entertaining when ignoramuses talk with such arrogance. Well done.
    It's entertaining when VB coders talk with such clarity, instead of just screeching and flinging feces at each other like normal. Well done.
    There - I misquoted because I'm a soopa-clevva VB coder!
    See what happens when we have a VB article? All the retards and school kids drop in. Yes, well done Brian, that's very clever. Maybe tomorrow you'll finally crack those shoelaces of yours. Won't it be nice going outside without mummy and daddy's help?

  • A Schoolkid (unregistered) in reply to Schoolkids everywhere...
    Schoolkids everywhere...:
    Oh THAT Brian!:
    Anonymous:
    English Man:
    Anonymous:
    Awww, "beginner-targeted language" makes it sound so cute! Much better than "ungodly piece of crap" or "used exclusively by school children and bad CS students".

    As for todays WTF, well, that's exactly what you get from an ungodly piece of crap that is used exlusively by school children and bad CS students.

    It's entertaining when ignoramuses talk with such arrogance. Well done.
    It's entertaining when VB coders talk with such clarity, instead of just screeching and flinging feces at each other like normal. Well done.
    There - I misquoted because I'm a soopa-clevva VB coder!
    See what happens when we have a VB article? All the retards and school kids drop in. Yes, well done Brian, that's very clever. Maybe tomorrow you'll finally crack those shoelaces of yours. Won't it be nice going outside without mummy and daddy's help?
    Yeah, because it's Columbus Day here. You know, that guy that helped millions get away from Gay Britain.

  • (cs)

    Just because the language allows crap like that doesn't make it a bad language. VB.Net is just as capable as C# in the hands of a "Programmer". I can work in either language, but prefer VB for its readability and productivity enhancements provided by the Visual Studio environment. That example is all about the programmer and not the language.

  • (cs) in reply to Some guy
    Some guy:
    Spivonious:
    There is nothing you can do in C# that I can't do in VB.

    The real issue isn't that there is nothing you can do in C# that you can't do in VB. The issue is that there is plenty you CAN do in VB that you can't with C#.

    For example:

    Private Function _getFoo as Int Return 1 End Function

    Public Readonly Property Foo as Int Get _getFoo() End Get End Property

    The above would compile, and if you ever accessed Foo, you'd get 0.
    Just modify the project to stop ignoring compiler warning 42107. It will gladly tell you that the property doesn't return a value on all code paths. This is more of a WTF with Visual Studio than VB as the compiler chokes on this by default, it's only the default project template in VS that turns it off.
  • (cs) in reply to boog
    boog:
    Markp:
    akatherder:
    A poor craftsman blames his tools.
    So does a good craftsman who has crappy tools.
    What good craftsman willingly uses crappy tools?

    I suppose he may not have a choice, but then wouldn't he still make the best of what he has? He wouldn't need to blame the tools (or anything else) if he succeeds.

    And if there's no chance of succeeding despite his best efforts due to tools/resources/work conditions/etc., I think a good craftsman would see that beforehand and avoid a project he knows would fail. Otherwise, would you really call him a good craftsman, and if so, by what standard are you measuring to derive the term "good"?

    Well that's where the analogy to a craftsman fails since craftsmen are often self-employed people pretty much fully in charge of their situation (and tools). I on the other hand worked for 4 months (co-op term) at a software shop that was supporting software running on versions of Java and 3rd party libraries that were 8-10 years out of support. 20% of the bugs that came in would be fixed by upgrading to newer versions of our dependencies. 5% of the new code we wrote already belonged to the newer standard libraries. Our development environment was centred around Netbeans 3.5 when 6.5 was 10 years newer and free.

    Can you imagine our frustration when every time we tried to invest in new tools and dependencies, management accused us of blaming our poor productivity and quality on our tools?

    Can you understand why we eventually would take a stance of blaming things on our tools?

  • Some Guy (unregistered) in reply to Larry David Jr
    Larry David Jr:
    Here's a challenge for you all then. Give a piece of code which is 'better' in C# than in VB (.NET).

    Go.

    Easy.

    VB:

    Public Function GetJunk() As String
    Dim junk As String = "1"
    If junk = "1" Then
    Return junk
    End If
    End Function

    C#:

    public string GetJunk()
    {
    string junk = "1";
    if(junk == "1") return junk;
    }

    For the string comparison, the VB version calls a bunch of VB string comparison crap kept around for backward compatibility with old VB (6 and earlier). The C# version calls op_Equality() which is a much more efficient method.

    If you don't believe me, compare the MSIL. If you want to make your VB more efficient, rewrite that string comparison to

    If String.op_Equality(junk, "1") Then...

  • Bus Logic (unregistered) in reply to frits
    frits:
    Bus Logic:
    This bizarre ambiguity between properties and functions is just one item on a very long list of inherent issues with VB.NET. I honestly have no idea why anyone would choose it over C# when targeting the .NET framework, unless they're just so bad at writing code that they can't make the switch from Microsoft's kiddie code to a real language.

    But properties and methods are the same thing in .Net, really. Properties are just syntatical sugar for getters and setters that can be abused to cause side effects and block indefinitely. The same is true for indexers. I'm not sure why you think C# is any better, because the underlying mechanism is the same. Disclaimer: I don't even like VB.Net.

    SYNTAX! The underlying mechanism may be the same but the C# syntax is vastly better because it removes the ambiguity. Did I really need to explain that to you? The whole point of today's article is the dodgy syntax, please keep up.
  • A Summary (unregistered) in reply to Alex Papadimoulis
    Alex Papadimoulis:
    TRWTF is VB.

    Now that that's out of the way... let the actual commenting begin...

    Unoriginal Poster 1:
    VB sucks, and you should use C#.
    Unoriginal Poster 2:
    VB is only bad when bad programmers use it.
    Unoriginal Poster 3:
    VB sucks, and C# is better.
    Unoriginal Poster 4:
    VB is useful for a lot of things and just as good as C#.
    Unoriginal Poster 5:
    VB sucks.
    Unoriginal Poster 6:
    VB is ok if you use it right.
    Unoriginal Poster 7:
    VB sucks and can't do what C# can.
    Fascinating development: all posts are simple restating exactly what Alex wrote in the article.
  • A More Skilled Programmer that "Some Guy" (unregistered) in reply to Some Guy
    Some Guy:
    Larry David Jr:
    Here's a challenge for you all then. Give a piece of code which is 'better' in C# than in VB (.NET).

    Go.

    Easy.

    VB:

    Public Function GetJunk() As String
    Dim junk As String = "1"
    If junk = "1" Then
    Return junk
    End If
    End Function

    C#:

    public string GetJunk()
    {
    return ((string junk = "1") == "1");
    }

    FTFY
  • Some Guy (unregistered) in reply to Spivonious
    Spivonious:
    Bus Logic:
    This bizarre ambiguity between properties and functions is just one item on a very long list of inherent issues with VB.NET. I honestly have no idea why anyone would choose it over C# when targeting the .NET framework, unless they're just so bad at writing code that they can't make the switch from Microsoft's kiddie code to a real language.

    Kiddie code? There is nothing you can do in C# that I can't do in VB. It all comes down to whether you prefer the verbosity of VB or the conciseness of C#.

    Ask google about "unsafe vb.net" and you'll see the big one. A VB coder could not have written a fast AVI file writer. I've done it in C#. It requires the ability to pack bytes into uint32's. Packing requires all manner of fun bitwise operations, and VB just isn't cut out for that. Now, you can do it in VB, just not at any useful speed. To get useful speed out of that operation requires unsafe code. And VB can't do it.

  • No WTF Here (unregistered)

    Actually, that's exactly the way you'd want to implement this scenario on an embedded system with no file system.

  • wtf (unregistered) in reply to A More Skilled Programmer that "Some Guy"
    A More Skilled Programmer that "Some Guy":
    C#:
    public string GetJunk()
    {
      return ((string junk = "1") == "1");
    }
    
    FTFY

    Not a C# guy, but in most languages that would return "true", which is not what the VB or the original looked like they were doing. Am I missing something, or is your chosen screen name for this post taking on a bitter irony in your mouth right about now?

  • Mark (unregistered) in reply to A Summary
    A Summary:
    Alex Papadimoulis:
    TRWTF is VB.

    Now that that's out of the way... let the actual commenting begin...

    Unoriginal Poster 1:
    VB sucks, and you should use C#.

    <snipped unoriginal quotes>

    Fascinating development: all posts are simple restating exactly what Alex wrote in the article.

    At least we're repeating what was in the article - you're repeating people repeating what was in the article, so you're the bottom feeder in this equation. How does that ass taste?

  • Some Guy (unregistered) in reply to wtf
    wtf:
    A More Skilled Programmer that "Some Guy":
    C#:
    public string GetJunk()
    {
      return ((string junk = "1") == "1");
    }
    
    FTFY

    Not a C# guy, but in most languages that would return "true", which is not what the VB or the original looked like they were doing. Am I missing something, or is your chosen screen name for this post taking on a bitter irony in your mouth right about now?

    Also, he misspelled "than".

  • Unoriginal Comment (unregistered)

    Whenever a Code SOD featuring Visual Basic is published here, a flood of The Real WTF is VB comments ensues. As mindless and unoriginal of a comment as it is, there's a good reason for the sentiment: Visual Basic is designed for beginners, is often used by beginners, and beginners write an awful amount of awful code.

  • Kang (unregistered)

    "Thou doth protesteth too much"

    That is my response to all those who consistently bash VB.

    Truly good programmers are comfortable and confident in their work without the need to randomly bash an entire language and all developers using that language, just to...what...cover up for some...deficiency?

  • A More Skilled Programmer than "Some Guy" (unregistered) in reply to Some Guy
    Some Guy:
    wtf:
    A More Skilled Programmer than "Some Guy":
    C#:
    public string GetJunk()
    {
      return ((string junk = "1") == "1");
    }
    
    FTFY

    Not a C# guy, but in most languages that would return "true", which is not what the VB or the original looked like they were doing. Am I missing something, or is your chosen screen name for this post taking on a bitter irony in your mouth right about now?

    Also, he misspelled "than".

    Well, at least my code would actually compile, sir.

  • (cs) in reply to Severity One
    Severity One:
    Steve The Cynic:
    Only me. And you, although maybe you went and looked it up.
    Alas... tomorrow is my 41st birthday, and I've been programming since the age of 13 (starting with BASIC on the TRS-80 model I). I also know what COBOL and APL stand for.

    COmmon Business Oriented Language A Programming Language.

    Signs of a mis-spent youth? Maybe.

    And I have 3.5 years on you. I started on a Commodore Pet, with the built-in cassette drive and the ghastly horrible keyboard. From there I progressed (?) to a Sinclair ZX80 (bounce, bounce, bounce).

    ((Editor's note: the only way to understand that last remark is to have used a ZX80, on a TV where the vertical hold control was set just, but only just, on the stable side of completely losing hold.))

    But, hey, my mother started programming on a LEO 3.

    In 1963.

  • Anon (unregistered)

    This is why you want to be able to do this in VB.net :)

    Public Property IsFileNotFound(byval Optional fileNotFoundKey as Integer = 2) As Integer
        Get
            If (mFileIsNotFound is nothing) Then
                Return fileIsNotFound 
            Else
                Return mFileNotFound
            End If
        End Get
        Set(ByVal value As String)
            If (value > mFileNotFound)
                mFileNotFound = value
            Else
                mFileNotFound = fileNotFound
            End If
        End Set
    End Property
    
  • Anon (unregistered)

    This is why you want to be able to do this in VB.net :)

    Public Property IsFileNotFound(byval Optional fileNotFoundKey as Integer = 2) As Integer
        Get
            If (mFileIsNotFound is nothing) Then
                Return fileIsNotFound 
            Else
                Return mFileNotFound
            End If
        End Get
        Set(ByVal value As String)
            If (value > mFileNotFound)
                mFileNotFound = value
            Else
                mFileNotFound = fileNotFound
            End If
        End Set
    End Property
    
  • (cs) in reply to Bus Logic
    Bus Logic:
    frits:
    Bus Logic:
    This bizarre ambiguity between properties and functions is just one item on a very long list of inherent issues with VB.NET. I honestly have no idea why anyone would choose it over C# when targeting the .NET framework, unless they're just so bad at writing code that they can't make the switch from Microsoft's kiddie code to a real language.

    But properties and methods are the same thing in .Net, really. Properties are just syntatical sugar for getters and setters that can be abused to cause side effects and block indefinitely. The same is true for indexers. I'm not sure why you think C# is any better, because the underlying mechanism is the same. Disclaimer: I don't even like VB.Net.

    SYNTAX! The underlying mechanism may be the same but the C# syntax is vastly better because it removes the ambiguity. Did I really need to explain that to you? The whole point of today's article is the dodgy syntax, please keep up.

    Reading is fundamental. When two things are the same, there is no ambiguity.

  • Lego (unregistered) in reply to toth
    toth:
    Whenever I have to write in VB.NET, I feel like I'm trying to compose a cover letter with crayons.

    The product has little to do with the quality of the tools and much to do with the skill of the craftsman.

    See what you can do with crayons?

    http://www.kristinanelson.com/collections/originals-and-prints?page=1

    Akismet is useless.

  • (cs) in reply to Severity One
    Severity One:
    Anonymous:
    Awww, "beginner-targeted language" makes it sound so cute!
    But is is targeted at beginners. Does anyone actually remember that BASIC stands for 'beginners all-purpose symbolic instruction code'?

    Pretty much like Pascal, and like Pascal, in its original incarnation totally unsuitable to write real software.

    The difference, though, is that Pascal has evolved into one of the most powerful, readable and productive languages around, and BASIC has evolved into... well... VB.

  • wtf (unregistered) in reply to A More Skilled Programmer than "Some Guy"
    A More Skilled Programmer than "Some Guy":
    Some Guy:
    wtf:
    A More Skilled Programmer than "Some Guy":
    C#:
    public string GetJunk()
    {
      return ((string junk = "1") == "1");
    }
    
    FTFY

    Not a C# guy, but in most languages that would return "true", which is not what the VB or the original looked like they were doing. Am I missing something, or is your chosen screen name for this post taking on a bitter irony in your mouth right about now?

    Also, he misspelled "than".

    Well, at least my code would actually compile, sir.

    Um, no. Sorry. The code you "corrected" demonstrated a point about C# vs VB. Yours demonstrated your failure to grasp the point. Passing the compiler is sort of irrelevant in this case, don't you think?

  • Anonymous (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    Severity One:
    Steve The Cynic:
    Only me. And you, although maybe you went and looked it up.
    Alas... tomorrow is my 41st birthday, and I've been programming since the age of 13 (starting with BASIC on the TRS-80 model I). I also know what COBOL and APL stand for.

    COmmon Business Oriented Language A Programming Language.

    Signs of a mis-spent youth? Maybe.

    And I have 3.5 years on you. I started on a Commodore Pet, with the built-in cassette drive and the ghastly horrible keyboard. From there I progressed (?) to a Sinclair ZX80 (bounce, bounce, bounce).

    ((Editor's note: the only way to understand that last remark is to have used a ZX80, on a TV where the vertical hold control was set just, but only just, on the stable side of completely losing hold.))

    But, hey, my mother started programming on a LEO 3.

    In 1963.

    Awesome, it's fun to see the programmer's equivalent of dick measuring. I started coding on a Commodore VIC-20 so you guys both beat me, but only just. I remember sneering at the TRS-80 and its measly 4KB of RAM (I had 5KB, whoopee!).
  • Ross (unregistered) in reply to Raw

    Your comment seems to assume that Microsoft, whose VERY FIRST RELEASED PRODUCT was Microsoft BASIC, years before IBM even started to THINK about releasing a PC, actually had a choice in the matter of whether or not to keep releasing versions of BASIC. This assumption is faulty.

    Programmers were fucking ADDICTED to Quickbasic for DOS. (Hell, some people STILL USE IT.) Not releasing VB for Windows would have been cutting their own throat. Someone else would have released BASIC for Windows to capitalize on the market. That would have been embarrassing in the extreme.

  • LANMind (unregistered) in reply to JohnFx
    JohnFx:
    Usability is for end-users, not programmers. Death to VB!

    It's that kind of thinking that creates the WTF found here, you fscking imbicile.

Leave a comment on “Property Basics”

Log In or post as a guest

Replying to comment #:

« Return to Article