I saw on Dan Appleman's blog that a new version of his Visual Basic.NET or C#…Which to Choose? is available, reflecting the latest changes in VS.NET 2005. I immediately bought a copy from Lockergnome, apparently the only vendor that allows instant eBook downloads after purchase.*
There are no dramatic reversals of fortune here. As usual, it's all about the runtime. However, I was disappointed that Dan didn't cover the way his prediction in the original eBook has come true-- as nonsensical as it may seem, C# developers are paid more than VB.Net developers to write the very same .NET framework code. This isn't conjecture. It's a fact. Well, at least we can console ourselves with the many dramatic improvements in VB.NET; the language is legitimately a first class citizen in VS.NET 2005. Microsoft finally rectified all those annoying, boneheaded oversights-- compiler warnings, Using, and XML comments anyone?
I'm also wondering if, despite protests to the contrary..
The focus on languages over the past couple of years has truly astonished me. For example: at technical conferences you still often see separate VB .NET and C# tracks. Publishers would publish one book on a general .NET topic in C#, then a "port" of the book to VB .NET (or vice versa). Bookstores still classify books by language.Don't get me wrong – it's not that the conference organizers and publishers were wrong to do this. They just deliver what they believe the market demands. Or, to put it bluntly, the existence of separate VB .NET and C# content is largely an indication that publishers, bookstores and conference organizers believe their customers are too stupid to realize the fundamental truth – that it's all about the framework. The language does not matter.
If you look at the total knowledge space of developing .NET applications in VB.NET or C#, about 95-99% of the information is identical between the two languages. This is a radical shift from the Visual Studio 6, where C++ programmers had MFC and ATL available -- two massive frameworks that VB6 programmers did not need to learn. At this point, the truth is that I could take the easy way out and simply say that the two languages are so similar that you should just choose whichever one you feel like -- it won't matter. But, this would be a cop-out -- like the kind of contests some schools do for kids where every participant wins a prize in order to build their self-esteem.
.. perhaps the choice of language is more significant than Dan realizes, due to his unusual dual C++ / VB background.
I, on the other hand, grew up with Basic. I don't enjoy parsing through C# code, and any C# code I plan to incorporate into my own projects, I always convert to VB.Net. I don't convert code because I feel morally obligated to; I do it because I feel like I don't really understand the code unless I've touched every line of it. I'm sure many C# developers who grew up with C or Java probably do the same thing. It's not that we can't use both languages interchangably, or understand each other, but the mental overhead of putting on different language hats sure as hell isn't helping us get work done.
In other ways, though, the choice of language really is a red herring. I'm starting to think the effectiveness of your IDE is more important than any language choice you can make. Here are the four items Dan lists as "significant issues" in choice of language:
What do any of these things have to do with the languge? They smell like hardcore, low-level IDE features to me. The real money play is to invest in the IDE, not the languages. A kick-ass IDE will have a huge impact on your productivity compared to the utterly meaningless choice between editing VB.NET or C# in notepad.
* What is up with that? If I wanted to wait, I wouldn't be buying eBooks. Give me instant gratification, or give me death!
A little yoke ...
Someone is replay that C# sounds much powerful instead of "BASIC".
If Vb.net is consider as toy language, because of name,
maybe we can call C# a "baby C" (in comparison with C++ ..)
In that way we can solve that part of problem :)
This whole thread is pretty childish. Both compile both run and run well. It's all a matter of preference. I can't believe I wasted time reading part of this thread.
BT on April 17, 2008 9:03 AMhmmmmmm damn so many comments and people are still stuck on syntactic differences and case sensitivity........
There are not that many differences in C# and VB.NET
But I still prefer C# because I find VB syntax very ugly and unlike all other languages. It is easier to move between C#/Java/C++ than to goto VB
redrum on April 19, 2008 9:13 AMAdmittedly, I'm only a "hobbiest" coder, but I find the 2 very similar to write, look at and debug. After a few months of using both, it was Microsoft's XNA Game Studio that swayed me into using C# predominately, because making XNA Games is good fun :D
Mike on April 26, 2008 8:46 AMOK... C# and VB.NET are the same. They do the same thing. The only difference is syntax. VB.NET uses more words, C# uses more symbols. For every VB.NET expression there is a C# equivilent. My advice is to lern C# first, then migrate to VB.NET, and stay with VB.NET. VB.NET is much easier to read and structure. (My Opinion) C# was created for C++ developers. Microsoft wanted to attract those C++ deveolpers to write .NET programs. C# is a politcally motivated tactic by Microsoft to lure C++ programers on to the .NET platform.
ADX on May 5, 2008 10:21 AMI've been programming in VB for over 10 years, with the past 3 or so in VB.NET. I am seriously thinking to learn C#. Even though VB.NET is a first class language and both C# and VB.NET are basically equivalent, it boils down to this.
Dice.com, Monster, and other boards: Approximately 6 times more C# jobs nationally than VB.NET
Same search locally to me: You guessed it, about 6 times more C# jobs than VB.NET
Being unemployed is not cool and is hurting my career. And if it's true, C# developers making more, than that is just more reason.
By the way, to the guy who put down the VB developers, I have worked with plenty of VB.NET developers (even VB6) that understand OOD. And VB6 developers understood Interfaces and worked with them for a long time. It's not rocket science dude.
I have not programed since the early days (Sinclair QL basic).Remember that !!!
Anyway as far as i can see, looking from an outsiders point of view.The .net framework will program efficiently in both c sharp or VB, and as the speed of current processors from AMD and Intel are both fast and efficient,I would think the programmers main problem coming up is more about Parallel processing programs to take advantage of the quad Core Processors.
As far as i can see this will probably need a new language to get the most out of the processors !!
So....time to junk C,C++,C Sharp,Pascal,VB.net Etc and move on up to the next great language, whatever that will be.
Mike on May 13, 2008 7:24 AMBjorn Sigurd Johansen
MICROSOFT:
2) Please add optional parameters and parameter default values to C#!
Lets talk about this a bit, this has got to be the dumbest thing I have read on this thread. Optional paramters are a freaking nightmare. I am a C#/VB.Net/Java/C++ and yes Delphi developer with 30+ years of experience.
If any VB.Net developer here thinks that optional paramters are a good thing then get out of IT, because you are lazy and should be working at taco bell and having your mommy tuck you in bed at night.
Because you obviously have never written an assembly used by anyone else on your team.
Try this write a dll and put the following in it
public function method1(ByVal a as string) as integer
return method1(a, "I am stupid")
end sub
public function method1(ByVal a as string, optional b as string ="stupid") as integer
return 1
end sub
now compile that assembly
and reference it from another and see what comes out.
just in case you are to freaking lazy here are the results
Runtime error:
why because the MSIL was written for you guessed it C# and the method signatures end up being the same. the optional is removed because, uh its optional.
also for all the ByRef people out there, everything is a freaking object so why in the hell do you need to put ByRef?
try this
Module Module1
Sub Main()
Dim s As S = New S()
method1(s)
Console.WriteLine(s.value)
Console.ReadLine()
End Sub
Public Sub method1(ByVal s As S)
s.value = "Apple"
End Sub
End Module
Class S
Public value As String
End Class
wow look at that - s.value was set to Apple
even though we have byval?????
C# programmers know that S is a class and s is a pointer to an object so it would be set. I do not know how may times I have had to explain that to VB.Net ex-vb6 programmers. Who have been programming for 10 years.
IMO People who exclusivly program in VB or VB.net are idiots, VB.Net was supposed to go by the way side before VS2003 came out, it was a stepping stone. Hmmm anyone remember J#? What language does Microsoft develop in? C# what langauge are games starting to be written in C#, why because it is a better langauge.
and if code beautification is all any VBer can bring to the table, like, wahhhh "I want my End If to be displayed when I hit enter" then get a life or maybe an add in like Code Rush from dev express and create you own macros, if you cannot figure out how to use the IDE.
And code readablity
why does
If Not a = 5 Then
do something
End If
make more sense then
if (a != 5 )
{
do something
}
is on crack or a vber
and what is up with AndAlso and OrElse -
C# is default for short circuit. why continue processing the conditional if it has already been validated.
Dim ds as DataSet = nothing
If ds isnot nothing AndAlso ds.Tables.Count 0 Then
End if
vs C#
if (!ds ds.Tables.Count 0)
{
}
yeah I know there is some setting somewhere for short ciruiting
but then you have some person come in that only know VB and is wonder why you set it.
I have never used And ins VB it is always AndAlso
last thing about IDE
VBs famous auto compile or auto syntax checker.
Microsoft know there is a bug in it, it causes a machine to lock up and shutdown VS2003 and VS2005.
So Auto Syntax checker/compiler IMO is a waste of my time.
I wonder why C# does not have that feature - maybe trying to annoy anyone from using VB.Net?????
Intellisense. C# is so much better
try this in C#
DataSet ds = new
and poof System.Data.DataSet appears
Why can't Vb.net do this? Oh yeah wait lets use Imports and with statements right??? well sometimes, sometimes in development there are products that may have lets see
Company.ProductName.V1.ClassA
and
Company.ProductName.V2.ClassA
and you need to use both of these in your project or solution of projects (I know VBers, this is new idea multiple projects in one solution, but there it is) and you have to have the whole namespace and class name in the code and the imports will not help you out.
with statements were a bad idea from the begining and are a nightmare in debugging, but oh wait in VB you never have to run a trace or debug, beacause it is a perfect little (I do mean little language) ( BTW that is sacarsm)
and for one last point, for everyone complaining about case sensitive syntax, For the love of God, SHUT UP!!!!
There are Standards in coding, and VB just goes along and follows their own little standard. just look at any other real language that has been around for a while and you will see how easy it is to code using casing.
I am so freaking tired of reading someone vb code and seeing
objPerson or oPerson
and when you ask then why use obj or o and they answer because its and object, then you see
Dim I as Integer
and ask why not objI or oI, and they say because that is a value.
I just cringe
So
int i = new int();
must not be possible
Zen Master on May 14, 2008 9:08 AMlol, wahahahahahhaha, im goin crazy of your comments, BUT it helps.
Read Carefully.
Choice the best.
I've experience assembly, pascal, c/c++, Delphi, c++builder, vb6, vb.net, c#.net BUT in the end I choice Borland Delphi.
Why?
.net languages ends up hassle upon running to other computers specially if a client or a user doesn't know how to run it without installing the packages of dotnetfx.
eq.
Firefox Ultimate Optimizer is made by c#.net, NOW anyone who's not familiar with the file might end up discourage to run it. An error will occur, what a mess.
Why?
Borland languages like Delphi, because it's easy to run, install, compile, it can run anywhere directly without any packages to install with it.
BUT if I wanna choice a language for m$ .net, I would like to choice c#. Why? c#? because it you would like migrate the code in c/c++ or java, you can adopt the symbols, because its already been their with c#. Why? NOT vb.net? because you will be stuck on that English words language and when you migrate it to other languages maybe you end up a bomb seeing lots of symbols.
Well I hope you get my idea dudes.
Good Luck.
rocarobin since 1990
:)
visit my lonely site @ http://wwr.wirelessroot.com, http://roca.waitnet.com, ftp://roca.waitnet.com
Thanks to all of your comments, i really appreciate it, its helpful.
:)
Hello, just came to this site by searching vb.net vs c#.net. lol. I have experienced java, c#.net, c++ during university and c#.net and vb.net (this was later) in the 'commercial world'. Before i learnt vb.net, i looked at vb.net i said 'man, thats ugly code', because there are no brackets. But you know what its easier to code when creating websites in asp.net, it really is.
Obviously if you were to create systems, applications or even simple console applications then other languages are far more superior. As for migrating, well in my case of asp.net, there isnt a need to migrate to c#. Same functionality but with c# you code more, it all depends on what you want to do really.
There are problems like case sensitive, but why would you want it in the first place? Surely if you name your variables properly then you wouldnt have that problem, also its not very thought out if your thinking a 1000 line code with variable i and I and many others are in the code. just split everything up and you wouldnt have that problem(it all depends).
But then again i only just starting working in the 'commercial world', so i guess my opinion is completly and utter useless.
wah on May 27, 2008 1:42 PMWhat amazes me is that his post was posted November 2004 and the last comment was May 27, 2008.
A discussion going for almost 4 years! :-)
Rafael on June 27, 2008 11:02 AMJust because you can program badly in VB.Net does not mean that you automatically have to! I have been programming in various versions of Basic for nearly 30 years and I am currently looking at C#. Apart from some minor differences in syntax there really is no difference between the two these days.
I think it is about time C# programmers stopped being so superior, and if our IT department is anything to go by, I can produce VB.NET code projects 5 x faster than the C#.NET programmers.
David on July 3, 2008 11:58 AMTo be more productive, the code must be easy to read and understand. with this, you can have more time thinking better programming techniques, organize your classes methods, handling errors, better codes to efficiently accomplish your goal. C# VB.Net can accomplish the same thing. The superiority lies not on the language but on the programmer itself.
The language of choice depends on the individual. For me, I'm using VB.Net because I am already adapted to the coding styles. I feel more productive using this language.
Rolando on July 16, 2008 9:24 AMEnjoyed the article thanks for publishing it. This is an old argument. When you ask which is better c# or vb, there is one and only one correct answer: For what? VB is hands down the best way to sling together business rules for business applications. The notion that c# is the best way to do this makes me laugh.
jarhed on August 1, 2008 3:36 AMI use both VB.NET C# for more than 4 years. I feel more productive coding in C# because the syntax is cleaner less words to type. It makes me easier to visualize the object-oriented pattern.
Besides, performance in C# is better when I worked for big business applications which have hundreds of classes.
I started out programming in VB and i used to look at c# code and go crazy. the code seemed to go everywhere and the brackets would really throw me off. but i started programming in c# a few months back and now i look at vb code and i find it hard to read, i now love the brackets they dont confuse me anymore and i love how the code looks, i find it elegant. i dont think i'll go back to vb
El TimBa on August 18, 2008 2:53 AMI've read most of the comments and seems most of the C# programmers are arrogant, I do not know why they imagine themselves the esteemed ones in .Net platform when there is no advantage over one the only difference in between is syntax and in no doubt VB having a lot of advantage in that if utilize, please DO NOT think coding in C# needs little bit more intelligence and admits it is little bit hard since IDE is more supportive to VB.
shiv on August 28, 2008 5:51 AMMR.Shiv,
For your kind information c# is lovely language..........and I m loving it... :) :) :) :) :) :) :) :)
Mukesh on August 29, 2008 6:30 AMYeah yeah,
Most of the C# programmers are arrogant...
Most of the VB.NET programmers are incompetence...
Java Programmmers Rules The Day.
I read a couple of posts, not all :-)
It seems that most or all responses are pro VN.Net.
I come from the same background as most of you guys. ASP en VB6.
Still when .Net arrived I made the effort of changing to c#. And I haven't regret it for a minute. From time to time I have to write VB6 code and I get irritated by the end if etc statements.
This post is just to prove that not all VB background persons dislike c#. The readability of the code in c# is maybe less for people who use VB, but more clear for c# persons. I think it is much better then VB.Net :-)
Greetings.
Mark on September 18, 2008 12:17 PMHow can we explain that most C#/C++/java programmers understand VB code when they read it but VB programmers aren't able to understand C# code. By experience, I find that C# programmers have a better understanding of what they are doing (i.e. use better programming pratices, have better knowledge of the .NetFx, produce better quality code...)
Pat on October 21, 2008 12:14 PMAs a LONG time computer programmer (over 31 years now), I have seen a lot of good and bad programming practices.
I have worked on PC's and mainframes, as well as many other computers that no longer exist over my 31+ years in this field. Have used many different computer languages too.
---
One of the most underused and simply overlooked item in all Computer Languages: Good Documentation!
Source Code and External Software Documentation is a MUST to get the job done right!
Variable Names that tell what the variable is used for also simplifies documentation.
For Example:
x = y * z * a
The code just doesn't tell someone what is being done or why the calculation is needed.
However:
CalculatedInterest = PrincipalAmount * NumberOfDaysOfInterest * DailyInterestRate
Is pretty much self-documenting and much easier to follow.
---
Assembly Language is one that is too rarely used anymore.
It is a language that isn't all that hard to do if one knows what they are doing.
Yes, it takes a lot more understanding of how to do things and requires more personal responsibility by the programmer but is very powerful computer language.
For example, to say Hello on a MS-DOS / Command Prompt screen without clearing the screen can be done in 15 BYTES of executable code with 6 of that for the message when using Assembly Language on an IBM PC with calls to standard MS-DOS functions.
To do the SAME thing in C/C++/C# used to take over 50,000 (Over 50 KILOBYTES) of code.
Assembly language is well suited to speeding up timing dependent code for things such as Games that are written in mostly C/C++.
---
VB.Net is pretty easy to write and pretty easy to follow for most people.
---
C/C++/C# code tends to be spaghetti coded.
What do I mean by that?
Source Code is very hard to follow, Poorly Documented, and way way too many modules to try to follow when looking for variables and trying to follow what the original coder(s) were doing.
A good case in point on this would be the VLC Media Player... It is an Open Source Project... Well done project but very poorly documented with a TON of C++ Modules that are very hard to follow for even many seasoned programmers!
---
All computer languages do basically the same thing but the methods used differ.
Visual Basic's Left$, Mid$, Right$ are not the same in C/C++/C#.
Each Computer Language has a learning curve to get to where it is easy for an individual to write code using that Language.
It would be like someone that is fluent only in English learning to speak fluent Spanish or French. It takes a lot of time and effort but it is doable!
---
Which programming language is best depends on the what the application needs to do, what is the target audience, which computers and operating systems that the application will be used on, and many other factors. (Including the Computer Programmer and / or programming team that is working on the said project.)
Poor coding practices occur no matter which computer languages are used. It takes time and effort to overcome bad programming practices.
Developing excellent programs takes a lot of effort... You may not get the code done perfect the first time through.
A great example of this comes from Tim Sweeney of Epic Megagames fame. I read a story in a book where Tim told of writing the Original Code for Unreal. It took him 7 times to write and totally rewrite the code before he came up with the final version of the code. From seeing the final results of that effort shows that it was worth the time and effort Tim put into getting the code done right.
Being a lazy programmer is NOT a valid excuse NOT to document your code as well is not a valid reason to turn out poor software!
---
:)
BillNew on November 3, 2008 11:35 AMBill, I agree with you that documentation is crucial.
I am amazed that this topic has been going on for near 3 years pretty steadily. I'm also amazed at the general hatred of VB programmers by C programmers. It amazes me for real. Not just a statement. I cannot imagine why there would literally be so much angst against each other based on the language they choose to program in.
Yes, it's pretty much BS that a C# programmer gets paid more than a VB.Net programmer. And I'm sorry, but just because people code in C# doesn't make them any more diligent or more intelligent. And programming in VB does not innately make you a lazy person. I have written programs with series of modules, controls, and the like in VB that would make many C,C++,C# programmers' heads spin. I used to be a C-based programmer. I tried VB at v4 and wasn't a huge fan. I then switched over almost all together at v6 because I was told You can do that in VB. Well, guess what? I could. The C programmers in the class just didn't want to take the time to learn another language, and they were content programming a project 3-4x longer than I was. They said it wasn't feasible, I had to prove them wrong. At that point, I took over coding for a former coworker of mine. I SAW how lazy he was (he really didn't know what he was doing. He was the epitome of a lazy coder). I have used VB.Net since literally beta. I have also used C#.
For everyday projects that I need to get done in a manner than is timely as well as easy to understand for the layperson, I choose VB. For projects that require C#, I choose C#.
We really should stop focusing on who's language is better and bond together and encourage people to join the development industry as a whole regardless of which language they embrace. Programmers are falling out of touch with what's going on right NOW because they are afraid to push out of the bubble they create for themselves in their respective cozy language.
I encourage anyone reading this to take the time and actually code several projects in the opposite language in addition to your native. YES, it's going to take you longer... YES, you are duplicating efforts. But YES, you are going to learn that C#/VB.Net are the same thing on the inside. The Framework and the logic behind your code are what is important.
Here's something that I tell people who try to argue the language fight around me: Language isn't sh*t. Logic is everything. If your logic sucks, your code sucks.
After reading just about every single post (Its taken me a good hour), I'm sticking to VB. I wrote C/C++ in college and while I love C++, VB is still a killer pick-up language.
I do miss pointers and hacking in to memory to create noise. (Just kidding).
Oh and by the WAY to all you people who think that C# is going to make you more money, its all about how well you market yourself with your resume. Your resume is a marketing portfolio and how well you market yourself will get you the job, the money, and the rest of the goodies that come in the bag of toys.
Piyush Aggarwala on November 18, 2008 8:32 AMHey all, i would like to say that i did some projects in vb.net and c# but i like c# more because it is just more capable from my point of view, maybe it is just me because i am doing some game programming but i still don't like vb.net.
Maki on November 30, 2008 12:18 PMThis is more for anybody else who happens to stumble on this blog...but I feel compelled to address why C# developers paid more.
I think it's guilt by association and a perceived learning curve.
Many seasoned Visual C++ developers made the jump to C# simply because it offers them most of what they need and are used to (from a language viewpoint), but with an added productivity boost. As horrible as C++ is, with its jumble of syntax and features, anyone who could design quality code there would have little trouble with C#.
It also doesn't hurt that the syntax and programming styles are very similar. So it goes without saying that developers who've made their bones on C++ would do well with C#.
On the otherhand, many classic-VB developers jumped to VB.NET, but without the same depth of experience. VB was verbose and syntax rich (or cluttered), but it was lacking in other ways:
- Everything was interface inheritance and you couldn't even enforce Events as part of the interface.
- Static methods items? Had to fake it with modules back then.
- Threads? Microsoft for trying to dumb down VB with apartment threading, and then explaining a million times what it actually is.
- VB's error handling was quirky at best. Horrible, when abused. Try/Catch/Finally is a godsend, though bad developers can screw even that up (see Java).
- Programming flow: You couldn't escape using GOTOs, which has a bad rep. Though arguably, it's more powerful than the C-family's break/continue/return (etc.).
etc.
Furthermore, many VB developers were picked up by firms companies who do NOT enforce any sort of coding rigor design so there was a glut of people who knew the syntax, but not proper design.
Basically (pardon the pun), many VB to VB.NET converts had a lot of catching up to do in the early days. Unfortunately, rather than looking at the individual developer--anyone who believes the average QUALITY C# developer is better than Dan Appleman is fooling themselves--that VB its developers suck assumption persists to this day..
How can we explain that most C#/C++/java programmers understand VB code when they read it but VB programmers aren't able to understand C# code. By experience, I find that C# programmers have a better understanding of what they are doing
http://resmontazh.ru/
I grew up in VB development and I am pretty much self taught. So I never had anyone taint my view of language from the start. When .NET beta's saw the light of day, I immediately jumped in and wanted part of the action.
I started of on VB.Net as I was a VB developer and I did some good coding. Then I had to do a project in C#, it took me about 2 weeks to learn the quirks but it's been about 8 years and I have not looked back.
Moving to C# vastly improved my coding skill. Because VB and VB.NET were quite forgiving and made for sloppy coding. I still do some VB.NET projects today, but I use my C# coding approach.
I don't think one language is better than another, I just prefer C# and I have seen that quite often those who have come from a VB background tend to write sloppy code.
Werner on February 19, 2009 9:05 AMI've learned VB.NET at school (for two years), since I'm 19 I have no experience at 'older' languages. So I was looking for info about any possible differences between VB.NET and C# (besides the syntax) when I found this page.
After reading every single comment (wanting to make sure I didn't miss any valuable information), I'm now convinced that the only reason to learn C# is so I can understand the code of programmers who use C# (which I will do!).
Anyone claiming a skilled C# programmer is better than a skilled VB.NET programmer is talking BS. Yes, there are alot more less skilled VB.NET programmers than C# programmers (VB - VB.NET and C++ - C#), but that's no reason to rank skilled VB.NET programmers as 'less competent'.
How can we explain that most C#/C++/java programmers understand VB code when they read it but VB programmers aren't able to understand C# code. By experience, I find that C# programmers have a better understanding of what they are doing
a href=http://resmontazh.ru/http://resmontazh.ru//a">http://resmontazh.ru//a">http://resmontazh.ru/http://resmontazh.ru//a
Because VB.net is easier to understand in code.
Seriously some of the points raised here are so trivial such as
I do not want to type so much in vb.net or I love braces compared to End if
But seriously, it doesn't really matter cause the editor automatically adds end if , end for etc to your code as you type.
The thing is it complies to the same intermediate language, which means Microsoft in theory can enforce C# rules in vb.net and vice versa. They can create a whole new C#/vb.net syntax hybrid if they wanted to and it'll still compile to the same machine code.
This debate is really funny.
Adrian on April 8, 2009 9:59 AM-- Language is a personal choice. Companies shouldn't force programming languages on programmers. If a money-grubbing boss told me how to program, then I might have to tell him to _____ something up his _____. --
Anyway, C# is slightly preferable to VB.NET, and here's why.
First, C is my favorite language. It's beautiful, so raw and simple. You control everything. You can write super low-level code or high-level code. The choice is all yours.
For desktop applications, I find C++ easier than C. It saves time when I don't want to worry as much about memory allocation/deallocation.
I find VB6 and VB.NET easier than C++. They save time when I want to access a COM/OLE late bound object and when I really really don't care about memory allocation/deallocation.
I find C# easier than VB6 and VB.NET. It can import late bound COM/OLE interfaces, and it looks more like the C languages I'm used to, which means I don't have to waste time learning a new syntax to express the same language concepts that all access the same object model. Also, I love curly braces. Matching braces in a text editor is really useful when moving code around. I'm sure there's some text editor that will jump from If to End If or Sub to End Sub, but I see no reason to find such an editor of learn a new language, when I already have C#.
In any situation in which either would be useful, C# wins over VB.NET for me.
I know both VB.NET and C#. I come from a VB6/VBA background and basically taught myself C# after learning C++ OOP in school. There are advantages and disadvantages to almost every language and as mentioned previously, it comes down to preference.
Personally, I found my code writing to be cleaner and simplified within C#. The big reason that makes me lean toward C# is 'compile-time' vs. 'run-time'. Granted, the user doesn't care what language it's in...as long as it works. As a programmer, however, a program is never complete and is constantly begin debugged. I prefer to step through and debug C#. It's more logically concise. VB.NET always appears 'spaghetti' to me. C# is the flagship language in the .net platform (according to Microsoft) and was specifically designed for .net.
To me, VB/VBA/VB.NET always felt amaturish. C# feels more like an enterprise level language. When my boss tells me to write something in VB.NET, I do it. But when not told, I always use C#. Again...this is my personal opinion.
Steve
Steve on May 1, 2009 10:47 AMHow can we explain that most C#/C++/java programmers understand VB code when they read it but VB programmers aren't able to understand C# code. By experience, I find that C# programmers have a better understanding of what they are doing
http://moyalodka.ru
I come from a C++/Java background and prefer VB.Net just because Visual Studio seems to work better with it. Everything else is pretty much the same to me. Honestly, it usually takes me a minute or two to realize that I'm looking at C# code and not VB.net.
James on May 20, 2009 3:41 AMThis was a fun read, a little disturbing at times but fun in the end. I'd point out that most of these arguments come down to personal preference and there really is no such thing as a best language. Perhaps there is a best language for the task at hand, but even that is questionable.
Which is easiest to read/debug? Most likely the language you'e used the most, or perhaps the one you learned first.
Why case sensitivity? Because its more flexable and gives you more variable names than you could possibly need. I liked the concept used earlier where you could differentiate between like data items using case (using "bro", "Bro", or "BRO" for example). That's something I guess you couldn't do in VB, but it also isn't a show stopper. I tend to like longer variable names for the same reasons mentioned above--they are more readable. There is a place for short names though and there are plenty of reasons to use case to differentiate between like data items. It would probably take a C programmer to see the world that way though.
Why do VB programmers seem to have problems reading C? Because they are use to a more verbose language. The inverse of that is true as well. I have a hard time debugging VB.NET (I haven't learned it yet but may be forced to) because I am not familiar with it so I feel the verbosity slows me down.
On and on this argument will go because it is human nature to feel like your favorite language is the best. It probably wouldn't be your favorite otherwise. IMHO you should all learn to question your own opinion before calling anothers into question.
Fr33d0m on June 3, 2009 1:09 PMDue to C#'s immense popularity, VB.NET feels like the underdog, and I always root for the underdog! Also, I've always had somewhat rebellious streak and preferred going against what's considered "mainstream". And, to me, C# feels mainstream now, so I am preferring VB.NET at this point. Actually, if I could find a good Delphi gig, I'd probably ditch .NET altogether. Or, maybe I'd like to do Python/Ruby. But, of course, being the contrarian I am, if I were in a Python/Ruby shop, I'd start advocating .NET again, lol!
Against the grain on June 23, 2009 7:53 AMAfter nearly 5 years the debate goes on about slight syntax differences and a few things you have in one you don't in the other.
C# is based on the C/C++ syntax to make the language easier to transition to for C++ programmers.
VB.Net is closer to the old VB syntax than it is to the C/C++ syntax and was probably introduced due to pressure from the huge numbers of programmers disappointed when VB6 was canned. It isnt really a new version of VB6.
From an objective standpoint, VB is a more 'modern' language with less obscure notation and lower count of non alphanumeric symobl use. C is nearly 40 years old and its syntax was designed when displays had 80x25 characters if you were lucky. With that sort of display it made sense to cram as much into as little space as possible. It mattered less if it was difficult to interpret at the time. After all, if you have 1KB of space how difficult could it be.
With limited resources for your compiler it made sense to have '=' and '==' and similar but does it really make sense these days? These sort of mixups have cause expensive space program failures.
Advances in available program space etc made programs larger and larger and we started to need code to be written as simply as possible to minimise bugs and make maintenance easier. As someone else may now be working on the same code as you, it doesn't matter if you know that your function called IPT() stands for InsertPastedText because the next guy won't without perusing more code than needed.
C is very flexible but this flexibility makes it easy for less disciplined programmers to make mistakes. It was made overly flexible because they didn't know any better at the time. It is also designed to allow easy translation into machine code on different processors, which also gives portability. Luckily the IDE stops many of these errors with C# etc. Even so, many C compilers still choke on this code because of omitted white space 'a = *p/*q;'
The guys that say "programmers that don't easily understand my complex code are thick" are actually the worst sort of programmers. Unfortunately, excellent IDE's and high level 'languages' like .Net allow lesser people like these to call themselves programmers.
I guess Java was designed as a modern replacement for C but for now and the forseeable future, for footprint, speed and exact timing C still rules. Luckily for you PC only programmers these things don't really matter. No prizes for guessing what .Net is based on...
In case you are wondering, 75% of my programming is in C (not C++) on embedded systems for high reliability critical systems (vehicles, weapons, machines etc). On the PC part of my projects I use VB.Net where possible because *I* prefer it even though C# feels more natural.
Remeber people, be verbose, comment where necessary and most of all 'KISS'. If you have a list of }}}}}}}}}} or EndIfs somewhere or your function spans more than a few hundred lines then rethink your design. Program for reliability first and speed up what you have to later.
Well, in my short (under 1 year) experience with both, I'm sure I can't make any daring assertions, but I must say: VB.NET and C# are mirror opposites.
Each is used primarley for a completely different purpose. You can't compare the two, its like comparing... two unlike things. Even though they're both based upon the .NET framework, they are still different languages at their cores, and, despite progress to mesh the two, they will always be in that situation.
If you morphed C# into a VB type syntax, you would lose all purpose of their being a C#. Ditto with the vice-versa. The reason that we have both languages is because some people want a strict syntax that won't let you screw up, and some want a syntax that is flexible.
I could just say pick your favorite, but instead I'll say:
Pick your poision.
Both have fundamental problems at their core, and more seasoned developers than myself could attribute to that. Its true for every language: VB vs. C# is just a small crumb of the programming cake. What about Java vs. VBScript, or ASP vs. [insert language here]. We're wasting our time fighting this out. Pick a language, get a book, and make an app.
Peace,
Adam
Well, I've been VB since 1991 and I'm working on learning C#. Much of it is just different ways to do the same thing. Also, as a UI developer, I am once again struck and different people like to do things differently, and how everyone has their own idea of what is 'easy' or 'hard.'
Thus, all I can offer here are some humble observations and entirely subjective opinions about the differences in syntax between BASIC and C.
For starters, C requires too much punctuation. Parentheses around boolean checks, a semicolon at the end of every line, and braces everywhere - curly and square. The standard QWERTY keyboard is best suited towards typing letters (and so are my fingers) and the human brain is best suited towards reading words. I find it HARD and disruptive to stop my touch typing of words and input ENTER curly brace number close curly brace enter.
Add to that the fact that a closing curly brace does not tell you what it's the end of. End Function does.
Proper and clean formatting of C code requires you to put opening and closing curly braces on their own line, alone. In my opinion this can take up too much vertical space. In BASIC you at least have a choice of how much white space to put in your code. Sometimes I want space between sections, other times I like to put all code for a bit of logic very tightly together to reflect it's cohesiveness. You *could* do the same in C but at a tremendous expense in readability. Again, all that pesky weird punctuation gets in the way.
Regarding Case Sensitivity: We are not case sensitive in our minds -- If we say bill, we mean Bill. Computers are far more literal than we are, though. I prefer it if the IDE enforces consistency while permitting case insensitivity. If I define a var as strFirstName and later type strfirstname the IDE fixes it for me, and the issue is done. That to me is cleanest.
I certainly dislike "car car as new car". It's unclear from that line of code which is the class and which is the instantiation. BASIC prohibits this, treating object names as keywords. It makes them sacrosanct, which I prefer.
There's an old joke that says "If they devise a language that lets programmers write in English they'll discover that programmers don't know how to write in English." Certainly this helps explain the many complaints about sloppily written BASIC code, but at least in the VS IDE things are consistent.
There are some who say one is being 'lazy' if one likes VB and / or the automatic corrections and line-by-line compilation it provides. I consider that hypocrisy. If our job is to write computer programs that make it possible for people to work faster and more efficiently, why should we not expect our own IDE to provide us with that same benefit?
BASIC is much closer to English than C which is why I --- very subjectively and humbly - prefer it.
VB.NET vs C#?
I have a question?
Between the 2, which is much simpler to use? Kinda, my programming or life will be less miserable and will deliver acceptable result in the end.
just passing by.
bullseye on July 20, 2009 1:20 PMI was laid off from my job in March where I made in the mid eighties writing VB.NET code.....I worked up to a Senior Programmer level. Now that I'm looking again for another developer position, I'm finding that all jobs require C# and they act like my 9+ years of VB.NET is worthless....I am looking at having to take a 13k+ cut in salary and enter the market as a junior programmer if that is even possible.
Companies have bought the C# preference promoted by Microsoft and it's killing VB.NETers out here during this recession.
I started using Delphi in 1996 with v1.0. I've since used every version to some degree or another. I'm Borland Certified on Delphi 7. So, yes, I'm a huge Delphi fan, both the IDE and the language.
There are some projects that I've written and/or maintain in VB6. But I hate it. As a MSDN Premier member, I have access to all of Microsoft's newest development toys. So I've dallied in VB.NET and C# and I'm confident that if my survival depended upon it, I could feed the family using either VB.NET or C#.
Having said all that, I ask you, Esteban, how does Delphi have Edit and Continue? Spreading FUD doesn't help our cause... ;)
Jon Robertson on February 6, 2010 9:30 PMOver the past 27 years, I have programmed in about a dozen languages, including several BASICs, PL/I, FORTRAN, SNOBOL, LISP, Assembler, C, C++ and a language so bizarre that it required its own character set to program in - APL.
I started playing with VB3 in the early 90's, and as I was not a device driver developer, and as CPUs started getting faster, by '96 I completely abandoned C - syntax languages and have been full-time VB (VB, VBScript, VBA, VB.NET).
Why? Because I find that it is incredibly easy to write code that is utterly incomprehensible to you and anyone else, using the cacophony of symbols that C-styled languages support, while even with poorly written VB, it is harder to write code that is hard to decipher.
IMO code that is easy to read and debug is more maintainable, and less prone to bugs, and therefore more efficient from a TCO perspective.
I appreciate not having to worry about making obscure mistakes like using '=' when I need to use '==' or accidentally defining a different variable because I accidentally capitalized a letter, or looking at parentheses inside parentheses and trying to figure out whether these parnes are delimiting 'if' statements, defining a cast, or something else.
While it is cool if you need to save lines of code to be able to write things like 'row(++i)' or to do in-line assignments like 'if (i = 2 y)', constructs like that make it very easy to obscure what you are really trying to do and create confusion.
I like to think and code at a high level, not 2 layers above the CPU - that's why we buy powerful compilers! I say make it easy for humans to read, and compile it so that it is easy for CPUs to execute.
My value comes from getting things done, quickly and well, and can be read by other people six months from now, not from impressing people by writing code that is hard to read.
I prefer to use my brain's CPU cycles to think thru the problems, not for real-time translation of machine-oriented syntactical constructs.
Ken Granderson on February 6, 2010 9:30 PMThis is why I use C++/CLI.
Speed
C++ Syntax
.NET Framework
Native
If the intellisense wasn't so bad, this arguement may be between different languages.
The comments to this entry are closed.
|
|
Traffic Stats |