Is C# Better?

  • oh my, just as i thought, we are all going to a religious war at any moment soon.

    peace?

  • Did I mention the word "feature" in my post...? You're taking this too far. I was merely trying to express my opinion/feelings. I respect yours and that of others in this post. Thanks for sharing it.

  • lol 🙂 Peace man.

  • VB.NET and C# are different in front end only. They are using the same code generator, the same optimizer and the same set of .NET libraries. I prefer C# because I was C++ programmer before entering .NET world. Programmers that were working with VB will stay on VB.NET. I’d say that these two languages are equivalent and choice depends on programmer’s taste.

    Split your application into set of subproject and use CAB for collecting total applications. Assign programmers to subproject written in their lovely language and discussion “What is better” would over.

  • [font="Times New Roman"]I've been in programming since 2000 using C/C++, VB5 & 6, Java, then VB .NET and C#. To my knowledge, both VB .NET and C# can achieve same goals since they both built and work on the same base class libraries, however, for a specific functionality, VB .NET would seem easier such as office programming, while C# would seem easier for other tasks.

    Migrating from VB6 would be easier to VB .NET, while migrating from the C/C++/Java line would be easier to C#, syntax wise.[/font]

  • I am just trying to keep this factually correct. There may be people who will read something and unless it is challenged it may be taken as face value. So with this in mind let me make my position clear:

    Not all IL languages provide the same set of language constructs and features.

    Peace to all (including you Thierry) 🙂

    BTW Sorry gediminasb but you are wrong. C# and VB.NET have their own independent compilers written by separate teams at Microsoft. They often produce differing IL for the same high level concepts that are not directly implemented in IL. Go on, try it out for yourself!!!

    Gaz

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

  • I have been developing in VB.NET since .NET 1.0 and years of VB 5/6 before that. Over time I have become a very object oriented programmer, even develop tools in Object Oriented Javascript. Most VB.NET programmers have to work in javascript and other scripting languages...as do c# folks. These scripting languages always look and act much like c#, so switching isn't as big a deal for us vb folks. I can take c# code and modify it to my needs and even write some if necessary. Now, take a c# programmer and ask him to write vb.net code and it will be a little more difficult task. There are many companies out there who will hire a VB.NET programmer to work on C# projects but will not even consider a C# programmer for a VB.NET project. Because of all this, I am very happy with my decision. I am in a position to learn both, making me twice as qualified as a developer who only knows C#

    So, I say to all of you who think VB.NET is going to die and are jumping ship to C# for job opportunities...one of these days all of these vb.net applications will need to be supported, maintained or even ported and who better to do that than vb.net programers?

    And guess who will be in demand then? Think COBOL

  • For the last 10 years I have been programming with VBA/VB and more recently VB.NET. I like VB.NET. I have to admit, I'm not really a low level type programmer. I work with SQL Server databases, and produce nice reports. That's fine with me! (Yes, I am a full time developer!)

    It was agreed late 2008 that we should look to moving major parts of our core functionality to C#. Not sure if I remember the real business reasons for this. No doubt some of it was us just getting caught up in the big C# wave! Sure, an opportuinity to learn and develop in the latest flavour, why ignore that?

    Anyway, the transition has not been too bad. Besides forgetting to put in the odd semi colon or curly bracket, I don't see much difference.

    One area recently I found to be more complex in C# was to do with COM Interops. We already have a class library developed with VB.NET which we reference from a MS Access which works well. Access is only the front end, which we are slowly moving over to a VB.NET GUI. Trying to implement the same with C# was annoying to say the least. Exposing the interface was difficult, and documentation on potential solutions was not the best. Easy solution in VB.NET is to make the class Com Visible and your done. No GUIDS or anything like that.

    I'm continually learning new things with C#, and become more accustomed to working at a lower level than with VB.

    Paul

  • janchrister.nilsson (11/13/2009)


    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 haven't read what others may have recommended on this but I'd recommend not ever using TABs because the size of the tab stops change from product to product and person to person. Have SQL Server automatically convert all TABs to spaces.

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

  • I would like to mention two other languages compiling to MSIL, Boo[/url] and Cobra[/url]

    They are both using Python-style blocks, that is Endless and without curly brackets.

    Boo compiles directly to MSIL, while Cobra compiles to C#.

    Both these languages have very interesting features. Local variables are declared automatically, and assemblys written in other MSIL-languages like VB.NET and C# can be called and called from.

    You get a feeling close to Python or Ruby, but full MSIL speed.

    Example:

    class Point

    def movedBy(dx as int, dy as int) as Point

    ensure result.x == .x+dx and result.y == .y+dy

    return Point(_x+dx, _y+dy)

  • I think it is a question of the right tool for the right job. They are both general programming languages but they each have a slant.

    Neither is better. Just better in different areas. So which is best depends upon what is being attempted.

    Gaz

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

  • 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. 😉

    I agree with this statement. I was first taught basic "way" back in 1984 and have stuck with it ever since. I have learned other languages along the way, including C# and even worked a job where I had to write some C#; but after all of these years of writing in VB, why jump to C#? It does what I need it to.

  • It’s quite irritating when I people attempts to justify their own personal preferences by minor or imaginary reasons. C# vs. VB? Functionally are the same, I spent years programming both and there is nothing significant that you can do in one language but can’t in another. I personally prefer C# because I PERSONALLY like C-derived syntax and IF - END IF vs {} looks like waste, and I do like to see terminators after statements. Is it better then VB? OF COURSE NOT. It’s my PERSONAL PREFERENCE. Curly braces on the same line vs. curly braces on the next line? I PERSONALLY PREFER on the same line, but there is absolutely no advantage to placing it on another line. Who cares about number of lines, unless you are paid by the number? I find it easier to read my style, a lot of programmers feel otherwise. So? Get over it, there is no better or worse, stop trying to prove any advantage of one vs. another, because it’s only YOUR PERSONAL PREFERENCE. If that wasn’t the case we would all be programming the same way and wouldn’t have this conversation.

  • Vyacheslav Mirson (11/13/2009)


    ... Functionally are the same...

    Not totally the same!!! There are different features between the languages.

    On the other hand, syntax is often considered personal preference. Just don't mention it to the academics in that field 😉

    Gaz

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

  • I agree with the general feeling that the differences are mostly aesthetic, and there's nothing major you can do in one language that you can't do in the other. The choice of language is down to personal preference, unless it's dictated by corporate policy.

    I started with BASIC on an old ZX Spectrum, and have used various iterations of VB - VB5, VB6, VBA, VBScript, VB.NET - but I prefer C#. Apart from the fact that I don't want to be forced to load a 600Kb assembly in every application to enable legacy constructs, I think Microsoft made too many compromises with VB.NET to appease VB6 developers.

    For example: the boolean "And"/"Or" operators are not short-circuiting, so you have to remember to use "AndAlso"/"OrElse" instead. Array declarations use the upper-bound of the array, whereas every other language uses the length of the array - it made sense when you could Dim a(1 To 5), but not when Dim a(5) is an array of 6 elements!

    The VB.NET global functions may have helped people moving from VB6, but they can encourage some seriously bad ideas. For example, in C#, the MessageBox class is only available if you reference System.Windows.Forms, which gives you a pretty good idea that it's not designed for ASP.NET applications. In VB.NET, you can just call the global MsgBox function, and the first sign that it's not going to work is usually when the developer deploys their page and kills the server! (And before you say it would never happen, I've seen numerous ASP.NET forum questions asking this very question.)

    XML literals look like a nice feature, but the equivalent C# XLinq declaration isn't particularly bad. I've also seen some ridiculous uses from people who don't understand what's going on behind the scenes - why bother building a multi-line string with concatenation when you can build an XML literal and access the Value property?!

    Lambda methods are much cleaner in C# than VB - (int x, int y) => x + y versus Function(x As Integer, y As Integer) x + y. With type inference, they get even cleaner: DoSomething(i => i + 1); versus DoSomething(Function(i) i + 1).

    Finally, anyone who doesn't like semicolons should also stay away from SQL:

    http://en.wikipedia.org/wiki/SQL#Language_elements

    They're not required yet, but they probably will be soon.

Viewing 15 posts - 31 through 45 (of 176 total)

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