C#, Javascript, Java, C++, is almost all you need to program in a large variety of environments from .NET, ASP.NET, Websphere to Mainframe. A programmer who can use one of these can more easily learn the others, and a C# programmer should be able to easily pick up VB.NET whenever necessary. I go back and forth between VB.NET and C# frequently. I prefer C# syntax. I think that some of the OO mechanisms for VB.NET are overly verbose and awkward, not even aiding readability. However, the case insensitive is nice in VB.NET, especially as studio will automatically clean up case typos. The ‘Exit’ in VB.NET is better than the ‘break’ in C#, but C# has ‘continue’. C# should implement ‘break’/‘continue’ as used in Java, which is better than either (supporting labels).
People forget that the so-called multiline comment in C# /* / is also a middle of the line comment: Value / comment */, value… etc. Whereas the ’ comment in VB is clearly inferior and cannot even be used at the end of _ split line. Perhaps some sales rep came up with the excuse that people use the other comments inappropriately, but I believe the real reason for the inferior comments is inferior parsing in VB, which would explain the inferior OO constructs as well.
However, when it comes to just C# vs VB.NET, you can get the exact same functionality from both with some understanding of them. I have converted code between them frequently, and very easily.
I think the main reasons to use C# syntax are: many of microsoft’s examples are now more naturally in C#, Javascript has similar syntax which aids coders working in ASP.NET, Java and C++ are crossplatform and C# is more easy to move to them whenever necessary, and the industry standard appears to be moving towards C++/C#/Java syntax meaning more and more updated libraries use C#.
I don’t understand the people who complain about the braces in C#. Like Cata said, use the Ctrl + ] combination. Even VS will highlite the pairs for you. If your code is weirdly formatted select your code and press ctrl+k , ctrl+f
That will properly indent your code.
I’ve programmed in VB, VB.NET and C# for quite a while now, but I definately prefer C#. If not only for the terrible code snippets in VB.NET.
if I want to create a property e.g. in a c# class, I would go:
ctrl+k, ctrl+x, p , enter
there I go… How many keys I have to hit in VB?
I also don’t like the syntax for generics in VB.NET.
class MyClassT where T:OtherClass
{
}
compared to
class MyClass(Of T as OtherClass)
end class
To come to conclusion, programming in C# is much faster, for me at least…
I personally program in C#, and I prefer the look of the code over VB.NET. I like to make fun of VB programmers because I think the code sucks, but I know deep down that it’s preference. I like C# more simply because I grew up with C++, and the two languages are syntactically similar.
I like c# for the same reason I like pizza, and I dislike VB for the same reason I don’t like es cargo.
This has all been really amusing…reading a 3 year old post and all of its comments.
THREE YEARS worth of arguments, and still no winner
I’m a self taught developer, and I tackle things with a ‘nothing’s difficult’ attitude. With regards to .NET, I naturally grabbed hold of VB.NET as I ported alot of Classic ASP web-apps and VB programs over.
I soon got wind of the preference for C# in the development community, and to be honest I still don’t know why this is the case. Most of the C# developers I’ve seen aren’t rocket scientists, they just type different syntax into their IDE to do the same things I’m doing…go figure. Nonetheless I took it on, taught myself C# top to bottom, used it for a while then went back to VB.Net
Brilliant stuff C# was, compared to VB.NET (at the time still on VS2003), but I always felt I couldn’t get myself into RAD mode with it. Now I’m not talking about the abovementioned ‘lazy’ programming, it’s just a matter of getting on with the task at hand, not worrying about case sensitivity, endless braces, unnecessarily cryptic constructs and tripping over Car vs car vs CAR…
Today I still prefer VB.NET, and I work with both languages, and god help anybody who comes to me saying I can’t do what they’re doing in C# (yes, one or two exceptions, don’t be anal) You get the idea…
at the end of the day guys you need to realise that there is no battle to be won here, this like is a dick measuring contest between girls… POINTLESS. write that down.
Some of you people need to get a life and off your elitist kick. I’ve programmed endless business applications in C, Perl, Php, Java, C#, VB3-6, Vb.Net most focused around data driven business processes. I’ve never run into a task in the work place yet that I haven’t been able to finish no matter the language I’m using.
This page is full of generalizations, stereotypes and bias. I’m currently implementing both C# and Vb ASP.Net applications and I have to be honest that either are fairly easy to use. The syntax issue is mostly preference and we all have unique preferences on lots of different aspects of life.
The insults on intelligence and broad generalizations show the character of those slinging them. Instead of sticking to facts they pawn their preferences off as fact and down play anyone who doesn’t agree.
The only people I ever see whining about case sensitivity are those muppets that dont know the difference between a Type and an instance
VB.NET doesnt help matters any, by making a default instance of some objects that is named identically to the type. Form1.Show() anyone? Is that a static method call? Who knows…
Do a lot of dataset work and you’ll grow to hate the moronic convention VB adopts for naming instance variables on a form…
If programmers could have a bit of case sensitivity sensitivity, and actually stick to:
No offense, sitting here to figure out what I should learn c# versus vb for .net have already had on project 3 years ago with vb.net.
But here I think is the kicker don’t they ALL use the same compiler/runtime module? Isn’t that what the hype is about with being able to program a project in different languages but one compiler executes it?
If so then how can somethings be done in c# and not vb.net and vice versa.
Aside from that I programmed in c++ to start and moved to qbasic and then to visual basic.
The thing I hated most about c++ was memory leaks. People forgetting to declare a variable (such as a char type) with enough memory so it wouldn’t overflow into something else. I don’t know if c# is that way. But I find the string in vb much easier to handle string type variables then always worrying about declaring enough memory.
Case sensitivity sucks, there is no need for it.
And frankly c++ got to the point sometimes where it wasn’t humanly readable for all the little things someone used to program with it.
I am still debating about c#. I really have had so many bad expereinces with memory leaks from not only software I maintained written by other people but also software purchased for thousands of dollars that was written in c++ to have stupid memory leaks.
Aside from that I think vb descruction of objects is bad and it could use a boost in how c++ declares objects with constructors and destructors manually by the programmer.
And I like the return value feature in c++.
But back to my point isn’t all this arguing just about symanetics? I mean they use the same compiler to execute the code so it is all the same no?
sigh
pardon my english, it is not my native language.
i prefer
{
than
begin
i prefer
}
than
endif
i prefer
int x;
than
Dim intX as Integer
i am a genius programmer who got very unlucky and lost 8 fingers, only 2 fingers left, 1 on each hand. so when programming, the lesser keystrokes, the better. so i prefer c# than vb;
i want case-sensitivity.
i want to name a variable ‘bro’ for little brother, ‘Bro’ for bigger brother and ‘BRO’ for the eldest brother.
in vb typing ‘littleBro’, ‘biggerBro’ and ‘eldestBro’ is very tiring.
codes that are easy to read are only for programmers who can’t analyze well. if it (the program) is hard to write, it should be hard to read. if you can’t read it, don’t read it. my eyes are my first debuggers. so the lesser characters to read, parsing of program in my head is faster. by the way, i lost my one eye, so i got only one.
cheers,
abduljakul
from tudukmamot
p.s. i think i lost my 8 fingers because of programming in visual basic before. they got very tired typing lots of characters. now i use my 2 thumbs to type codes in c#. i think i lost my one eye, because of reading too many characters too in a vb program.
} // End foreach
} // End for j
} // End Method
} // End Class
I started out as a vb/asp programmer, moved on to vb.net but currently working on php, and with tons of coding in javascript and some php I’m quite happy with the brackets, you just need to learn to indent you code (comments are optional but they make sense on hough blocks):
}
}
} // End Method
} // End Class
So I will probably move on to c#, just need to make the step… (and convert my code…)
“But back to my point isn’t all this arguing just about symanetics? I mean they use the same compiler to execute the code so it is all the same no?”
It worries me that someone actually allowed you to program in C++! You are the first programmer that I have ever heard of who does not understand what a compiler it!
Where the eff is “tudukmamot”? Or was that whole response in jest? I sure I hope I am just horrible at Geography and that was not some silly attempt at levity. I worked with a programmer for nearly 2 years who was missing fingers. He typed faster than me.
A lot of the points are .Net 1.1-centric, most of the “missing” features were added for vb in 2.0
If you set the vb.net visual studio preferences (strict on, explicit on), whats the difference at that point from C# (as far as typing and allowing “lazy coding”) Why WOULDN’T you setup VS this way?
Why do these examples prefix a variable name with “m_” for vb code like the compiler requires it or something? And who is using “variable” and “Variable” as names to represent two different objects? And how is typing case-sensitive variables faster than case-insensitive? Most of the “verbosity” of vb code is generated by the IDE (at least in VS).
The visual studio IDE is just hands down better, which doesn’t make any sense to me, they should function the same between all supported languages. ex, adding event handlers to a control in c# has that funky “press tab twice” interface, in vb.net you select the item and event from the drop down lists and use the “Handles” delegate, or just use “AddHandler control.event, AddressOf methodname”. Auto indentation, auto-creation of try/catch blocks if/then blocks, all these things just seem so obvious to be included in the c# ide
I think this whole comparison is irrelevant, though, as of .Net 2.0 at least. If you’re a vb dev that wants c# money, write it in vb and use SharpDevelop to convert it to c#
even microsoft thiks c# is superior. watch what microsoft does instead of listening to what microsoft says. i.e why did they use C# in building the .net framework and not vb.net? ask yourself that question and you will see the truth.
Well i will start off saying i preffer .net anything to c or c++, which have programed many things in, but hated every waking moment of the debug prosses. C is like reading a text file in notepad that notepad doesn’t suport. That may not be true in all cases (some people that spend time on there c apps and know how to organize them and can be read easily), but for the time i have spent looking at c code IT SUCKS to have to read. I personaly started on vb but i started to here that vb is a bad lang. and “You can do anything in vb” so i learned C and C++ and I find that I can do alot in vb. I think that C programers are fine and that they can do somethings a .Net programer can’t but I think they DON"T understand the languge to know if you can or can’t do something, and if you are like me as a .Net programer (C# and VB) you go back throught and organize your code further. You make sure there are no inconsistances in you case like Dim a as… and then using A = … (not a real problem for me because I use lower case to be consistant, but i still check to make sure.) I also make sure thing like the if then statments are space right.
If … Then
a+b = c
Else
If …Then
Me.Resource.Stuff = 9
else
If … Then
End
Else
End If
End If
End If
Then I add in notes and it makes nice easy to read code that make it easier to see bugs. Also you can use the debug function Step Into so you can watch as your program goes throught the code (Very nice). But in the end I find .Net better than the older c or c++ and also I haven’t see many c classes around so if that is not a hint that .Net is better than c and c++ than I don’t know what is.
I prefer C#. It combines the easy to use of VB and the power and OOP of JAVA with better performance and a better IDE (VS 2005 vs. Eclipse vs. NetBeans).
All C++ code is just unreadable and unmaintanable.
As a book of Software Engineering and COCOMO model says, when you need to write 32 lines of code to perform some task in VB or C# you will need 92 lines of code to perfom the same task in C++.
And if we assumes that a good programmer has 5 errors each 1000 lines of code, the C++ program will have more bugs than the ones writen in C# or VB.
So, I respect those who program in C++ but I really dont understand why they prefer to code more lines of code to have a worst program.
in my opinion is the language secundary. I developed with C/C++/C# for years, but I am a Softwaredeveloper and I had to read much many other code in other languages (for interoperatibility for example).
Now I develop with VB.NET and it doesn’t matter to me…
It’s much much more important to develop with a good coding style, and I prefere a good software architecture. With .NET both C# and VB.NET will be translated almostly into same IL-Code so no advantage or disadvantage will be with using different programming languages.
Please spend more time with Software Architecture, Future plans (scalability and maintainability), code DOCUMENTATION, and new technologies (MDD, SOA, platform independencies…)