Compare Visual Basic .Net with JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loopyloulilly
    New Member
    • Apr 2007
    • 1

    Compare Visual Basic .Net with JavaScript

    Hi,

    Can somebody tell me the difference between vb.net and JavaScript?

    Thanks.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    You have posted this question in the Jobs forum.

    I am moving it to the Software Development forum.

    ADMIN

    Comment

    • LacrosseB0ss
      New Member
      • Oct 2006
      • 112

      #3
      Originally posted by loopyloulilly
      Hi,

      Can somebody tell me the difference between vb.net and JavaScript?

      Thanks.

      one of the biggest differences is that Javascript is run on the page whereas VB code (in an asp page for example) is run on the server.

      Take a site that verifies user input (phone number for example). When a button is clicked, Javascript will check the phone number and if it's ok, it will send the info to the server for processing. If it's incorrect, it'll pop a message saying "Hey doofus, enter your correct number!" and nothing else.

      The VB part will send all info to the server when the button is clicked and will either return a success or return "Hey doofus ...".

      So which is better? As with everything, depends on the situation. When a page posts back (comes back from the server) you will usually lose data that was entered. If you have a page where TONS of information is being input and the user gets 1 field wrong, they're screwed and they hate you if you used VB. If you used JS, they hate themselves for having too fast fingers.

      This is just a very very specific example. It all depends on what you're doing. I usually prefer VB b/c that's what I'm comfortable with and my users can suck it up :D. Best advice, get to know both. Then you'll figure out which is the best one in whatever situation and when you come across somewhere that needs one or the other, you can code it no problem.

      Hope this helps
      -LB

      Comment

      • Aflj
        New Member
        • May 2007
        • 6

        #4
        Originally posted by LacrosseBoss
        one of the biggest differences is that Javascript is run on the page whereas VB code (in an asp page for example) is run on the server.
        It's a long time since I last touched MS-specific technologies, but if I correctly remember, you can use VBScript (which is sort of a VB) to script web pages, if you (or your users) are using only IE for browsing. Also, you should be able to use JS for server-side scripting.

        Even more, using MS's client-side scripting technologies, you should be able to build apps scripted in JS similar to those you can do in VB, by scripting similar UI components.

        IMO the big difference, when it comes to scripting for the browser, is portability. Using ECMA-626 (or is it 262?) conformant Javascript you can be pretty much sure that all major browsers will properly interpret your scripts. Using VB for the same purpose you're stuck with IE.

        Server side the story is to some extent similar, but actually worse. I don't know of any other server (than IIS) supporting either JS or VB for server-side scripting. Usually, you script srever-side in perl, php, ruby or other languages which are better suited and supported for server-side scripting.

        Strictly about the languages speaking, not about how and for what you can use them for, I think Javascript is a nicer language to use, extremely powerful for small stuff - as you usually do inside an HTML page. VB has a more verbose syntax, and a less powerful grammar.

        What do you want to use the language(s) for? That should determine what you need to learn. There is no such thing as learning one language for one context once, and then using it for the rest of your life.

        Comment

        • LacrosseB0ss
          New Member
          • Oct 2006
          • 112

          #5
          Originally posted by Aflj
          Strictly about the languages speaking, not about how and for what you can use them for, I think Javascript is a nicer language to use, extremely powerful for small stuff - as you usually do inside an HTML page. VB has a more verbose syntax, and a less powerful grammar.

          What do you want to use the language(s) for? That should determine what you need to learn. There is no such thing as learning one language for one context once, and then using it for the rest of your life.
          Personally, I prefer VB. As I mentioned before, it's what I'm used to but as well, it hides code better. For example, if you use FF or IE for browsing, they both have an option View--> Source. This shows all source code for a page.

          If you have coded in JS, all the scripts and such appear here (unless you've done page source = script.js). If you use VB, there is no way code shows up. For personal web sites, it's not that big a deal. You may not care if someone steals your code. In fact, you may be proud someone wanted to. However, if you're developing a business web site using in house methods or sensitive code, you may want this hidden.

          As mentioned by myself and Aflj, no language is perfect and it will depend on what you're doing which one will work best.

          Hope this helps
          - LB

          Comment

          Working...