10 Reasons Why Visual Basic is Better Than C#
-
True, but it's my most used feature of my most used IDE. And this feature works for VB, but doesn't (or at least not good enough to my taste) for C# :)
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}Naerling wrote:
And this feature works for VB, but doesn't (or at least not good enough to my taste) for C# :)
I have exactly the opposite opinion.
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson "Our heads are round so our thoughts can change direction." ― Francis Picabia
-
I do love the fact that a bunch of developers including myself read this article and took it seriously, but upon reading it again I noticed this at the top of the article. Andy ‘Wise Owl’ Brown decided to write a tongue-in-cheek rant whilst he could still remember the pain-points.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
I'm glad someone noticed. :thumbsup: The reaction from most people in the forum is actually quite worrying
Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
-
I sincerely hope checked and the article is satire. If it isn't, the guy's I wrote the following because I'm an idiot: 1. Writing software well is a matter of attention to details. If you can't be arsed to even get the name of something right, you're probably going to screw up more important things. 2. If you're going to criticize a language, at least get your examples right. His C# code doesn't duplicate the logic in his VB. 3. Learn how your IDE works, moron. I can assign events in my C# code any time I like, and I'm using VS2008. 4. These are operators, which I would expect to be concise. Can you imagine writing this:
proportion = openquantity openquantity a addto b addto c addto d closequantity dividedby e closequantity multipliedby 100
instead of
proportion = ((a + b + c + d) / e) * 100
Secondly, programming is symbol manipulation. As in my response to #1, if you can't get this right, there are a whole bunch of other things you won't get right. 5. Sigh. Snippets in the IDE. The guy's like a carpenter who has to be told how to use a hammer every morning. 6. They's in the bloody CLR library. In 30 years of programming, not once have I needed to use the mortgage payment function. As far as 'is number' goes, I do localized applications. The library functions for validating localized numbers are usually inept. The .NET versions are actually pretty good, from what I've seen. They seem to work well for common number formats found in the U.S., Europe, and Asia. 7. VB's line continuation character is as annoying as Pascal's use of the semicolon as a statement separator. It's a special case you have to remember all of the time. At least with the C-style languages, you just put the semicolon at the end of every statement. Period. 8. To-may-toe, To-mah-toe. 9. VB encourages you to be sloppy. Once again, point #1. 10. C# gives you a whole lot more control over data structure transformations. With a language that encourages sloppiness, I wouldn't expect it to handle this kind of thing in a fashion that performed well.
Software Zen:
delete this;
Gary Wheeler wrote:
I sincerely hope checked and the article is satire. If it isn't, the guy's I wrote the following because I'm an idiot:
That just earned you a five.:thumbsup: But it means that you're in a minority in this forum. :sigh:
Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions
-
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.
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.
-
>> VB syntax smells horribly Amen to that! Since my last job, maintaining a legacy VB6 app, and a very sloppy one at that, I've not even touched a line of VB code, .NET or otherwise, and I'm a happier camper for it. That was almost 3-years ago and I've never looked back.
-
Anything is more useful than the (type)object of C# beyond the most basic typecasting. Delphi's type(object) and VB's CType(object,type) leaves us something that can be followed by a dot at least.
You can use the as operator:
object a = "test";
(a as string).Trim(); -
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:
However, the snobbery that real C# enthusiasts exhibit toward VB.NET programmers is also misplaced in my opinion.
I agree, various dialects of BASIC, including VB, paid my bills for several decades. That said, I've viewed VB.NET as an abortion, bringing the worse attributes of VB across the divide and few or the advantages. You are talking to the same objects, just with different control structures. I found C# a bit more concise,
int i=0;
vs.
Dim i as Integer = 0
I remember when Dim meant Dimension Array, not Define Variable Type (and maybe declare it an array) that MS gerrymandered into the language. I do miss For...Next, you immediately knew what the control variable was, where it starts, ends, and increments. I hate C's
for(maybe I'll declare a control variable;something that equates to true or false;maybe I'll increment the correct variable)
I've dealt with too many coders who thought that since they code something too clever for words (and many times themselves) who have not followed the convention because the compiler did not force them to. I made the decision that my team's development language would be C#.NET instead of VB.NET, and I HATE C, but C#.NET was OK.
Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.
-
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
-
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.
-
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.