Results 1 to 13 of 13
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434

    Questions about VB.Net and C#

    Hey guys and gals, just wanted a wee bit of advice about VB.Net and C#

    Basically I'm going to be taking over someone's development work over the next few weeks and have a guess at what it's all written in...
    My manager seems to think I'll have no trouble with VB.Net because I know VBA - is this a fair enough assumption?
    I know there are some big differences, but are the syntax/functions etc pretty much the same?

    Then along comes some C# stuff - I've had a google or three at some examples and it seems to be rediculously similar syntax to JavaScript - fair assumption?

    Not sure what to ask really, hmm...
    If you have any links you reckon I'd benefit from reading then please let me know!

    Kind regards,
    George
    George
    Home | Blog

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    My manager seems to think I'll have no trouble with VB.Net because I know VBA - is this a fair enough assumption?
    Kind of. Actually - it is you - yes no problem Remember you are going properly OO now. The syntax is very similar but the underlying concepts are much more sophisticated.

    Quote Originally Posted by georgev
    Then along comes some C# stuff - I've had a google or three at some examples and it seems to be rediculously similar syntax to JavaScript - fair assumption?
    I believe the guy that created JAVA was recruited by MS to create the "perfect" language and C# is what he came up with. More similar to JAVA than javascript I understand (though I don't know JAVA). I'll see if I can dig up a nice article I read....
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Oops. Guess I misremembered a few things.

    Anyway - I like this article. It admits up front it is subjective. You can google for millions of other VB Vs C# articles. I can't write C#, though I can translate reasonably well to VB (on the To Do list) so I am not a C# puritan. If you can, I would start out programming in C#. Higher demand and higher pay -> Happy George.
    http://www.codeproject.com/dotnet/CS...sp?msg=2096633
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Thanks for the insight Poots (and the compliements !)
    Oh and congrats on breaking the big five-oh-oh-oh!

    I actually read that article earlier, not exactly what I'd call objective, but hey!
    I'm probably going to request a formal training course on C# now - especially if I have to support this crud at a later date...

    I've done a lot of theory about OOP and have written all kindsa carp back in school (we did assembly language and created a text based DOS game which was pretty much OO).

    So yeah, thanks!
    George
    Home | Blog

  5. #5
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    Quote Originally Posted by georgev
    Then along comes some C# stuff - I've had a google or three at some examples and it seems to be rediculously similar syntax to JavaScript - fair assumption?
    I haven't used Java since a few releases, but I'm pretty familiar with it. The same is true for Javascript. I haven't done nearly as much with C#. Javascript is more properly known as ECMAScript, and aside from syntactic similarities, is not based on Java and is completely incompatible with Java. The Netscape folks called it Javascript for marketing reasons and I never did understand why Sun didn't sue them. Actionscript, which is in Flash, is also based on ECMAScript. JScript is MS's implementation of Javascript.

    Synopsis: Javascript was designed for simple programming. It's become pretty big, I believe there's some startup named Google that has a bunch of stuff that's endlessly in beta. Java is a "serious" programming language that brought 10 year old OOP ideas into vogue. It's designed to always do the right thing and be highly consistent so you have to write endless error checks and type conversions, though I hear they've fixed this somewhat. C# was set up explicitly to destroy Java so it has lots of nice things for developers and tries to give you what you want.

    Syntax: yes, they're all based on C which inherited it from earlier languages. There are little differences. Javascript has the simplest, Java has the most uniform, C# is like Java but more flexible.

    Imperative control structures: all have the usual for, while, foreach, try/catch, if.

    Subroutines: You can pass a subroutine as a value in each language. C# has delegates which I find a little weird. None of them support coroutines, to my knowledge.

    Simple data types: all have various integers, floats, a boolean, strings. But Javascript ignores all that, so a string that happens to say 15 behaves like the number. The other languages make you do this manually.

    Declaring variables: Javascript doesn't require that you declare variables.
    I don't think any of them allow global variables; you have to assign a variable to a class (this is an OOP concept).

    Object orientation: They all do it. Javascript has supported prototypes (a different way of doing OOP than Java and C#) as early as Netscape Navigator 2.

    Complex data types: Mostly done through objects. Java and C# both have a root Object class that everything is a "subclass" of. Java goes with the "everything is an object" philosophy as much as possible. C# has special structs for user-defined types. Both have arrays; C# has more features for their arrays. Java has a very extensive and mature library for working with trees and maps and other advanced objects. C# generally has better primitives, e.g. multidimensional arrays. Javascript used to be very primitive in this regard but with modern browsers depending on Javascript I'll bet that's changed.

    Multithreading: Java's is based on monitors and mutexes. Javascript doesn't directly allow multithreading, to my knowledge. I haven't used C# to do any multithreading.

    Multitasking: I'm quite sure none of them support fork, which is a pity. Unix guys will harrumph about this.

    Supporting libraries: All of them have massive APIs that virtually implement an operating system.

    Memory management: they all use garbage collection, and all of them use a pretty sophisiticated system.

    Mode of execution: Java semi-compiles to bytecode which is run by the infamous Java Virtual Machine. C# compiles to bytecode that is run by the Common Language Runtime. Javascript is also compiled, but the browser generally does it behind the scenes.

    I/O: Javascript generally runs in a browser or flash plugin or something. Nowadays you can send AJAX requests, so the sandbox you play in is a little bit bigger. If you don't mind warning dialogs and paying ridiculous fees to certificate authorities, you can get local file access. Java and C# both have excellent IO systems that are highly adaptive and customizable.

    GUI: .NET's WinForms is uninspired, but I guess it works. Java has gone through several iterations trying to find the ultimate UI that works on anything, and it still generally sucks, but see Eclipse and jEdit for counterexamples. Javascript sticks you with the usual horrible browser UI.

    Database: Java has JDBC. The latest revisions of C# supposedly allow SQL directly in the source code. With Javascript, you're stuck sending AJAX requests back to the server.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Wow,
    Not much to say other than a very sincere thank you for taking time out to write such an impressive, useful and informative reply.
    Thank you
    George
    Home | Blog

  7. #7
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    Quote Originally Posted by georgev
    Thank you
    No problem.

    <3 Engaged!


    Congrats!

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Quote Originally Posted by georgev

    My manager seems to think I'll have no trouble with VB.Net because I know VBA - is this a fair enough assumption?
    Absolutely not.

    When you begin making the jump from VBA to .NET, step one is to throw everything you thought you knew about proper programming out the window. The syntax will be familiar enough that once you understand the underlying concepts, implementing them will be fairly simple. Making the jump from what is effectively procedural code to a true OO model can be a challenge.

    I would suggest grabbing one of the free versions of studio and doing a few sample projects in .NET to get an overall feel for how things get done.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    I had the meeting today for the first stage of handover of one of the .NET modules. I've studied OO programming in the past and built a couple of tiny bits and bobs but nothing major - so the theory is sorta there.

    I'll get a better look at the code over the next week or so - from what I've seen already I can follow most of it - but I'd be damned if I could write it all from scratch The good news is that I don't have to do much of that - just support it in a few months time. I'm going to talk to my new manager about a VB.NET course and see where that leads.

    I'll see if work will lend me a laptop with VS (or even my own copy ) so I can have a play with some samples at home.
    George
    Home | Blog

  10. #10
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by georgev
    I'll see if work will lend me a laptop with VS (or even my own copy ) so I can have a play with some samples at home.
    Good Luck, but FYI VBA and VB.NET are completely different stuff in underlying technology.I would suggest you that the transition could be easy but if you go by OOPs that would be far better.
    Compared to VB.net ,C# gives you a good coding standards.
    I was basically a VB.net guy but for the last 2 year I just worked in C#, and trust me I am loving it....
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  11. #11
    Join Date
    Jun 2007
    Location
    Under a desk hiding from SSIS
    Posts
    25

    Wink Poots I think is wrong perhaps....

    Quote Originally Posted by pootle flump
    I believe the guy that created JAVA was recruited by MS to create the "perfect" language and C# is what he came up with. More similar to JAVA than javascript I understand (though I don't know JAVA). I'll see if I can dig up a nice article I read....
    It was the guy who wrote Delphi - Anders H. - i forget how to spell his surname, from Borland. The greatest OO language implementation ever - blows VB away.

    Regards,

  12. #12
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    That would be Anders Hejlsberg. Everything he has created has left me awestruck, and he's created a lot of stuff!

    -PatP

  13. #13
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Shaun.McGuile
    It was the guy who wrote Delphi - Anders H. - i forget how to spell his surname, from Borland. The greatest OO language implementation ever - blows VB away.
    I will freely confess that accuracy suffered for the sake of posting reasonably early, always intending to follow up with a link.

    OOP (and client side languages in particular, indeed many would argue programming languages in general) are really not my forte. I think Sc00b's post is a superb summary though I confess I am not in a position to judge it on anything but on the most superficial of levels.

    Article(s) I have read recently that piqued my interest in OO techniques in case anyone is interested:
    http://www.tonymarston.net/php-mysql/good-bad-oop.html

    I think this guy's summary (it is only an article and so can only be judged on that basis - I know there are more thorough examinations of the discipline) on relational db design is one of the best I have read on the web. Kudos to Rudy for pointing out his www.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •