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 community …

COMMENTS

This topic is closed for new posts.

Page:

Bronze badge

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.

8
3

This post has been deleted by a moderator

Silver badge

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.

8
0
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
0
Silver badge

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.

3
8
Silver badge

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?

5
1
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?

3
1
Bronze badge
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.

1
0
Bronze badge

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.

1
0
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.

11
11
JDX
Gold badge

Re: Let me get this straight ...

Javascript isn't inherently insecure.

11
4
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.

2
17
Silver badge
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.

10
8

Re: Headline

....a misinformation-peddling tard.

Or "journalist", to use the vernacular.

8
0
Bronze badge

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.

9
1
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.

5
12
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.

6
0
Silver badge

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.

11
3
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

6
0
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.

2
0
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.

1
0
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
0

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.

1
0
Silver badge

"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
0
Bronze badge
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.

0
0
Anonymous Coward

Embrace, Extend...

that is all.

3
9
Silver badge

Re: Embrace, Extend...

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

Is that how it goes?

7
2
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.

8
4
Silver badge
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?

6
2
Bronze badge

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.

2
1
Bronze badge

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.

1
0
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.

0
0

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.

2
3
Bronze badge

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.

0
0
Silver badge

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.

0
1
Bronze badge

@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.

0
0
Silver badge

@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.

2
0

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?

0
0

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.

0
0
Silver badge

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.

0
0

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.

0
0
Bronze badge
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.

6
0
Silver badge

Re: Developer expectations...

Interestingly, Resharper supports Typescript.

1
0
Bronze badge

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.

2
2
Silver badge

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.

2
0
Silver badge

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.

2
1
Silver badge

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.

0
1
Silver badge

Re: Developer expectations...

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

2
1
Silver badge

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.

0
0
Silver badge

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?

1
0

Page:

This topic is closed for new posts.

Forums