Forum Discussion

svaze74's avatar
svaze74
Contributor
12 years ago

JScript vs Vbscript for web applications

Hi There,



Would it help to use Jscript language for web applications since all client side contains JavaScript and it would be easy then to write javascript functions from TestComplete if any manipulations are needed to be done in future.



I am on the verge of creating a project in TestComplete for web application and therefore want to decide upon the scripting language since it can't be changed later.



Just fyi... I have gone through the smartbear FAQs and links already mentioning that all scripting languages are equally good and can be chosed based on our own level of expertise and comfort with one language over the other.



I was using vbscript earlier for my desktop application automation project and more comfortable with it since I am already aware of the syntax and build in functions.



But it does not matter for me since syntax and build in functions are not that difficult to adopt since there is already lot of material on the web and provided by smartbear.



So my real question is whether Jscript will help in future to write any javascript functions for client side manipulations or writing jqueries etc.



I do have this notion that down the line, learning javascript is required for any developer/tester of web applications.



Any inputs/tips or suggestions are most welcome !!



Thanks,

Shrirang



Thanks in advance,





7 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Shrirang,



    It's strange that nobody replied here yet convincing you for JScript... :)



    > So my real question is whether Jscript will help in future to write any javascript functions for client side manipulations or writing jqueries etc.



    I'm really doubting that you will ever need this... And nobody for the past several years mentioned here that he did things like those. In the worst case, you should be able to implement some tricky approach via script extension using JScript and use this script extension from within your VBScript/DelphiScript project.



    For me personally, the only potential benefit of JScript is its support for object-oriented programming. Hovewer, this also has its reverse side of the coin: you will have considerable problems if you ever need to port your fine object-oriented JScript code where you used function prototypes and other JScript-oriented specifics to the language that does not support this stuff (e.g. VBScript). Definitely, this is not a problem if you work for the same employer with the same project for years, but if there is a chance that you will participate in different projects, I would recommend to use as more built-in TestComplete's functions  and as less language-specific features as possible to ease existing code reuse in the future.
  • Thanks Alex for the inputs. I just wanted to make sure that there's no major road block in future in case such situation arises(just in case)



    Anyway, I did opted out for Jscript. I am liking it so far, no wonders it has some nice pluses which come in handy.



    I have ported some of my vbscript code to Jscript code which was related to working with excel. Yes I have used build-in functions making sure that they are easily adopted by any language. And it worked just fine :-).



  • I would suggest JScript also because it is so similar to javaScript and there are TONS of resources for javaScript. Some references you may have already or will likely want to bookmark...



    1. Mozilla Developer Network (MDN) is a great reference for quick look ups/reference material and also guides. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide



    2. If you are trying to write something and get stuck or have questions, obviously you can google for answers. I find a lot (most?) of my better answers on Stack Overflow. http://stackoverflow.com/



    3. After you get some code written, send it through JSHint to find the typos and low hanging fruit. http://www.jshint.com/



    4. Once the code is "well written", then you send it through JSBeautifier to make it easier to read. There are some customizable settings to suit most preferences. http://jsbeautifier.org/
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Shrirang, another big plus with JScript, especially for Web Testing, is that you can integrate JSON support directly into your project simply by including a JSON library such as json2.js.



    The big advantage of this is as JSON is just a subset of JScript, the parsing to and from JSON simply just works whereas with other scripting languages it would not be so easy.



    Regards,

    Phil Baird
  • Thanks so much to all of you community experts and developers.



    I am feeling satisfied and hoping for the best.



    Thanks in advance.



    Meanwhile I would also like to get some inputs from you guys about another issue I have raised on this thread.



    http://smartbear.com/forums/f75/t91821/how-do-we-start-debugging-of-web-appliaction-us/



    Just in case, if we have any workaround to capture errors or exceptions happening in running client javascript code using IE/FF/Chrome developer tools?



    Thanks in advance. :)

  • Thanks Rajesh for the post.



    Good comparative study given in the post.



    End of the day one has to bargain some against getting some. :)



    And one has to live with it.