- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
This also brings up a similar ambiguity in C#. Having both class indexers and arrays of classes is equally ambiguous. I don't see any of the C# guys clamoring to get indexers removed from C#.
Admin
Admin
Admin
No, it's NOT fair to say that VB has WAAY more than most. I've been at this for 35 years. I've seen bad code in a number of languages from C, to VB, to FORTRAN to Assembly (need I go on?).
OTOH, I can write clean, efficient well-designed code in ANY of the languages I use. I have a 100,000 line Rules Engine that was originally in C, then had to be converted to VB6 so it could be a COM component then into VB.Net. There are bad legacy sections in there and good code that I've more recently added as I became more proficient in OO design techniques.
I really have to laugh when everybody gets into these "my daddy can beat your daddy" kinds of discussions. It really brings out the "High School" in the community. Both VB.Net and C# are competent development tools. Yes, I now prefer C# for anything new I develop but 10+ years working with VB has not hurt my ability to craft good code, nor does VB help a bad coder to craft good code.
Heh ... keep arguing guys - it really makes a difference!
-Max
Admin
Admin
Admin
The first step to recovery is admitting you have a problem.
Admin
I will grant you that, most of the time, I find that
is what I want (rather than, say, ), but I strongly disagree that it's a good thing for a language to treat them as equal, because they're not. Conceptually, they're entirely different things, even if they often have a similar (or identical) meaning in a given context. I think it's far, far better to make your requirements explicit (i.e., this string can either be null or empty for this code path to run) than to say "Well, if the string is a null-ish kind of value then this code path will execute."Admin
TRWTF is that VB.NET uses the same operator for equality tests and for assignment.
Admin
Admin
Admin
As usual, TDWTF comments contain more than enough WTF'ery to make up for the actual article. Keep 'em comin', folks!
Admin
Admin
x = 1234567 << 4
It means exactly the same thing in VB as it does in C#. Please explain how this is "prohibitively difficult".
Admin
Carry on.
Admin
If you originally misspoke, that's fine (we all do from time to time), but Jaime's response was hardly a straw man.
Admin
Admin
Admin
Admin
Admin
Admin
Admin
Admin
I actually don't know whether wint's correction is valid or not; I generally stay away from VB myself. Still funny though.
Admin
Admin
I find that whenever I am handling data going to or coming from a database, I always need a different pattern for a string than I do for any other data type. For example, I can represent a nullable integer with int? (or Nullable(Of Integer) in VB), but when it comes to strings, I'm forced to null check the reference instead of using the HasValue property that works on everything else. All of my other nullables throw compiler errors when I accidentally forget to check for null, but strings wait until run time to throw an exception. Note: I just tried it in C# and I am very disappointed to report that C# does not throw a compiler error if you compare a nullable type without null guarding. However, it doesn't error. C# does behave more sanely than VB when using a nullable in an expression.
Admin
Admin
Is that a joke? Finding really terrible C# code is a trivial exercise.
With the CLR underneath, this entire debate becomes like Dr. Seuss's tale of the Zooks and the Yooks, at war with each other over which side of the bread to butter. I code in whatever the shop I'm working at uses.
C# is easier to use for some things, like event hookups. But only marginally so. I also like how it has a default access modifier. And I also like how buttering the bottom part of the bread prevents butter from dripping on my hand on a hot day.
Addendum (2010-10-18 17:48): For examples of bad C# code, just randomly trawl codeproject or something.
Admin
Admin
x = 1234567 Xor 42 x = 1234567 And 42 x = 1234567 Or 42
These are all bitwise operations. In these cases, the standard operator isn't used in VB, but VB certainly does have an operator for them, and it is far from "prohibitively difficult".
Admin
As for "turning the tables", I jokingly meant I was switching sides of the argument.
Admin
Ahh good old "Visual Beginners All-Purpose Symbolic Instruction Code"
Its been awhile since i've held you tight in my bed... but i've found something new, nipple braces! and i just love nipples.
So i'll always remember you VB but farewell.
Admin
And this is a problem because ????
Admin
Hell, as you were.
Admin
...this time.
Admin
What's wrong with variable variables?
Admin
I think I just found my new auto-sig!
Admin
If you write software long enough, you learn that a regular paycheck is more important than any language argument. If I get paid, I will write your applications in VB, C#, or BrainFck, and produce a decent, usable product. Before anybody gets too upset over this kind of attitude, remember what they say in the graveyard:
Admin
Admin
Seriously though, arguments over which language is the best are pretty irrelevant, as you say. Certain languages are better suited for certain tasks than others. Personally, I like the idea of letting a project's design constraints drive the decision of which language to use, with personal preferences weighing in last. It's a shame it rarely works that way.
Admin
I don't get all the VB bashing. I generally program in C or C++, but I know Basic, Pascal, Fortran, VB, perl, python, etc. When I'm making a quick app for myself or for a specific task, and it needs a GUI, writing it in VB is infinitely quicker than trying to remember or look up how to do all the GUI crap in C. It really is just an issue of whether the programmer is good or not. The example here isn't really "bad" as far as the language is concerned, it's only bad because the thing being done isn't really a property, and so it should be a method instead. That's just a misuse of the language and not a failure of the language itself.
Admin
Admin
STDP (wish there was an "edit post" feature here...)
That's what C# is for.Admin
Admin
Admin
I started writing software in 1966. I booted PDP-8s by toggling in the bootloader from front panel switches. I programmed a PDP-11 using an ASR-33, paper tape and TECO. I programmed FORTRAN using punched cards and green-bar paper on IBM, Univac, and CDC mainframes.
Back in 1983, I told everybody that if they knew COBOL and CICS, then they were set for life. Wrong...
Admin
Well, I've been using various versions of VB for ten years, and I've met a lot of professionals that use it. I also have to point out that, except for syntax and a few minor differences, VB.Net and C#.Net are identical. Also, some would argue that C# is a faster, more sane ripoff of Java.
Also, I would like to say that VB is not the only language I use. I also use C++, NASM, occationally C#, and if I feel treating myself to some pain, Java.
Visual Basic - The Rodney Dangerfield of programming languages.
Admin
Look, let's face it: .NET was MS's attempt to force every language to look and work more like C. That's why VB.NET source code always looks so 'verbose' compared to VB6, because you're forced to use this alien stuff like Includes, and lots of .To<sometype> statements to convert values into a different type, even if all you're doing is building a string for a message box.
So, you've already got your wish: with .NET, MS forced every language to jump through hoops and start looking nothing like itself, all to force every language to work as much as possible like your beloved C … so stop moaning about it, already!
Admin
I would indeed argue that Obj.DemoTimeOut = 60000 and X = Obj.DemoTimeOut is more elegant then "moderns" laguage construct where you use an ugly Obj.setDemoTimeOut(60000) or X = Obj.getDemoTimeOut()
Admin
What were you using that you didn't have breakpoints? One single breakpoint on the first line of the body of the "loop" would have located the problem.
Anyhow, VB.NET is not bad, but VB6 really is TRWTF. My favorite is array and collection indexing -- certain ones always index 0...N-1. Some always index 1...N. Some index either 0...N-1 or 1...N depending on the settings. And some allow the user to specify ANY starting index.