Is C# Better?

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

    I second that. To be productive in .NET you should become familiar with the many thousands of classes. Compared to that, adjusting to C# or VB syntax is not much of a issue.

    There are many non-programmers out there such as Actuaries, CPAs, and others who are great at VBA - which is shortly going away.

    My guess is that VBA coders will eventually move to .NET, but via PowerShell and not C# or VB. Still a steep learning curve though.

  • Florian Reischl (11/14/2009)


    I just don't understand why features like "Option Explicit Off" or "On Error Resume Next" are still supported. I've started with VB long time before .NET was available and I never understood those "features"...

    I'd be happy if any VB guy could tell me any case where those things might be helpful. (Except: "Because some Excel VBA players don't know how to define variables and how to handle errors".)

    You got me on Option Explicit Off, although I suppose it's for backward compatibility. Although everyone decries untyped languages *used correctly* (as one must in Python, for instance) type safety is not only a strait-jacket, it's crippling. However VB doesn't have Python's type transparency to anything like the same degree, so for VBA it was backward compatibility. For VB.NET I have no idea why you'd want it.

    As for On Error Resume Next, used *properly* it's your friend. Although Try/Catch is a better alternative, On Error Resume Next can give finer control over the scope of an entire sub/function as opposed to the more pin-point control of Try/Catch. Given my druthers I prefer Try/Catch but having done VBA for over a decade, On Error Resume Next isn't the horror some make it out to be--if you know how to use it.

    I think a lot of C# programmers don't understand VB (any flavor) because they're used to a much more rigid environment. VB does a lot for you that C# simply doesn't. However because it does the environment is *different*, with different rules.

    VB is closer to a language like Python than C# (although it lacks Python's elegance and *utter* lack of typing). Use Python for any length of time and while you *will* appreciate type safety (and possibly miss it on occasion ) you learn how to keep your types safe yourself. It isn't all that difficult, after all.

    VB's not so different. Like C# it requires programming discipline, it's just a *different* discipline. 🙂

  • Which is better between C# and VB.Net? ....Uhmmmm.... Java! 😀

    No, seriously, it's just a personal choice. I like languages that force you to think in a rigid way, like C# (a little) and Java (a lot). When you start coding with ideas clear in your mind it doesn't make any difference which language you are dealing with, but it does a lot of difference when you sit in front of the keyboard and start typing without a good analysis. Flexible languages such as VB.Net allow you to write crappy code, rigid languages such as Java simply don't allow crap.

    Once you have worked for some years in a rigid language you start thinking that way and it won't make any difference which language you will code in from then on.

    -- Gianluca Sartori

  • Gianluca Sartori (11/16/2009)


    Flexible languages such as VB.Net allow you to write crappy code, rigid languages such as Java simply don't allow crap.

    It is quite easy to write crap in *any* language. What you mean to say is, it's not possible to make certain classes of mistake in language X because the compiler catches them automatically.

    On the other hand, it's quite possible to make *other* mistakes which are equally crappy. Your other point (about thinking rigidly) translates to "You can write C code in any language". 🙂 This POV is anathema to native coders in *any* language...

  • I am a C# developer, and i really dont like VB.NET, i Like the bracts, and the semicolons, and i truly believe, if it wasn't for VisualStudio, it would a much harder task.

    Having said that, there is no real difference in the underling output, form VB.NET and C#, it is about how you think about the code, and how do you write it. ( i humble myself to all does that can endure that dreadful syntax)

  • >Compared to that, adjusting to C# or VB syntax is not much of a issue.

    Once the Framework is understood, converting from one language to another is a matter of a few days training.

  • Gianluca Sartori (11/16/2009)


    Which is better between C# and VB.Net? ....Uhmmmm.... Java! 😀

    No, seriously, it's just a personal choice. I like languages that force you to think in a rigid way, like C# (a little) and Java (a lot). ...

    I guess, then, that you would enjoy COBOL and be tickled pink by RPG-400.

    ATBCharles Kincaid

  • I'm about equally fluent in both VB and C# and I hop between both in one solution. It's just not true that C# gets all the new language features first, XML Literals being the current example. But there are times when I feel that VB is falling over itself (such as its expression of lambdas). Of course, the downside of switching between languages is that I Dim variables in C# and insert semi-colons in VB but it's more amusing than anything.

    At college I learned some C++ and Java which made switching to C# easier and VB6 which made adopting VB.NET more natural. I picked up VB.NET first, then C#. But as one person said earlier, there are just more jobs for C# than VB. Perhaps partially because Microsoft has been C# centred.

    All in all, I really want a language that isn't dependent on curly braces and semi-colons (bye bye C#), is not white space significant (bye bye Python) and doesn't matter whether I wrap lines or not (bye bye VB). Oh no! I'm doomed!

  • GSquared (11/13/2009)

    Microsoft has it on their "Will be required in a future version", but doesn't have a date on it yet.

    Semi colons are already a requirement for certain idioms in T-SQL.

  • Charles Kincaid (11/16/2009)


    Gianluca Sartori (11/16/2009)


    Which is better between C# and VB.Net? ....Uhmmmm.... Java! 😀

    No, seriously, it's just a personal choice. I like languages that force you to think in a rigid way, like C# (a little) and Java (a lot). ...

    I guess, then, that you would enjoy COBOL and be tickled pink by RPG-400.

    I thought we were talking about powerful object-oriented languages...

    I knew this thread had all the prerequisites to be a religion war field, but I posted my thoughts anyway. I'm sure nobody here can seriously think we can compare Java and RPG.

    The main point I wanted to raise is that developing good software requires a clever design, not clever code. My personal and humble opinion is that I feel more comfortable translating a good desing into good code when I write Java. Do you fit better into VB? Go that way, no blame on you.

    -- Gianluca Sartori

  • >I guess, then, that you would enjoy COBOL and be tickled pink by RPG-400.

    In its particular domain, RPG was (and is) a very powerful programming language. A matching records program in RPG can be done in minutes and be right time whereas other languages (COBOL, C#, VB.NET and probably J***) very much more code is required.

    VB and C#, generally overlap in the areas that they are well matched.

    However:

    Until VS2010, C# cannot call certain late-bound C++ objects, but Vb.NET (with Option Strict OFF) can!

    Unsafe code can be produced in C# for use in device drivers, whereas VB.NET cannot.

  • sjsubscribe (11/16/2009)


    GSquared (11/13/2009)

    Microsoft has it on their "Will be required in a future version", but doesn't have a date on it yet.

    Semi colons are already a requirement for certain idioms in T-SQL.

    Heh... yep. CTE's in a proc sure do require them. I'm hating it because it's making T-SQL look more like Oracle every day. 😛

    --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)

  • Gianluca Sartori (11/17/2009)


    I thought we were talking about powerful object-oriented languages...

    Sorry. "Clink, clink" the sound of a chain being jerked.

    I knew this thread had all the prerequisites to be a religion war field, but I posted my thoughts anyway. I'm sure nobody here can seriously think we can compare Java and RPG.

    Right. But it is exactly that kind of thing that crops up as people compare VB.Net to C#. They still trot out the old VB vs C++ stuff. We get it.

    The main point I wanted to raise is that developing good software requires a clever design, not clever code.

    Right again.

    ATBCharles Kincaid

  • Charles Kincaid (11/18/2009)


    Gianluca Sartori (11/17/2009)

    The main point I wanted to raise is that developing good software requires a clever design, not clever code.

    Right again.

    I would prefer good software enginering practices rather than "clever design".

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Gary Istvan Varga (11/18/2009)


    Charles Kincaid (11/18/2009)


    Gianluca Sartori (11/17/2009)

    The main point I wanted to raise is that developing good software requires a clever design, not clever code.

    Right again.

    I would prefer good software enginering practices rather than "clever design".

    Give it the name you prefer, I'm sure we all know what we're talking about.

    -- Gianluca Sartori

Viewing 15 posts - 151 through 165 (of 176 total)

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