Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. A one-day experience with TypeScript

A one-day experience with TypeScript

Scheduled Pinned Locked Moved The Lounge
javascriptcsharpvisual-studiohelpjava
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Antonino Porcino
    wrote on last edited by
    #1

    After reading so much about it, I decided to give a try to TypeScript. I needed to write a large single page webapp, so instead of writing it in C# and compiling to JavaScript (with the Saltarelle compiler), I opted to give a try to TypeScript. After all, everybody was describing an experience similar to C# or Java, so I thought, why not? I struggled one day converting an existing C# application making it work in Typescript. At the end of the day I just gave up, realizing it's not what I was looking for (that is, a language that hides all the JavaScript annoyances). What made me renounce:

    • Intellisense sometimes slows down the Visual Studio editor, some other times stops working completely
    • Syntax highlight is very basic, e.g. there is no special color for type names, or other semantic elements
    • I really hate the ": type" syntax, it made me remember of old pascal days. You can get used to it, but you keep asking WHY??
    • Autocompletion works only with the tab or enter key (and not with other symbols like (,= as in C#)
    • class implementation lacks all the important features: operator overloads, extension methods and all the rest
    • I found that comparing two equal "Date" variables with "==" (and not "===") results in false! Ok, it's due to JavaScript but that's horrible.
    • Sometimes the compiler exits with an error without telling you what the error is, just "tsc.exe exit code 1".
    • When generating a single global .js file, the compiler doesn't handle class inheritance (what class comes first), so you have to stick with multiple file only.
    • Within a class, you have always to refer to "this", it's not optional like in C#. Sometimes it's annoying.
    • Found myself often going to CodePlex and discovering it's a known issue

    Of course there are good points too:

    • debug directly within Visual Studio (break points and all the rest)
    • has import types for many javascript libraries (DefinitelyTyped)
    • Compared to C#, the dynamic syntax is much nicer for objects (no "new" keyword) and arrays
    • I like how interfaces are handled and also the "optional" members (though I dislike the "name?" syntax)

    Overall, I would strongly suggest TypeScript only to existing JavaScript users. Developers coming from the Java/C# world are more likely to be disappointed, for them the "Dart" language is more appropriate (but sadly there is no Visual Studio plugin yet). If you have tried TypeScript, what was your experience?

    R N 2 Replies Last reply
    0
    • A Antonino Porcino

      After reading so much about it, I decided to give a try to TypeScript. I needed to write a large single page webapp, so instead of writing it in C# and compiling to JavaScript (with the Saltarelle compiler), I opted to give a try to TypeScript. After all, everybody was describing an experience similar to C# or Java, so I thought, why not? I struggled one day converting an existing C# application making it work in Typescript. At the end of the day I just gave up, realizing it's not what I was looking for (that is, a language that hides all the JavaScript annoyances). What made me renounce:

      • Intellisense sometimes slows down the Visual Studio editor, some other times stops working completely
      • Syntax highlight is very basic, e.g. there is no special color for type names, or other semantic elements
      • I really hate the ": type" syntax, it made me remember of old pascal days. You can get used to it, but you keep asking WHY??
      • Autocompletion works only with the tab or enter key (and not with other symbols like (,= as in C#)
      • class implementation lacks all the important features: operator overloads, extension methods and all the rest
      • I found that comparing two equal "Date" variables with "==" (and not "===") results in false! Ok, it's due to JavaScript but that's horrible.
      • Sometimes the compiler exits with an error without telling you what the error is, just "tsc.exe exit code 1".
      • When generating a single global .js file, the compiler doesn't handle class inheritance (what class comes first), so you have to stick with multiple file only.
      • Within a class, you have always to refer to "this", it's not optional like in C#. Sometimes it's annoying.
      • Found myself often going to CodePlex and discovering it's a known issue

      Of course there are good points too:

      • debug directly within Visual Studio (break points and all the rest)
      • has import types for many javascript libraries (DefinitelyTyped)
      • Compared to C#, the dynamic syntax is much nicer for objects (no "new" keyword) and arrays
      • I like how interfaces are handled and also the "optional" members (though I dislike the "name?" syntax)

      Overall, I would strongly suggest TypeScript only to existing JavaScript users. Developers coming from the Java/C# world are more likely to be disappointed, for them the "Dart" language is more appropriate (but sadly there is no Visual Studio plugin yet). If you have tried TypeScript, what was your experience?

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Thanks for sharing. I am no TypeScript user, but it is great to have such kind of posts back in the Lounge.

      ~RaGE();

      I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Entropy isn't what it used to.

      1 Reply Last reply
      0
      • A Antonino Porcino

        After reading so much about it, I decided to give a try to TypeScript. I needed to write a large single page webapp, so instead of writing it in C# and compiling to JavaScript (with the Saltarelle compiler), I opted to give a try to TypeScript. After all, everybody was describing an experience similar to C# or Java, so I thought, why not? I struggled one day converting an existing C# application making it work in Typescript. At the end of the day I just gave up, realizing it's not what I was looking for (that is, a language that hides all the JavaScript annoyances). What made me renounce:

        • Intellisense sometimes slows down the Visual Studio editor, some other times stops working completely
        • Syntax highlight is very basic, e.g. there is no special color for type names, or other semantic elements
        • I really hate the ": type" syntax, it made me remember of old pascal days. You can get used to it, but you keep asking WHY??
        • Autocompletion works only with the tab or enter key (and not with other symbols like (,= as in C#)
        • class implementation lacks all the important features: operator overloads, extension methods and all the rest
        • I found that comparing two equal "Date" variables with "==" (and not "===") results in false! Ok, it's due to JavaScript but that's horrible.
        • Sometimes the compiler exits with an error without telling you what the error is, just "tsc.exe exit code 1".
        • When generating a single global .js file, the compiler doesn't handle class inheritance (what class comes first), so you have to stick with multiple file only.
        • Within a class, you have always to refer to "this", it's not optional like in C#. Sometimes it's annoying.
        • Found myself often going to CodePlex and discovering it's a known issue

        Of course there are good points too:

        • debug directly within Visual Studio (break points and all the rest)
        • has import types for many javascript libraries (DefinitelyTyped)
        • Compared to C#, the dynamic syntax is much nicer for objects (no "new" keyword) and arrays
        • I like how interfaces are handled and also the "optional" members (though I dislike the "name?" syntax)

        Overall, I would strongly suggest TypeScript only to existing JavaScript users. Developers coming from the Java/C# world are more likely to be disappointed, for them the "Dart" language is more appropriate (but sadly there is no Visual Studio plugin yet). If you have tried TypeScript, what was your experience?

        N Offline
        N Offline
        newton saber
        wrote on last edited by
        #3

        Thanks for taking the time to provide a great summary of your experience. I have not tried TypeScript for some of the reasons you mention -- I am a C# dev and have been working with JavaScript (jQuery and now Angular) for the past 2 years or so. About 2 months ago I went out to the typescript site and checked it out and couldn't find enough reason, just from reading the docs to learn yet another syntax and compiler operation. Maybe if you've never even touched JavaScript, but then you'd probably still be lost. Thanks again.

        A 1 Reply Last reply
        0
        • N newton saber

          Thanks for taking the time to provide a great summary of your experience. I have not tried TypeScript for some of the reasons you mention -- I am a C# dev and have been working with JavaScript (jQuery and now Angular) for the past 2 years or so. About 2 months ago I went out to the typescript site and checked it out and couldn't find enough reason, just from reading the docs to learn yet another syntax and compiler operation. Maybe if you've never even touched JavaScript, but then you'd probably still be lost. Thanks again.

          A Offline
          A Offline
          Antonino Porcino
          wrote on last edited by
          #4

          Talking of C# and AngularJS, an alternative is to cross-compile C# to JavaScript (with compilers like Saltarelle). I have some projects written this way, but it's not an optimal solution because:

          • you need a C# import library for Angular (that I've written myself but it's hard to cover all the package)
          • Angular itself is very JavaScript oriented, with lot of hacks and tricks, doesn't fit well with C#
          • At this point there is no Visual Studio integrated debugging for C#, you can only debug compiled JS code
          • working with json and js in general, in C# you find yourself fighting with types, doing lot of conversions and things like that. The dynamic keyword helps but not much.
          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups