locked
May Javascript coding be less painfull? RRS feed

  • Question

  • I am new to VS, LightSwitch and to Javascript and I am finding client side Javascript coding very hard. One weak is intellisense but I know LS develpment team is working on it so we can only wait. Second is strict typing: I tried to use "use strict" but nothing changes even though in internal LS code it is used. This is very cumbersome: I forget () at the end of the function name and I have to wait runtime to see that something is wrong and work with immagination. I am performing too much times the circle code-run-imagine what is wrong-come to debug-stop it-place breakpoint-here and there-F5 -and so on. 
    Possible that VS can not help more?
    Thanks

    • Edited by Morenight Tuesday, September 10, 2013 9:06 PM
    Tuesday, September 10, 2013 9:05 PM

All replies

  • I agree.  I'm not sure what's new in 2013 with regards to Javascript, but can anyone confirm if it uses TypeScript, or if there is some way to natively use TypeScript (without creating .ts files and having them converted to .js)?

    Free Visual Studio LightSwitch extensions: Elyl's Extensions

    Wednesday, September 11, 2013 8:42 AM
  • One more thing: when debugging, I see something wrong but VS let me change it only if I close "module name in execution.js [dynamic]" (translated). But if I close it, debug session stops. I have to fix the bug and start debugging again. I think I miss something, it is not possible that VS make me waste so much time above all if compared to Microsoft Access (rarely debug session has to be restarted). Is there some setting, some key, something... ?
    Thanks
    • Edited by Morenight Wednesday, September 11, 2013 1:40 PM
    Wednesday, September 11, 2013 1:39 PM
  • Hi Morenight

    Thanks for your feedback,

    If we want to use JavaScript for LightSwitch HTML Client Screens, This sample provides code snippets for a number of common LightSwitch coding tasks, a detailed explanation of where and how to use the code,

    # JavaScript for LightSwitch HTML Client Screens

    You can also learn something about JavaScript Intellisense for LightSwitch in Visual Studio 2013 Preview and RC and LightSwitch in Visual Studio 2012 Update 3,

    Regards


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 17, 2013 2:44 AM
  • Coming from an Object Oriented programming world and attempting to understand JavaScript is very difficult. May I recommend this ebook to possibly help to better understand JS development. This is an easy book to read and will help you gain a better understanding of JS.

    The second thing that I would recommend is to watch this video which highlights a documentation tool I created for LS msls.js script into a MS Compiled Help document.  The more and more I dig into the msls.js script the more I appreciate this CHM file documentation as it allows me to explore the dynamic type definitions within the script. There are many places within this CHM document that you are linked to external JS functionality which further helps to cement the required knowledge one seeks to gain when learning JS.

    As for the lack of Type Script within LS, I am working on providing a VSIX extension called TypeSwitch that should with any luck dynamically generate TypeScript directly from your LS Generated JS artifacts which leverages the same JS parser that I built to create the CHM documentation. 

    I should have a TypeSwitch beta program that will open up within a few weeks and so if anyone is interested please let me know through this link.

    After the beta program is complete, TypeSwitch will be available for a small fee but it will also be integrated and made available within a second product I am creating called CompositionJS (CJS). This product will provide some very cool extensibility on top of the LS HTML Client that will push LS into a BootStrap based solution.  If you are interested in signing up for that beta program please let me know here.

    Hopefully you can see that there is help in the form of great technical resources available to grow your JS skills and that there will be more support on its way.

    Cheers

    John


    Johnny Larue, http://www.softlandingcanada.com

    Tuesday, September 17, 2013 2:52 PM
  • Hi Xu,

    thank you for your suggestions. I saw that articles and are very very usefull but I was focusing on Ide/compiler (VS itself). Those articles shows where to go, and that is fundamental, but once I know where to go ... what about the car? I find VS car very unconfortable in this way.
    Thanks again
    Thursday, September 19, 2013 3:14 PM
  • Thank you john,

    I took a look to the sample of the book, and it seems simple. I will take in consideration. The same for the video.
    At present I have suspended LS development, I wait for VS2013 RTM to see if something regarding development assistance has (and how much) improved and TypeSwitch would go in that direction.
    I find that LS lets to save a lot of time in ui design but when I have to go behind the scenes it make me loose the time I gained (and I repeat: in my opinion this is not due to LS but to VS; surely in the future LS will be a very valuable tool)
    Thank again
    Thursday, September 19, 2013 3:40 PM