Advantages of C# over Visual Basic (.Net)

Discussion in 'OT Technology' started by Runescaper, May 24, 2006.

  1. Runescaper

    Runescaper Guest

    People I talk to generally seem to prefer C# over Visual Basic. What exactly would make it a better language? If I understand correctly, both VB and C# are compiled into the same language (CLR or whatever). So if they end up as the same language, how could one be better than the other? :dunno:
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    That's a good question. What it essentially comes down to is that BASIC and C used to be completely separate language types (and still are, except for the VS.NET suite), and as such they have been refined and adapted to provide different types of built-in functionalities to the programmer. C-based languages are more flexible and powerful, but in order to use the more advanced functions in the Standard Template Library you have to specifically include each library file that you want. BASIC-based languages are easier to pick up and start using because their syntax uses more words and fewer symbols, and their compilers are designed to automatically include libraries that your programs need, but the programmer has less, if any, control over whether they use Joe's or Bob's library file. Furthermore, if the programmer includes their own customized library file, they have to be very careful not to use any built-in BASIC commands that require the standard library or else they'll defeat the point of having written the custom library in the first place.

    That tends to make BASIC languages better for quick-and-dirty programs, and C languages better for larger, more complicated, and ultimately production-worthy programs. VB.NET and C# both pre-compile into the same pseudocode and both draw upon standardized .NET subroutines, so the advantage of one language over the other is pretty much reduced to the programmer's preference for ease-of-use vs. customizability.

    Unfortunately, in order to give VB.NET respectability as part of the VS.NET suite (and perhaps to even get the language to compile into CLR), Microsoft removed a lot of the simplicity of the language and changed so many keywords and whatnot that it's barely the same language anymore. C#, on the other hand, does a great job of making C++ just enough easier that it's worth learning the differences between the two. That's why C# is the favored .NET language, and that's why many pre-.NET VB programmers (such as myself) still prefer to use VB6 even though it's eight years old now.
     
  3. Runescaper

    Runescaper Guest

    :cool:

    That was a good explanation.

    Thanks :bigthumb:
     
  4. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    You're welcome. We'll see if it withstands the rigors of the late-night crowd.
     
  5. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    that was actually a really shitty explination. One that demonstrates he has no working knoweledge of VB, VB.Net, C++, or C#.

    Microsoft designed .Net to be interoperable. Writing an application in VB.Net is no worse than doing so in C#. And it is no less production-worthy.
     
  6. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,477
    Likes Received:
    569
    Location:
    Your mother.
    it really depends on your pref.

    i hate vb with a passion, i hate the structure of it. C# is like C++ so it works well for me.

    There are minor differences, like you can't use unsafe in VB.NET but can in C#


    it is just what you like to program in basically.
     
  7. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    The major difference would be that the kind of people who can create a large system that is designed to work well and be maintainable would prefer to work in C#. .NET even transaltes between the two languages, doesn't it? You can convert source for a C# class to VB, and vice versa?
     
  8. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    it does, but I don't have any experience doing so with larger projects. I imagine it comes with some severe limitations -- considering each lanuage is quite different.
     
  9. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,477
    Likes Received:
    569
    Location:
    Your mother.
    You need a third party tool to translate the code directly. There is nothing built in to do so.
     
  10. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    You dumbass, that's what I said. The difference between VB.NET and C#.NET is almost entirely aesthetic. Try again.

    "That tends to make BASIC languages better for quick-and-dirty programs, and C languages better for larger, more complicated, and ultimately production-worthy programs. VB.NET and C# both pre-compile into the same pseudocode and both draw upon standardized .NET subroutines, so the advantage of one language over the other is pretty much reduced to the programmer's preference for ease-of-use vs. customizability."

    You are accumulating more and more posts that demonstrate two things:

    1. You don't read my posts thoroughly enough before you flame me for them.
    2. You don't actually provide any useful explanations of why what I said is supposedly wrong. Believe it or not, "because you said so" isn't a valid reason.
     
  11. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    1. My penis is hairy almost the entire way up the shaft on the bottom.
    2. Half way up the sides.
    3. A third of the way up the top.
    4. Sometimes I shave it.
    5. It grows back.

    6. Hairy Cock Support Group?
     
  12. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,477
    Likes Received:
    569
    Location:
    Your mother.
    +1?
     
  13. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Talk about your pain, brother.
     
  14. RyanL

    RyanL OT Supporter

    Joined:
    Nov 30, 2004
    Messages:
    4,584
    Likes Received:
    0
    Location:
    St. Paul, MN
    :wtfpost:
     
  15. Frequency

    Frequency New Member

    Joined:
    Dec 30, 2004
    Messages:
    7,504
    Likes Received:
    0
    Location:
    PA
    +3(horrible knife accident so i have 2 now :wtc: )
     
  16. Runescaper

    Runescaper Guest

    :hsugh:

    You do realize you're in the "Computers and Programming" forum, don't you?
     
  17. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    That means different things to different people, it would seem.
     
  18. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Yes, so let me explain myself since you seem to have missed the point:

    If they're going to snipe back and forth in threads all the time when it has fuck all to do with technology... I might as well talk about my hairy cock. I got other weird body parts too, so this theme should last a while.

    Like for instance, I have an external eurethra half way down my penos. It runs just under the skin and is purple. Then it winds in a circle and enters the penos.
     
  19. Runescaper

    Runescaper Guest

    Oh, believe me, I know what the point of this thread is. I'm not so sure about a few other people though.
     
  20. antiyou

    antiyou OT Supporter

    Joined:
    Jul 13, 2005
    Messages:
    25,295
    Likes Received:
    0
    Location:
    in ur base
    lol @ offtopic in thread...

    I use c c++ and c# and java. I am not a fan of VB I know that you can accomplish a lot of the same things using the tool as you can with c# however, being a c/c++ developer first and foremost I feel that c# is an easy transition to make to a higher level language. So I learned c# and java around the same time but mainly the syntax made the difference to me. The highlevel use of a lot of key words in VB somewhat over simplified the laguage and made it less apealing, but both VB and C# afford the oportunity to create complex and useful applications in a short period of time using many standard libraries. For instance I once wrote an app using mfc and C++ then re wrote the same application in half the time using c#.
     
  21. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    You contradict yourself.

    There you state that C-based languages are better.


    This proves several things. One of them is that you have no clue what you're talking about.

    First of all, VB does not automatically include declarations, as neccessary. You absolutely must include them yourself... That's what goes into the Global Declarations section in any module or before the code in a form. All API references must be defined, here.

    As a direct result of the *requirement* to define API calls in Global Declarations, you have 100% TOTAL control over whether you use Joe's or Bob's API, DLL, Object, etc.

    I assume by you saying "not to use built-in basic commands" that you really mean Reserved keywords. I'll let that slide. However, this is *not* specific to VB. EVERY language has a set of reserved keywords and functions that you cannot reuse. I can't have a variable in C that's called int... That's reserved. Likewise, I can't declare my own function register.

    Now here you say that VB is good for quick-and-dirty, which directly implies that they are of a lesser quality. You say it's only good for smoke-and-mirror applications. Heh. Whatever. You then take it one step further and say that C# is better for real-world production applications. Your reasoning? Well, the only statement you offer as explination is that you find it "more complicated". Again showing your inexperience.

    All this shows me is that you are not able to grasp concepts such as Object Oriented Programming/Design (OOP/OOD).




    Now with all of this effort I've put out, I have demonstrated you don't know what you're talking about. You complain when I say this, but here's more evidence. Now when you say "because I say so" isn't good enough, I contest that it IS good enough. Simply because when I put all this effort to demonstrate my point, it doesn't change the fact that I was right in the first place.
     
  22. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Actually, your explanation helped a lot. First of all, whether or not you are right has little to do with whether other users accept that you are right. The explanation shows whether or not you arrived at being right or wrong purely by accident or not. Explaining yourself eliminates (or reduces, anyway) the possibility that you are the proverbial monkey in front of a typewriter.

    Now I know how you interpreted what I said in my post, and I can tell that your interpretation is rooted in the idea that whatever I'm saying, it must be wrong because you've decided that it's impossible for me to know what I'm talking about.



    We both agree that what the thread-starter said about all .NET languages compiling to CLR is correct. The implication of this is that .NET languages aren't really separate languages at all; if anything, they are more like different dialects of CLR. Therefore, the old division between BASIC and C doesn't apply beyond the development interface that the programmer actually types their code into; .NET just mashes it into the same CLR gruel either way. I only included the BASIC vs. C spiel as background information for how the differences between the two language groups arose in the first place.

    Yes, that is what I meant. I debated using the proper term, but I decided not to because I don't like to use technical lingo when I don't know how familiar the person I'm talking to is with that terminology. So I described "reserved keywords" instead, and apparently I did alright because you knew what I was talking about.

    VB has many more (beginner-level) reserved keywords in its syntax than C does. String, for example. In C, I get to choose which STL library I want to use to provide string functionality to my program, or I could use the library I wrote myself. In VB, a String is a String, I don't have a choice what library provides that functionality because Microsoft hard-coded that into the VB compiler. I can still create a String-like class and include it in my code, but (as you pointed out with your INT example) I can't call it a String.

    Once again, since .NET languages only preserve the appearance of being different, the distinction between C's flexibility and BASIC's ease-of-use is blurred; the only thing that changes if I instantiate a String variable in .NET is that C will let me include whichever String library I want and VB will use Microsoft's default library.

    What I was referring to with the "Joe's vs. Bob's library" example was the kind of hard-coded inclusion used for (as noted above) the String variable in VB. You can't choose what kind of String the VB compiler wants to use in your code. For objects that are not hard-coded into the compiler, then yes, you obviously get to choose which flavor you want to manually include in your project.

    VB does infer (some) declarations automatically. You can let VB figure out what all of your variable types are, or you can be proactive and invoke Option Explicit to make VB force you to declare your variables yourself. This is always a good idea for efficiency's sake, but it is a shining example of how VB lets the programmer be just about as quick and dirty as they want to be.

    All non-standard references to functions in precompiled libraries do have to be declared manually in VB6; in VB.NET many of those declarations and API calls have been rolled into .NET's framework so all that's needed is to invoke the appropriate subroutine of the appropriate object -- you don't have to dig to find out which DLL provides the functionality you need.

    I have a degree in software engineering, Jolly. I'll even post a picture of the diploma if it would help you accept the idea. In order to get that degree, I had to take almost as many programming classes as the CS majors did, from a basic introduction (which I didn't need because I took a C++ intro in high school) up to OS design, all of which used C++ as their implementation language. I also had to take enough design and project management/controls courses on top of programming that I was pulling more than a full load for 4 of my 9 semesters. I absolutely do understand OOD/OOP, I had object-oriented design and implementation drilled into my head every day for five years.
     
  23. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,477
    Likes Received:
    569
    Location:
    Your mother.
  24. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Damn straight. I wish he'd stop instigating all these bitch-fights already.
     
  25. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    actually, I correct your errors. You start the bitch fights. :mamoru:
     

Share This Page