Is C# Better?

  • Comments posted to this topic are about the item Is C# Better?

  • Generally there is no functional difference between C# and VB.NET. Everything you can do in one language can be done in the other, too.

    I've started with VB5/VB6 but now I'm a C# developer.

    Why? Because I changed the company (before .NET became released) and I had to develop with C/C++. As .NET raised the company moved from C++ to C# because it looks more alike.

    I think the main reason why people use C# instead of VB.NET is, there are more professional C++ and Java developer than VB6 developer. A C++/Java guy or gal who has to move to .NET will choose C#.

  • Heh... I have an odd personal preference... I don't like languages that require semi-colons or line continuation characters. It seems that they should all be smarter than that. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (11/12/2009)


    Heh... I have an odd personal preference... I don't like languages that require semi-colons or line continuation characters. It seems that they should all be smarter than that. 😉

    Me too 😀 I absolutely can't stand semi-colons at almost every line ... what a waste (and possible errors, too!).

  • And all those curly brackets. Should they be typed to the right

    if (wosh) {

    ..statement;

    ..statement;

    }

    or aligned

    if (wosh)

    {

    ..statement;

    ..statement;

    }

    The second style is used in the Microsoft community.

    The first style is used by strong individuals, like the creator of C and C++.

    I prefer the Python way:

    if wosh

    ..statement

    ..statement

    Now, to my real question:

    I've got a working mate, that indents T-SQL with one space. Seems very odd. Hard to read 3000-lines procs.

    Tried to google for styles and found mostly 4 or 8 space indentation, using tabs, not spaces.

    As we are going to version our procs with SVN, how can I persuade him to use a better indentation standard?

    What T-SQL standards do you recommend?

  • I suspect a lot of the reason that VB.NET is looked down on is simply because it's BASIC. There have been many truly awful versions of BASIC released over the years, and I would include Visual BASIC 6 in that undistinguished company, so chances are most people "looking down" on VB.NET have actually never used it and are just assuming it must be bad because so many other BASIC versions were.

    Not to mention the really pretentious people who wouldn't be seen dead programming in a language whose acronym includes the word "Beginners"... 🙂

    Speaking personally I tend to use C#, but that's because I come from a C programming background and prefer the syntax. I don't have any particular hangups about using VB.NET--if someone asked me to write a program using it, I'd do so; given the choice, though, I'll go C#.

  • In terms of moving of from VB6 to C# or VB.Net, the fundamental difference in moving from an Event-Driven-Language to the and Object-Orientated-Language is so great, plus all the learning all the libraries in the .Net Framework, that in my experience there as much work involved in moving to either. I moved from VB6 to C#, and for good reason. Historically new language features are added to C# first. Most of the jobs out there are C# (in EMEA at least, not sure about the US), and most of the code samples too. One of the biggest reasons for me though is the structured error handling (Try-Catch-Finally). C# only supports this, whereas VB.net still allows the old goto statements, which allows for serious spaghetti code scenario's which is plain evil. The curly brackets are much quicker than having to type "Begin" and "End" all over the place. For the person complaining about the if statements, if you are only having one line of code after the if, you don't have to have the curly brackets. And finally, a poll was done last year, asking what language would people use for new projects by April 2010, and C# outnumbered VB.net 3 to 1 (http://geekswithblogs.net/iupdateable/archive/2009/04/02/msdn-poll-april-8th-2009-what-language-would-you-like.aspx (click on View Results)). Nuff said 🙂

    if you don't have the time to do it right, when will you have the time to do it over ?

  • Hi Guys,

    I started with C/C++ but went on to Power Builder then VB 5 then to VB 6, now in VB.NET (total 10+ years on VB side) likely that I ll be starting to work on C# for my next project. I don't have limitations but still this is going to bother me a bit to start with. (Getting accustomed to the C# syntax).

    Due to long association with VB, When typing more likely to type VB syntax often. Except for this, I don't find any issues.

    As long as you understand the basics and stick to structured programming ways, you can switch from one to another without big troubles.

    I think many of the guys today prefer C# because of "C" language. But I think though VB sounds basic like, it is easily readable compared to C#

  • The reason that I chose C# was purely because from my point of view it was easier to learn.

    I came from a C++/Java based background and found C# much easier as I did not have to learn a whole new set of keywords and syntax.

    Thoughts on brackets:

    This is easier to follow with multiple nesting

    if()

    {

    //...

    }

    than

    if(){

    //...

    }

    or

    if something

    //...

    //...

    I think most people will agree that it is most important that code is explicit and understandable.

  • I definitely agree with Iain on the positioning of the curly brackets issue. Pretty sure the

    if (x) {

    // something

    }

    only came about to save a few precious characters in the source code in Kernigan and Richie's original book on C, but these days people treat it like it's the One True Bracketing Style and thou shalt use nothing else!

  • Maybe this will help: http://aspalliance.com/625

    Personally, I'm a VB.net guy. If I'm honest, it is because for a few years I dropped out of the developer scene (working with TSQL and PL/SQL), .net sort of snook up on me. Now I'm getting back into it, I chose VB.net out of pure preference of the styles. I am however, quickly learning this is a mistake. It would appear the world is leading towards C#, and I can see VB.net being phased out (or at least send back to the "this is a learning language" days). All the jobs I see are for C# developers.

    Lee

  • I've been using VB6 for sometime and recently started looking into VB.NET.

    I think the reason people prefer C# is that (like someone posted), there is this general elitist syndrome from people who code with C++/Java concernig VB programmers and the same thing has translated into the .NET languages.

  • I moved from a VB shop to a C# shop a few years ago and after the initial pain of having to learn the syntax, I'd say that there's little to choose between the two. (That said, I do miss the "Using" statement in VB :-)). Now that I've been using C# for a while, I have to dig the book out whenever I switch back to VB.

    Probably the biggest thing to learn in .Net is the framework, and this is the same in both languages.

  • I've been using VB6 for many years and moved over to .NET about 3 or so years ago. I mostly program in VB.NET but on occasion tinker with C#. The one thing I love about VB.NET and the 3.5 Framework is XML literals! If you work with XML on a regular basis then VB.NET makes life so much easier than C# (in my opinion). As far as I'm aware this feature will remain VB.NET only!

    I think there a lot of C# people who look down on VB.NET as being an inferior language but I think any real developer out there knows that each language has its Pros and Cons, and at the end of the day, is it not all about getting the job done on time with the least amount of hassle?

  • I started programming about 2 years ago using classic asp in web applications and am now using vb.NET in software development having had a period of doing web development in VB.NET in the middle. Of course because of the small amount of experience, I know no other than to use VB but have seen some projects using c# and it resembles slightly the java I used back in my degree and also javascript. It is slightly intimidating because of the lack of understanding I have for the syntax.

    There is something about c# that captures me and is persuading me to learn it, I'm not sure if the drive behind this is personal preference or career prospect orientated (more likely the latter). My question is shall I become a more fluent vb programmer first and forget about c# for now or shall I start learning the syntax now even though I'm 10% of the way in to learning VB.NET (with WPF)???

Viewing 15 posts - 1 through 15 (of 176 total)

You must be logged in to reply to this topic. Login to reply