10 Reasons Why Visual Basic is Better Than C#
-
Here[^] Now, where was that bulletproof vest? <Takes cover under a fireproof blanket> A bulletproof vest can take at least one 45ACP, right?
Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
I write in both VB.NET and C#. When I want to do something fast, I usually pick VB because some of the features (like the Select Case statement vs. the Switch statement) allow a lot of logic to be written quickly. When I need to engineer something carefully, especially what I call "graduate-school algorithms", I usually choose C# because I still think in C. As to which is a "better" language, well, I leave that to the rest of you nutbags my fellow developers with stronger opinions ;)
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
For 2. he says that "It’s easy to forget to type in each of these Break statements!" conveniently ignoring that C# Compiler gives you an error saying that Control cannot fall through from one case label to another...
A year spent in artificial intelligence is enough to make one believe in God
Then why do you have to type them in at all?
-
case-sensitivity alone is sufficient reason to ditch C#!
If he meant it seriously, then he's a complete moron.
Mladen Jankovic wrote:
If he meant it seriously, then he's a complete moron.
Really? I'm no moron, but I understand the irritation he feels. If you're doing fast prototyping and rapid incremental maintenance without good Intellisense support, case sensitivity is another distraction. Now, don't get on your high horse, because I did cut my professional teeth on C, the K&R kind that gave no quarter, and I was quite accustomed to taking great care with the use of case. I don't know that this offered me any advantages. I don't know that you were challenging his dislike of case sensitivity, or just the importance he placed on it, so I thought I'd ask: Is case sensitivity in the language itself a valuable feature? If so, why?
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
VB has both is and output parameters...
Why can't I be applicable like John? - Me, April 2011
-----
Beidh ceol, caint agus craic againn - Seán Bán Breathnach
-----
Da mihi sis crustum Etruscum cum omnibus in eo!
-----
Just because a thing is new don’t mean that it’s better - Will Rogers, September 4, 1932I think it has ref parameters, but not out parameters. Or, it doesn't differentiate between them the way C# does. In C#, a ref parameter must be initialized before being passed to the method, and an out parameter need not be initialized, and the out parameter must be assigned a value in the method. I don't think VB.net has a way to indicate that a parameter must be assigned a value in the method.
-
I've worked extensively with both. I prefer C# because of my years working with brace-based languages. However, the snobbery that real C# enthusiasts exhibit toward VB.NET programmers is also misplaced in my opinion.
_beauw_ wrote:
I've worked extensively with both. I prefer C# because of my years working with brace-based languages. However, the snobbery that real C# enthusiasts exhibit toward VB.NET programmers is also misplaced in my opinion.
I've worked extensively with both, as well, and I went through the language wars when it was (just about) everything against C - and I was the C fanatic. At that time, most other language systems did not offer the capabilities of doing as much as C could. Even so, the level of pure vitriol one encountered then (and now, with far less concrete justification for a real advantage between systems) continues to amaze me.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
See here. I think you are correct that VB.net doesn't quite have out parameters (though it has ref parameters). Conversely, in C# you can't pass an instance by ref as you can in VB.net.
-
What really matters is getting paid. If I get paid the same amount per hour either way to use C# or VB, then I'll keep my preferences (C#) to myself and give the client his money's worth.
When posting here, I do not represent anybody but myself.
Had a recent job in which you had to code in VB6 when you know VB.net and C# exist? I did. Getting paid is not all that matters. :)
-
Let's take his argument apart: 1) Case sensitivity: Even at a basic level, A != a, otherwise they would have the same shape, and be called "just" a. OK, that isn't exactly what he is on about, but he does make the point that a word is a word no matter how it is capitalised. I wonder whether he'd prefer some RAM in his port, or some ram in his port. Allowing the user to use foo Foo fOo is just going to help make the code less readable. This is by far his weakest argument. 2)The Swicth clause. Syntactic Garbage. Not only are they best avoided, this feature in VB encourages them. The real syntactic badness comes when you consider (in his example) 17 matches all the case statements, but only evaluates the first. This is the real reason why is not implemented in c based langages. 3) Event Handling On the surface this is pretty neat. Now get the same method to handle two button clicks. Unless my VB knowledge is lacking (and it could be) not so neat now, having to use the
AddHandler
stuff. He is right about the re-naming: this is a PITA. 4)Stupid Symbols Which column looks like it was designed by a real person someone who knows something? FTFH! C# was written by academics. Aha! "In the real world arguments" are a near automatic fail in my book, I'm rarely convinced by them, it is also interesting to note academics are not real people. Perhaps they are dolphins, or imaginary. To flip this on its head, VB has the problem that, an and in an English sentence is often used to mean or and vice versa (if the temperature is 0K, 273K and 373K then it is a special temperature ). The symbols are unambiguous. He also leaves out the less "real person" operators such as AndAlso, the threatening OrElse and of course the very friendly XOR. Take this code:Dim x As Integer
x = 3 And 53 and 5? If a "real person" were to answer this 8. But it is now a bitwise op: so 1. WAT. Again the symbols disambiguate, and developers should be able to cope with the more mathematical symbols rather than baby language. 4 Autocorrection Technically this isn't a language thing. He fails here because c# has a snippet: type
prop
then hit tab and scaffold your property away. Much quicker than the V equivalent when you are used to it. 6 Lack of supported functions I already know if my value is numeric. If it isn't I will cast it. Do I really need a Mortgage calculation built in to my language? No, if I need it I will include VisuaYou're argument for #8 doesn't make much sense. The equivalent VB code looks very similar, so what is the confusion?
Dim a As Decimal = 1 Dim b As Decimal = 3 Dim c As Double = 1.0 Dim d As Double = 3.0 Console.WriteLine(CDbl(a / b) = c / d)
-
Here[^] Now, where was that bulletproof vest? <Takes cover under a fireproof blanket> A bulletproof vest can take at least one 45ACP, right?
Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
-
Had a recent job in which you had to code in VB6 when you know VB.net and C# exist? I did. Getting paid is not all that matters. :)
I held a job like that from 2003 until 2009. Never, ever work for family.
When posting here, I do not represent anybody but myself.
-
Actually, they aren't the same. VB.net was created with backwards compatibility with VB 6.0, with in mind, some ugly things happens (some of these VB programmers like), like the automatic type conversion, the rounding of integers, the internal VB functions, and the list goes long. The first version of .net, come in times when the Java are becoming popular between desktops and Delphi are going to be the most used language to desktop programming. Microsoft created "a plus" for the VB 6 programmers and introduced its brand new language, the C#. As a experienced VB.net and C# programmer (and ok, Delphi too), I rather say that VB is one of the worst languages I know. His apparently easy syntax do any people think they can develop, and almost all programmers that use VB.net as his primary languages aren't good programmers at all. This is my opinions, you can start offending my mother now. :D
sergio_ykz wrote:
As a experienced VB.net and C# programmer (and ok, Delphi too), I rather say that VB is one of the worst languages I know. His apparently easy syntax do any people think they can develop, and almost all programmers that use VB.net as his primary languages aren't good programmers at all.
Back in the 90s when my primary customer (and former boss) wanted to start a new project managing employee benefit selections, he asked me for my recommendations as to how it should be developed - and he strongly expected I would say "do it in C." I surprised him: I told him to do it in Access, because he needed a database to do it and Access was moving along with the rest of Office toward a "standard" VB, which gave him a pool of literally thousands of cheaper programmers whose contributions were less likely to require someone with a MSCS to understand (or, fot that matter, even a BSCS). In short, I said, "VB programmers are cheap and easily disposable." You have to have a language or set of languages that don't require math-enabled nerds and geeks to understand - Grace Hopper understood this when she lead the development of COBOL. There's billions of bytes of code that didn't need geniuses to write it, and the people who wrote that code didn't write it in languages that they had to struggle to understand. As to VB programmers being bad programmers...most of the stinking-worst code I've ever seen has been in C or C++ because somebody thought he was smart because he was a C/C++ programmer. Basic has been the starting language for an enormous number of people (including me), but most of those people who later became good programmers wound up being forced to learn other languages before they could work with the best or understand the work of the best (at one time, virtually every code example in a magazine was in C). So, a lot of people who started programming in Basic and spent a career programming in Basic did so because they never learned and did not want to learn more. This is why so many Basic programmers suck - it's also why so many RPG programmers suck.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
Matthew Graybosch wrote:
If I get paid the same amount per hour either way to use C# or VB, then I'll keep my preferences (C#) to myself and give the client his money's worth.
What you get paid has nothing to do with the quality of the work, the difficulty involved or anything else. It has everything to do with how good a salesman you are and how dumb the customer is. I had a friend who was able to bill dBase IV programmers at $120 an hour (in 1996) to generate sales analysis reports. At the same time, my friend with a PhD in Computer Science was eking out $50 an hour from iCompany for writing communications code in C. And every quarter, iCompany would produce record profits and promptly cut his rate to $35 so that the next quarter's results would look even better. Do you get $120 an hour for C#? :-D PS. The story is even better. The guy who was doing dBase IV programming sold essentially the same system (with very minor modifications) to 7 different companies in Silicon Valley and so his billing rate was about 7 x $120 ($840) an hour because be billed every company all the development time for the software.
I sure as hell don't ask for $120/hour to do C#. I save that for when my recruiter says she needs a VB6 developer or somebody who knows bugger-all about RPG or COBOL.
When posting here, I do not represent anybody but myself.
-
You can use the as operator:
object a = "test";
(a as string).Trim();That's nice regarding the number of the parentheses but it is a condition around the is operator under the hood - it is slower and emits an useless null on failure.
-
I spent a year doing VB.net in Visual Studio and the Intellisense/autocomplete drove me nuts -- it kept deleting stuff I'd already typed. :mad: It never does that with C#.
Oh that was absolutely maddening! I think you'll find that they finally fixed that in VS 2010.
-
For 2. he says that "It’s easy to forget to type in each of these Break statements!" conveniently ignoring that C# Compiler gives you an error saying that Control cannot fall through from one case label to another...
A year spent in artificial intelligence is enough to make one believe in God
Aamir Butt wrote:
For 2. he says that "It’s easy to forget to type in each of these Break statements!" conveniently ignoring that C# Compiler gives you an error saying that Control cannot fall through from one case label to another...
Yes, and why they implemented C syntax without C's implementation of the switch is an excellent question itself.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
I am currently working on both VB and C# side by side. What makes life hell is habit of adding semi colon or using "enter" for autocomplete in VB and using brackets in C# rather than {}. Other things that I have noticed is that VB either does not have is and as equivalents or I just don't know if there is any. And yes, VB does not have out parameters too I guess.
"The worst code you'll come across is code you wrote last year.", wizardzz[^]
For 'as' try using the TryCast operator in VB. For 'is' you can use the TypeOf operator. Is that what you mean?
-
VB is a bit more forgiving and easier to code in than C, C++ or C#. The High Priests of Coding want to keep the Unwashed Masses away from their profession. There is nothing else to the snobbery of the C group toward the VB group.
LOL all too true. It's like the comments I read saying "Most VB programmers I know suck." If far more beginners or non-professionals are using VB than C#, more of them proportionally are likely to be of lesser skills than a similar proporition of C# programmers who (they claim) knew other languages (like C or Java) before they came to C#. I note that there are far more C# snobs than VB snobs in the postings I've read here and elsewhere, lending weight to your proposition.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
sergio_ykz wrote:
As a experienced VB.net and C# programmer (and ok, Delphi too), I rather say that VB is one of the worst languages I know. His apparently easy syntax do any people think they can develop, and almost all programmers that use VB.net as his primary languages aren't good programmers at all.
Back in the 90s when my primary customer (and former boss) wanted to start a new project managing employee benefit selections, he asked me for my recommendations as to how it should be developed - and he strongly expected I would say "do it in C." I surprised him: I told him to do it in Access, because he needed a database to do it and Access was moving along with the rest of Office toward a "standard" VB, which gave him a pool of literally thousands of cheaper programmers whose contributions were less likely to require someone with a MSCS to understand (or, fot that matter, even a BSCS). In short, I said, "VB programmers are cheap and easily disposable." You have to have a language or set of languages that don't require math-enabled nerds and geeks to understand - Grace Hopper understood this when she lead the development of COBOL. There's billions of bytes of code that didn't need geniuses to write it, and the people who wrote that code didn't write it in languages that they had to struggle to understand. As to VB programmers being bad programmers...most of the stinking-worst code I've ever seen has been in C or C++ because somebody thought he was smart because he was a C/C++ programmer. Basic has been the starting language for an enormous number of people (including me), but most of those people who later became good programmers wound up being forced to learn other languages before they could work with the best or understand the work of the best (at one time, virtually every code example in a magazine was in C). So, a lot of people who started programming in Basic and spent a career programming in Basic did so because they never learned and did not want to learn more. This is why so many Basic programmers suck - it's also why so many RPG programmers suck.
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
I understand your point, but I think that we should define papers. I'm not a good designer, if I need a graphic, maybe I can draw, using some easier softwares than photoshop, but I never will point myself as a professional in this or that Paint.net or Gimp is better than Photoshop. I'm can do really cool videos using Movie Maker, but I can't use Premiere, After Efects or Sony Vegas, again, is movie maker better than these tools only because anyone can use? If a person who doesn't is a developer, can solve some of his problem using a VB program, cool, it is easy, but don't point himself as a professional developer or say that VB is better because is easier. Again, it's just my point of view, and as I said, as a experienced VB.net and C# developer, I can say that, because I needed to make some really poor software run in enterprise enviroments that that software wasn't created to run, and these kind of jobs make me hate VB and the kind of programmers I described. It is very common case with PHP developers, who actually are designer who learned the basic of coding and started selling programs. Again, I also developed a lot of programs in PHP and I know what I'm talking about.
-
I am about to go up in front of a bunch of VB developers and explain why the company standard is C# and why they need to change their language. The primary reasons for the change have NOTHING to do with any of the points made by this author.
Never underestimate the power of human stupidity RAH
What are the primary reasons?
"It's not what you don't know that will hurt you the most, it's what you think you know that isn't so." - Unknown
-
I can write both languages equally. I just hate the snobbery that is displayed by some C# programmers. The differences between the languages is getting slimmer with every version. As I see it C# is much nearer to VB.Net than it is to C. There are many things that were in VB long before they appeared in C#. The article is right, the Visual Studio IDE recompile on the fly and show syntax errors faster in VB than it does in C#. This is not about the language but it can be taken into account when you choose a language. This days I work mainly in C# and I enjoy it. The one thing I miss is the ability to put a property in a ref our out parameter. VB can do that and C# (at least 3.5) can't.
Pascal Ganaye wrote:
There are many things that were in VB long before they appeared in C#.
And vice versa. There's nothing wrong with this either way; it's good that languages take on positive features of other languages.
Pascal Ganaye wrote:
The one thing I miss is the ability to put a property in a ref our out parameter.
VB can do that and C# (at least 3.5) can't.Are you talking about:
public void MyMethod(string text, out int retValue1, ref int retValue2)
{
retValue1 = 10;
retValue2 = 20;
}If you are, this has been in C# since v1.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility