back to article Microsoft's JavaScript challenger nears 1.0, wins Visual Studio love

Microsoft's TypeScript web development language is almost ready for prime time, and by the time the next update for Visual Studio 2013 arrives, TypeScript 1.0 will be treated as a first-class language by Microsoft's IDE. So sayeth S. "Soma" Somasegar, corporate VP of Microsoft's developer division, who announced a new …

COMMENTS

This topic is closed for new posts.
  1. xperroni

    Insanity is doing the same thing again and expecting different results

    Instead, TypeScript is a superscript of JavaScript, such that all valid JavaScript code is also valid TypeScript code.

    Haven't we learned anything from the Goldberg machine that is C++?

    Apparently not. Sigh.

    1. DrXym

      Re: Insanity is doing the same thing again and expecting different results

      C++ seems to have done pretty well for itself last time I looked. The main reason to use C in preference to C++ is for low level APIs and functionality where name mangling, exceptions etc. might get in the way of things. For application level programming there is little reason to use C if C++ is available.

      I don't see the situation being analogous for JS though since JS is compiled at runtime whereas most of these JS++ wannabes are compiled at development time and the translated JS is compiled again at runtime. They're basically acting like cfront with the second compilation deferred until the page is loaded.

      It's a damned shame these companies can't just bypass this BS altogether - define a cross platform LLVM runtime (like PNaCl but with appropriate concessions to other browsers) and let people develop in anything they like. JS as the intermediate form is the problem here.

      1. TheOtherHobbes

        Re: Insanity is doing the same thing again and expecting different results

        >C++ seems to have done pretty well for itself last time I looked.

        C++ is 21st century FORTRAN, committee-enhanced with added cruft and brittleness.

        Java is 21st century COBOL.

        JavaScript is 21st century VBA without the useful bits.

        No one cares about TypeScript.

        1. Anonymous Coward
          Anonymous Coward

          Re: Insanity is doing the same thing again and expecting different results

          "C++ is 21st century FORTRAN, committee-enhanced with added cruft and brittleness."

          Isn't that the truth. They just can't leave well enough alone either with the syntax (it was never good, now its bordering on unreadable with some of the latest additions) or the standard libraries. Why are threads now part of the language but not process control or do the committee think C++ is only used on Windows?

          Another added problem is whenever I go for an interview they'll invariable ask about some obscure latest feature of the language that happens to be the managers pet interest. "So , tell me all about move constructors and how you've used them in your most recent projects". Oh just **** off already. Do you want me to write a program that solves a problem or some C++ haiku?

      2. P_0

        Re: Insanity is doing the same thing again and expecting different results

        For application level programming there is little reason to use C if C++ is available.

        Indeed, why use C++, when Java or C# are available for application level programming?

        1. xperroni
          Windows

          Re: Insanity is doing the same thing again and expecting different results

          Indeed, why use C++, when Java or C# are available for application level programming?

          The perverse bit about C++ prominence is that it's self-reinforcing. There is a lot of useful C++ libraries around, so a lot of people end up learning C++, and most modern languages provide some way to interface with C++ code, so writing a library in C++ is the best way to ensure a large audience, so there is ever more C++ libraries around. I should know, I am guilty of this very same crime myself.

          If I have to choose between C or C++ then I'd rather drown C++ it is. But yes, when I can really choose, then it's either Java or Python.

      3. xperroni

        Re: Insanity is doing the same thing again and expecting different results

        C++ seems to have done pretty well for itself last time I looked.

        You misunderstand. It's not that C++ isn't powerful, or successful. It is.

        It's also a God-awful hodgepodge of redundant (and sometimes contradicting) features. This should not surprise anyone, it's what happens when you try to bolt several additional programming paradigms onto a language (C) that was never very clean to begin with.

        That's what I think we should rather not have again. Interface with Javascript files all you want, but for the love of Backus, the language is pretty complicated enough already without these half-baked attempts to "fix" it.

    2. Anonymous Coward
      Anonymous Coward

      Re: Insanity is doing the same thing again and expecting different results

      > Insanity is doing the same thing again and expecting different results

      That would be called the training effect

  2. jake Silver badge

    Let me get this straight ...

    "Outside of Microsoft, TypeScript is being used in projects like Adobe's Digital Publishing Suite."

    So the security-nightmare-microsoft-corp re-implementation of the inherently insecure javascript is being applauded by the demonstrably security unaware adobe?

    ::shudders:: Do not want. At all. Talk about a cluster-fuck.

    1. JDX Gold badge

      Re: Let me get this straight ...

      Javascript isn't inherently insecure.

      1. jake Silver badge

        @JDX (was: Re: Let me get this straight ...)

        Every "works everywhere, on all platforms" script language is inherently not secure, JDX. And you know it. This includes sh/bash, BTW, IMO.

        Try not to be disingenuous, it's beneath you.

  3. dogged
    FAIL

    Headline

    "JavaScript challenger"

    Fail.

    Typescript does not "challenge" JavaScript in any way. It is a superset of JavaScript that compiles to pure JavaScript.

    Typescript is simply a way of writing and managing large JavaScript projects using type-safe code. It's an Anders Hjelsberg project and as such is officially Good Stuff™

    In other news, El Reg's headline writer is a misinformation-peddling tard.

    1. JonP

      Re: Headline

      ....a misinformation-peddling tard.

      Or "journalist", to use the vernacular.

  4. Anonymous Bullard

    Developer's introduction:

    Both TypeScript and Dart "compile" into Javascript. On the client, they both run as Javascript, on existing browsers as-is, without any changes or plug-ins.

    The differences being, TypeScript is built on top of Javascript (like CoffeeScript). Last years' Javascript is still valid TypeScript. Dart is a fresh language, which compiles into valid and optimised Javascript. (but expect a VM on Google's browsers, at least).

    If you've developed any large Javascript based application, then either language is a welcome change. For me, it's the static types (type safety, declared types) so the IDE no longer has to guess the type of a variable.

    If you already have a Javascript code base, TypeScript is better for gradual migration. If you're coming from "real" languages and Javascript has put you off web-development, Dart is less of an arse-ache.

    Initially, IDE support will be more widespread for TypeScript (since it's Javascript with extra bits). IDE support for Dart is better (by design), but not as common (you'll probably have to get rid of your VS comfort blanket).

    If you want an analogy:

    For the old: Javascript is assembly, TypeScript is assembly with macros. Dart is C++.

    For the young: Javascript is C, TypeScript is C++, Dart is C#.

    The rest: Moped, motorbike, car.

    Killer features:

    TypeScript is Javascript with extras. Might be a bad thing - but your existing code and libraries can still be used.

    Dart produces optimised Javascript, tree shaking (dead code removal), and doesn't require jQuery.

    1. jake Silver badge

      @ Anonymous Bullard (was: Re: Developer's introduction)

      "For the old: Javascript is assembly,"

      That is the saddest, yet most hysterical comment I've read this century. The mind absolutely boggles. Is this how low we have fallen as techies? I cry.

      1. Nick Ryan Silver badge

        Re: @ Anonymous Bullard (was: Developer's introduction)

        Pah! When I were a lad we wrote code in machine code, none of this assembly business... that's for nancies.

        Seriously, I did. I can still remember some of the numeric codes as well.

        1. Boris the Cockroach Silver badge
          Joke

          Re: @ Anonymous Bullard (was: Developer's introduction)

          Machine code????? you were spoiled... all we had were rows upon rows of switches for programming, and magnets for memory... still got us to the mun though

          Boris

          1. Pete the not so great

            Re: @ Anonymous Bullard (was: Developer's introduction)

            Luxury!! We had to chisel our code into stone, that was when computers ran at 0.5 Megaliths.

      2. dogged

        Nurse! He's out of bed again!

        > Is this how low we have fallen as techies? I cry.

        No, it's a thing that young people today call an "analogy". That means it's supposed to explain a concept you're having trouble with - like where you left your teeth - by means of a concept you can understand - like it's hard to skateboard with a zimmer frame.

        Now drink your cocoa and dream of flying kites and riding steam engines.

        1. Anonymous Coward
          Anonymous Coward

          Re: Nurse! He's out of bed again!

          He doesn't have to dream, he has a private railway with steam engines at his ranch

          He built, maintains and drives it himself

          It is faster and more reliable than the Shinkansen

      3. Anonymous Coward
        Anonymous Coward

        Re: @ Anonymous Bullard (was: Developer's introduction) @jake

        Your mind boggles at practically anything. I think it needs an overhaul. Presumably they'd need your Mum's permission first, of course.

      4. Anonymous Coward
        Anonymous Coward

        Re: @ Anonymous Bullard (was: Developer's introduction)

        FFS read the comment again and this time note that it is about ANALOGIES not statements of equivalence.

        Is this how low we have fallen as commentards? I cry.

  5. RyokuMas

    "Class"

    The presence of this single word in the screenshot is somewhat reassuring.

    "Inherits" or similar would have been even more so. Anything to circumvent the hideousness that is javascript.

    1. John Gamble
      Angel

      Re: "Class"

      The presence of this single word in the screenshot is somewhat reassuring.

      Depends on your coding style. I'm starting to appreciate prototypal inheritance.

      Doug Crockford has a good talk on javascript good (and bad) parts: here on Youtube.

      It may not change your opinion, but at least you'll have a better grounding.

  6. Anonymous Coward
    Anonymous Coward

    Embrace, Extend...

    that is all.

    1. dogged

      Re: Embrace, Extend...

      Embrace, Extend... comment with absolutely no understanding of the topic under discussion.

      Is that how it goes?

  7. Anonymous Coward
    Anonymous Coward

    Can't see the point myself.

    If you feel you need TypeScript or Dart, you have simply been programming in javascript wrong.

    Since these languages compile down into 'optimised' javascript, why not simply learn how to write that instead? You'll be more employable.

    1. dogged
      Facepalm

      Re: Can't see the point myself.

      Because using a tool like this a) does a better job with less human-error mistakes and b) takes about 1/5th the time of hand-optimizing JavaScript.

      So you produce better code much faster.

      Which makes you more employable.

      Sorry, you were saying?

      1. proud2bgrumpy

        Re: Can't see the point myself.

        Fantaisie software's SpiderBASIC have an implementation of it's cross-platform PureBASIC language that generates optimised JavaScript as well. At first I was at best skeptical (why not just learn to write optimised Javascript in the first place) but I'm won over now since I was able to port lots of my existing code from PureBASIC to SpiderBASIC with little or no changes and great chunks of VBA stuff with relatively little change. I really don't know about TypeScript or Dart - but I do know SpiderBasic works.

    2. wikkity

      Re: Can't see the point myself.

      Because like it or not Javascript development does not scale easily. Sure you can roll your own tools and pick and mix form open source tools but when you start approaching large code bases shared across projects it starts get hairy and refactoring is an absolute enormous pain.

      And before anyone starts saying, you can do this with X and that with Y, sure you can but they are just bandaids. I like javascript and used it for many years, very familiar with jquery, mootools, various unit testing frameworks, package managers etc... But they don't come anywhere close to the tool chains that you get for say Java, TypeScript and Dart are a step in the right direction.

      1. Anonymous Coward
        Anonymous Coward

        Re: Can't see the point myself.

        "Because like it or not Javascript development does not scale easily. Sure you can roll your own tools and pick and mix form open source tools but when you start approaching large code bases shared across projects it starts get hairy and refactoring is an absolute enormous pain."

        Javascript should not be used for large scale development. Its a scripting language. If you need to create a large scale server side project used C++, C# or Java. And if you have that much code client side then perhaps you should rethink your whole design.

        1. wikkity

          @Boltar

          > Javascript should not be used for large scale development.

          I'd always prefer something else whenever possible. But say you have a number of core products that are customised for many clients that need to work offline on any device, say for geospatial data collection, then you've apps for processing/cleansing that data further up the chain and of course presentation of that data, you've got a lot of code though hopefully a lot of it shared . Then of course in all that source code you've got components that are used in completely different apps, e.g. data entry/validation components, even with backend checking you still need validation at the UI.

          It doesn't take long before you've got a pretty large code base where your only alternative is using native apps or forcing the user online and always do stuff server side (which then reduces your client base).

          I'm not saying this is how projects I work on are built, our javascript for large/medium projects tends to be generated from a variaety of tools/sources e.g. domain models, rules and buisness DSLs, those same generators create corresponding java, wsdl, c# etc...

          > And if you have that much code client side then perhaps you should rethink your whole design.

          Certainly an indicator that it should be revisited.

        2. ByeLaw101

          Re: Can't see the point myself.

          "And if you have that much code client side then perhaps you should rethink your whole design"

          So if you have an enterprise application, with a JSON API and an HTML5 ui... then you going to have a bit of JS to manage. I'm not saying that's a good thing, but how else do you do it?

    3. Anonymous Coward
      Anonymous Coward

      Re: Can't see the point myself.

      I can sort of see the point. The reasoning is that yes, you can write nice code in pretty much any language - if you are a smart, responsible and capable kind of programmer. But it's a big and nasty world where not all programmers are like that. Some of them approach the job like a kid with a bag of crayons and a freshly painted wall.

      So I suppose the thinking is that by providing a nicer, safer environment, you can limit the mess that the less skilled devs can do. Whether this is true, I don't know, but it can't hurt to have a better language - and the fact that it's a superset makes it easier to adopt.

      Having said all that, my main worry is whether Microsoft can be trusted with Internet standards yet - they don't have a great track record.

    4. Piro Silver badge

      Re: Can't see the point myself.

      I understand your point in principle, but you could keep arguing the same thing over and over. JavaScript is not exactly a low level language itself.

    5. GrumpyOldBloke

      Re: Can't see the point myself.

      Because people have forgotten that types largely existed in the old days to solve a compute problem.They cling to typed languages today in an attempt to solve a management problem. Unfortunately types are not great at this role despite an oft quoted belief that typed languages afford scale and banish bugs, ignoring the myriad number of types and bugs that appear in any large project and the often haphazard way they are brought into existence. Management problems need to be solved with management tools. Types in modern managed code are now little more than a feel good overhead. Prayer beads would probably work as well.

      1. wikkity

        Re: Can't see the point myself.

        I like using both typed and untyped languages, each have their place. E.g. for the large (0.5M LOC) code base give me a typed language any day for a number of reasons, but if you have any doubts on this just compare refactoring possibilities for JS and Java, a typed language simply makes refactoring much easier.

      2. Anonymous Coward
        Anonymous Coward

        @GrumpyOldBloke

        "They cling to typed languages today in an attempt to solve a management problem. Prayer beads would probably work as well"

        Well aside from allowing considerably more compiler optimisation, runtime efficiency (runtime code not constantly checking type at assignment), catching of type based errors at compile time, clarity of the code, type based polymorphism, direct indexing of memory due to known size and a dozen other reasons, no , I can't think of why anyone would bother with typed languages now.

        With age normally comes wisdom. I guess you're an exception to that rule.

        1. GrumpyOldBloke

          Re: @GrumpyOldBloke

          An article published in the register not so long mentioned new Javascript engines that run code about as fast as C# engines so we can conclude that the runtime inefficiencies are not so great. Direct indexing of memory; with just about everything living on the heap and being accessed through indirection there is probably not much difference between the C#/Java versus Javascript approaches anymore. So we are left with arguments about type as a code management issue and not a compute issue. My question is - is type the best way to solve code management issues. Counter intuitively strongly typed languages may actually be better in smaller projects. In larger projects the proliferation of types to keep the compiler happy creates a significant code design and code management overhead. We will see how the future pans out, with age comes dementia but also the recognition that many things that were once held dear pass their best by date. Abandoning strongly typed languages opens up a much more natural expression of interconnectedness in code and does away with a lot of the abstraction demanded by types. Does this require new ways to manage code - absolutely. Is a reversion to types the answer - I don't think so.

          1. Anonymous Coward
            Anonymous Coward

            Re: @GrumpyOldBloke

            "An article published in the register not so long mentioned new Javascript engines that run code about as fast as C# engines "

            I'm not a C# coder, but I'd love to see the comparison of a 500K line financial system written in C# compared to a similar size one in javascript - assuming the latter even has the API to allow construction of one. Its all very well comparing mickey mouse 100 line programs but when the going gets tough - you don't use a web scripting language.

            "In larger projects the proliferation of types to keep the compiler happy creates a significant code design and code management overhead"

            Oh dear - you're the type who obviously thinks taking a lot of time over the initial design is a bad thing. I can assure you - it is not. Far better to spend 2 months designing a proper system that is then fairly easy to maintain than throwing together some typeless sphagetti code in 2 days that is then a maintenance nightmare for the next 5 years. You see, thats the difference between grown up programming and the sort of knock-it-up-quick-throw-it-the-door sort of coding style that a lot of web houses employ.

  8. sorry, what?
    Coat

    Developer expectations...

    "... will treat TypeScript as a first-class language, complete with ... code refactoring... developers have come to expect from Microsoft's tools."

    Made me laugh. Hollowly, of course. The only way to give VS any real refactoring capability (for C# at least) is to buy and install Resharper.

    I cried (inside, obviously) when I returned to using VS (2010) after a break of over 10 years. It seemed like it had hardly changed. VS is so far behind IntelliJ IDEA (from JetBrains, the developers of Resharper) it is like returning to stone slabs and chisels after using a word processor.

    1. dogged

      Re: Developer expectations...

      Interestingly, Resharper supports Typescript.

    2. Anonymous Bullard

      Re: Developer expectations...

      "VS is so far behind IntelliJ IDEA "

      I wish I believed this crap 10 years ago.

      I've moved from Visual Studio 2010 (to avoid the VS2012/13 disasters) to WebStorm (IntelliJ IDEA based. Android Studio gave me a taster of this breed) and I feel I can take over the world with it!

      I've been using VS since before it was Visual Studio, and I thought it was the best! Since using IntelliJ IDEA IDEs, VS seems both bloated and primitive. (This has helped me move 100% of my development to Linux)

      My advice to any VS users struggling with HTML/JS is to open their mind and try it for a week.

      1. dogged

        Re: Developer expectations...

        I am in no way accusing you of anything other than enthusiasm but...

        You might want to consider your writing style with this kind of thing. Because (even though I'm certain it's not) it reads a lot like advertising copy.

    3. Kubla Cant

      Re: Developer expectations...

      VS is so far behind IntelliJ IDEA

      I'm glad I'm not the only one to think this.

      VS (very expensive) compares unfavourably with the features that IntelliJ (reasonably priced) and Eclipse (free) had 10 years ago.

    4. Anonymous Coward
      Anonymous Coward

      Re: Developer expectations...

      "Made me laugh. Hollowly, of course. The only way to give VS any real refactoring capability (for C# at least) is to buy and install Resharper."

      Wouldn't "Sharpener" have been a better name? Resharper isn't even a word.

      1. dogged

        Re: Developer expectations...

        It's a compressed portmanteau of "Refactor C Sharp".

        1. Anonymous Coward
          Anonymous Coward

          Re: Developer expectations...

          "It's a compressed portmanteau of "Refactor C Sharp"."

          Well actually its not , they've just taken the word "sharper" and stuck "re" on the front. Which creates a non word that doesn't even sound good as a name.

  9. Tom 7

    Is there a browser based IDE for it?

    If not its obviously not good enough for the job it aims to do.

    Now where did orion get to?

  10. g e

    So...

    Who, other than Microsoft, and presumably Adobe to some degree, will be supporting this?

    Or is it just another MS IE-only white-elephant clutch at some kind of ownership of online stuff to keep themselves seemingly relevant to shareholders?

    Perhaps I misunderstood how and where it's supposed to work....

    1. Anonymous Coward
      Anonymous Coward

      Re: So...

      It's a knee-jerk reaction to Dart.

    2. Malcolm 1

      Re: So...

      It has no browser dependency and is open source (Javascript via node.js) so, yes, it does appear that you have misunderstood.

    3. AndyDent
      Thumb Up

      Re: So...

      Webstorm is the dedicated Web editor version of Intellij (which can add Typescript via plugins).

      http://blog.jetbrains.com/webstorm/2013/11/enjoy-typescript-in-webstorm/

      "One of the new features in WebStorm 7 that cannot go unmentioned is access to TypeScript community stubs. They provide TypeScript definitions for a wide range of JavaScript libraries and help code completion

      ...

      WebStorm provides powerful refactorings for TypeScript code

      "

  11. BongoJoe
    Holmes

    The book is now open

    How long before Microsoft either drop this language, make it non-backward compatible or it becomes a different standard on their sites or whatever?

    Icon because that's the nearest thing to McCirrick's deerstalker -- I couldn't find a hound tearing someone's throat out unfortunately.

  12. Dan 55 Silver badge

    Making JavaScript better...

    There seems to be a two pronged approach which can be taken which is much better than precariously balancing a new language on top of JavaScript.

    1. Define a strict subset of JavaScript without all the bad parts in the script tag or as a pragma.

    2. Make the IDE notice the tag/pragma and complain a lot if bad JavaScript is used.

    Seems like an easier way to get JavaScript back on track to me.

  13. jake Silver badge

    Honestly ...

    Most of you lot seem to think that "programming" only relates to WWW and so-called "smartphones". I can assure you that you are mistaken. There is a boatload of code that sits underneath the so-called "application" layer.

    Painting pretty pictures doth not produce boot code, operating systems & device drivers.

    1. dogged

      Re: Honestly ...

      We know. But at the same time, there's a lot of programming that is in fact related to the WWW and smartphones and one can either use suitable tools to do that programming or one can complain about punch cards.

      You're doing the equivalent of wandering into a tomato-growing hothouse and complaining that nobody ploughs with horses anymore.

      1. jake Silver badge

        @ dogged: (was: Re: Honestly ...)

        No, I'm wandering into a happy hot-house garden full of flower sniffers, and pointing out that they have absolutely zero idea where fertilizer comes from.

        1. dogged

          Re: @ dogged: (was: Honestly ...)

          (For the record I don't know who keeps downvoting your comments but it's not me. We might disagree and I might think you're off-topic to a truly bizarre degree but it ain't personal).

          1. jake Silver badge

            Re: @ dogged: (was: Honestly ...)

            Downvotes don't bother me ... and upvotes don't push my existence into another plane of reality. Frankly, the entire concept of "thumbs", as implemented by ElReg, is totally meaningless.

            In other news: Off topic in this thread? Where, exactly?

            1. dogged

              Re: @ dogged: (was: Honestly ...)

              Well, this thread is specifically about Typescript as a means of managing and controlling - and improving! - JavaScript projects.

              Therefore, decrying the existence of JavaScript projects is hardly relevant.

              1. jake Silver badge

                Re: @ dogged: (was: Honestly ...)

                Oh. I see. In your mind, I'm not supposed to be allowed to have an opposing viewpoint on the topic. Out of curiosity, do you support governmental/religious censorship?

                1. dogged

                  Re: @ dogged: (was: Honestly ...)

                  No, I absolutely don't.

                  But look at this a different way. Suppose somebody comes up with a way of extending the range of existing electric cars. Now, suppose that I am of the opinion that electric cars are actually a greater hazard to the world than not trashing perfectly serviceable old cars*.

                  My opinion in this case is of no merit - there are electric cars. While this may not change my opinion of them, it does improve them by any reasonable standard. If I decide to jump up and down and bluster about how they're not proper cars and nobody who drives one is a proper driver and I still have a '38 Jaguar... I'm just being a cock.

                  Does that make sense?

                  * For the record, I don't have any opinion on this either way.

                  1. jake Silver badge

                    Re: @ dogged: (was: Honestly ...)

                    No, it doesn't make sense.

                    Differing opinions are always valid in a discussion forum.

  14. startstuff

    Embrace and extend

    Remember Microsoft's 'embrace and extend' plan for java? Sun designed Java to work in ANY operating system but MS made sure it only worked in MS PCs thus the "embrace, extend and exterminate" DOJ's joke phrase. Can anyone remember the name of MS's java development package?

    I'm afraid that this TypeScript compatible javascript language is not for many of us.

    1. dogged
      Stop

      Re: Embrace and extend

      Are you retarded?

      No, really, has somebody taught you one thing from history and it's the only thing you know how to type?

      Did you not read ANY of the comments above? Have you only read the bullshit headline?

      Typescript is a superset of JavaScript. The compiled output of Typescript has none of the Typescript extensions, it is just and only JavaScript.

      Typescript is open source released under the Apache license.

      Typescript is already supported by several programming environments on several platforms, including linux.

      Nothing is being extended.

      You are an idiot.

This topic is closed for new posts.

Other stories you might like