Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Microsoft

Microsoft Announces TypeScript 3.0 (neowin.net) 70

Microsoft released version 3.0 of TypeScript, which Microsoft describes as an "extension" of JavaScript "that aims to bring static types to modern JavaScript." Quoting Microsoft's Developer Tools blog: The TypeScript compiler reads in TypeScript code, which has things like type declarations and type annotations, and emits clean readable JavaScript with those constructs transformed and removed. That code runs in any ECMAScript runtime like your favorite browsers and Node.js. At its core, this experience means analyzing your code to catch things like bugs and typos before your users run into them; but it brings more than that. Thanks to all that information and analysis TypeScript can provide a better authoring experience, providing code completion and navigation features like Find all References, Go to Definition, and Rename in your favorite editor.
Neowin reports: With any major version release, it is not unexpected for breaking changes to be introduced and that's certainly the case for TypeScript 3.0. One obvious change is that with "unknown" becoming a new type, it is now a reserved type name and can no longer be used in type declarations. Otherwise, there's a range of API breaking changes due to a number of functions and internal methods being deprecated or being made internal.
On the plus side, TypeScript 3.0 reportedly has improved error messages, along with project references that let TypeScript projects have dependencies on other TypeScript projects.
This discussion has been archived. No new comments can be posted.

Microsoft Announces TypeScript 3.0

Comments Filter:
  • ... we should be looking for a better replacement. JavaScript is one of those languages that became far too popular for the wrong reasons.
    • How else were we supposed to do things like hover states on navigation buttons? Java or Flash? Because I've been there and those two things made things worst.

      • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Saturday August 04, 2018 @12:27PM (#57068940) Homepage Journal

        How else were we supposed to do things like hover states on navigation buttons?

        CSS [w3schools.com].

        • CSS didn't exist at the time.

          • by tepples ( 727027 )

            It does now, as do HTML input types and regular expression validators. That should cover most of the use cases of early JS, but not the current use of JS as a workaround for Windows, macOS, X11/Linux, iOS, and Android not being binary compatible.

          • How else were we supposed to do things like hover states on navigation buttons? Java or Flash? Because I've been there and those two things made things worst.

            CSS didn't exist at the time.

            CSS has been around since 1996, Java and Flash since 1995. You've really narrowed down the timeline for when your question is relevant...

            • CSS hover states, in 1996, supported by both Netscape 3 and Internet Explorer 3?

              You had to be there. You can't learn about the problems of an era in wikipedia pages.

              • It was possible to use each browser's functions + CSS in 1996 to do mouse-over functionality. I'm not arguing that it was any better or worse. I'm just pointing out that it could be done, and mocking your limited time frame because it makes some wrong assumptions.

                Speaking of actually being there, you would remember almost ever page had a "works best in/designed for" type graphic somewhere on the page indicating which browser it was targeting. "Supported by Netscape 3 and Internet Explorer 3" makes me chu
        • Early CSS didn't let you do a lot of the stuff it can do today.

          Javascript was pretty much the only practical way to do effects like highlighting or reveals. I'm amazed at the stuff that pure CSS can do now.

          • Early CSS didn't let you do a lot of the stuff it can do today.

            That's a fair point, I didn't even look to see when the hover selector was introduced. It might have even been right on that page. On the other hand, a lot of people didn't bother to start using it when it was introduced, either.

    • Every discussion of js follows the same pattern. Next we'll have folks complaining about "==" and semicolon insertion.
    • I really believe what Microsoft is doing with Blazor is the future. The requirements for different solutions and the preference of developers vary so much that trying to find a consensus is meaningless. Over time more languages will be able to run semi-native in a run-time environment so that projects can be developed using the best technology and language for the problem considering the skillset available.
    • by The MAZZTer ( 911996 ) <.moc.liamg. .ta. .tzzagem.> on Saturday August 04, 2018 @02:01PM (#57069376) Homepage

      TypeScript compiles to JavaScript while at the same time you can mix it with pure JavaScript. This makes it easy to add TypeScript to an existing project. The fact TypeScript is based off of JS means it is easy for JS developers to learn it. Plus, you have something JS does not have: consistency. Want to use the class keyword in JS? You need to make sure all your supported browsers have implemented it and it'll work. In TypeScript you have several different compile targets depending on your lowest common denominator of JS version support you need.

      TypeScript is a good solution to all the problems JS has, the most serious one I think being the lack of compile-type errors, pushing them to more difficult to find and fix runtime errors and logical errors.

    • by MobyDisk ( 75490 )

      How about Typescript? Besides, there is webassembly so really Typescript can just compile down to that.

    • They are not extending it, tell me what new javascript language structures they are introducing. What they are actually doing is reducing written bugs.
    • ... we should be looking for a better replacement. JavaScript is one of those languages that became far too popular for the wrong reasons...

      And soon, too, if it's already at the "extend" stage...

  • by oldgraybeard ( 2939809 ) on Saturday August 04, 2018 @11:42AM (#57068726)
    " emits clean readable JavaScript"

    Just my 2 cents ;)
  • by Anonymous Coward

    Er, I do not get it, if at the end of the day it ends up as regular javascript that means there cannot be a speed boost of any kind. It does not reduce bug rates of any sort. Other than some programmers who get very angry about javascripts nimble weak type this does not seem to...well to do anything at all really, it just introduces syntax where there was none previously but nothing is being done of any significance. How is that a benefit other than for syntactophiles getting their rocks off about a pret

    • TypeScript is more an annotation extension than anything else. It allows you to add the type of the parameters and method outputs as a development aid. This, coupled with a watcher process, checks your code as you type, and flags up when you pass an array to something that only uses strings, for example, or return a number instead of an object.

      If something has already checked that the method only gets called with correct parameter types, you get to just write the code that does stuff instead of having to bl

    • There was a study about a year ago wherr Microsoft found that using typescript reduced bugs by 15 percent over Javascript. Besides that, IDE tricks like autocomplete are kind of nice. YMMV.
  • A better Java minus the suck. Sort of like the webs free Kotlin. Excellent FOSS tooling (Visual Studio Code rocks) and works out of the box with zero-fuss dev-environment setup. It compiles to JS and Webassembly in a breeze and that stuff runs everywhere without anyone having to install some extra awkward VM.
    As far as I can tell MS has redeemed themselves a little with TS.

    If your planning to build non-trivial applications, check out TS, it's definitely one of the more worthwhile of the new "compiles to JS"

  • by rnturn ( 11092 )

    ... another programming language. [smh]

    • There is nothing inherently wrong with more programming languages. Following your logic, we should stop improving languages, and I disagree. The current state of languages is far better than just 5 years ago, but they are nowhere close to where they should be. There should be no need for highly specialized workers to make simple CRUD applications. The logic and ideas are not hard, it is understanding how to make then understandable for a machine that is.
  • Am I a minority? (Score:5, Insightful)

    by AlanObject ( 3603453 ) on Saturday August 04, 2018 @01:49PM (#57069308)

    I actually happen to like and appreciate Typescript. It was easy to learn-by-doing by going through the Angular [2-6] tutorials.

    As a long-time Java programmer, I don't have to give up the type checking at the IDE level that really reduces the common coding mistakes you get with plain Javascript. You just get to tryable-then-working code faster. But you don't give up any of the flexibility that Javascript gives you. And the async/await functionality makes client-side programming just so much easier.

    Does anyone else feel this way? Or is it just fashionable to hate it because Microsoft had something to do with it?

    • by Anonymous Coward

      The haters here haven't built enough stuff with vanilla JavaScript to appreciate TypeScript. Anyone from a statically typed background will like it. It works great on Linux.

      To this louder majority: try before you hate.

  • by Anonymous Coward

    I have a solid 18 yeats of experience with JavaScript. There is absolutely no point to TypeScript (or similar languages like CoffeeScript). They provide some cool syntax candy and "extend" the language in a sense, but in the end it just spits out pure JavaScript and adds a level of abstraction when it comes to debugging. If you're a good JS developer, you can write excellent, readable, well-organized, and maintainable code. And with ES6 you can write truly OO code with real classes and inheritance if that'

    • The point of TypeScript is to add static typing to the language. And if you can't see the merits of this ... well ... I don't know what to tell you. I'm convinced that people who don't see the advantages of static typing never had to maintain other people's code.
  • Still no integers? Come on guys, why put all that work into it and leave that bleeding wound still bleeding? Pass.

    • Still no integers? Come on guys, why put all that work into it and leave that bleeding wound still bleeding? Pass.

      Somebody downmodded this. Somebody who writes web software?? Lord help us.

  • Maybe Microsoft can get rid of JavScript . . .

  • IMO, TypeScript is the only good thing Microsoft has ever produced (well their old corded mouse was decent). It emits readable JS, given that I don't see the risk. If they do something bad with it then I can just work off the compiled JS files.

"A car is just a big purse on wheels." -- Johanna Reynolds

Working...