Live data from Hacker News

TypeScript Seals My Penchant for JavaScript

cycligent.com

11–20 of 133 posts

Re: TypeScript Seals My Penchant for JavaScript

#11
post #5
post #2

The most underrated feature of TypeScript is not the language itself, but the transpiler. With the flick of a switch you can support ES3, ES5 and in future ES6 and beyond - without changing your code (not entirely true, but it is possible to write code that transpiles well to all JS standards). Decoupling your development from the shifting sands of JS support - across multiple browsers and platforms - is a dream come…

But if you're going to transpile, why not transpile from a real language, not a Turing tarpit?

(1) The transpiled JavaScript closely resembles the source TS, making debugging easier (source maps allieviete this to a certain extent).

(2) Transpiling from a whole different language means you have to port the standard runtime, otherwise you'd lose portability and familiarity, which are the two key advantages of transpiling from another, widely used language. Also, as JavaScript often runs in the browser this means downloading the runtime.

(3) The more different the two languages are, the more likely you'll run into surprising situations where feature X in language Y cannot be implemented in its original form in JavaScript, causing subtle incompatibilities between Y code written for the "original" Y compiler / interpreter and Y code that was meant to be transpiled.

(4) As someone else mentioned, TS is almost a superset of JS, which means mixing in JS code into TS code is much easier.

(5) What is a real language anyway?

Re: TypeScript Seals My Penchant for JavaScript

#12
post #3

to save readers the time I've just wasted, here are the two sentences about typescript in this sales pitch for cycligent.js: "I am able to keep the freedom and expressiveness of JavaScript to which I have become so accustomed while getting enterprise-level type checking and refactoring capabilities. Declaration of objects and interfaces is a dream."

What on Earth is "enterprise-level type checking"?

Re: TypeScript Seals My Penchant for JavaScript

#13
post #5
post #2

The most underrated feature of TypeScript is not the language itself, but the transpiler. With the flick of a switch you can support ES3, ES5 and in future ES6 and beyond - without changing your code (not entirely true, but it is possible to write code that transpiles well to all JS standards). Decoupling your development from the shifting sands of JS support - across multiple browsers and platforms - is a dream come…

But if you're going to transpile, why not transpile from a real language, not a Turing tarpit?

One answer is the strong compatibility story for existing JavaScript libraries. You can use d3 or three.js from TypeScript; that's a big advantage over something like Elm.

Compatibility with JavaScript source (instead of libraries) is a disadvantage. The most dangerous parts of TypeScript are the JavaScript parts: arithmetic, bracket notation, etc.

Re: TypeScript Seals My Penchant for JavaScript

#14
post #4

Earlier quoted context omitted.

Totally agree. After doing a bunch of code with TypeScript (transpiling to ES5 and ES3), I decided to give Babel a try. It took me awhile to set it up properly with the right presets and plugins. It did a fine job transpiling, but I wondered why people just don't use TypeScript. It's so much easier to use.

because I enjoy writing pure JS. Typescript feels like Coffeescript, which always felt like a hack to make Rubyists more comfortable. Similarly TS feels like a hack to make C#'ers more comfortable. Ultimately, if you're going to program in JS then get comfortable in JS, rather than trying to make JS more like your favourite language.

You can type absolutely pure JavaScript, change the file extension to .ts and still get some of the benefits of the typescript compiler for absolutely free.

That's probably why a lot of people are excited about typescript. It basically is JavaScript, but optionally annotated JavaScript. It's not a new language.

Re: TypeScript Seals My Penchant for JavaScript

#15
post #3

to save readers the time I've just wasted, here are the two sentences about typescript in this sales pitch for cycligent.js: "I am able to keep the freedom and expressiveness of JavaScript to which I have become so accustomed while getting enterprise-level type checking and refactoring capabilities. Declaration of objects and interfaces is a dream."

What on Earth is "enterprise-level type checking"?

In enterprise software you do one extra type check.

Re: TypeScript Seals My Penchant for JavaScript

#16
post #7
post #3

to save readers the time I've just wasted, here are the two sentences about typescript in this sales pitch for cycligent.js: "I am able to keep the freedom and expressiveness of JavaScript to which I have become so accustomed while getting enterprise-level type checking and refactoring capabilities. Declaration of objects and interfaces is a dream."

I think these reports from the field are worthwhile. The guy is an experienced programmer. I thought it was interesting that he was a hard core Java/C# and hated JavaScript when he had to use it. Then after a couple of years of JavaScript, he fell in love with the expressiveness and ease of coding and chaffed at the restrictions of Java/C#. Then he had to do a large app in JavaScript and hit the point where he it was…

>I got there from thier other article "Does Electron live up to the hype?" tl;dr - It does

It creates applications that require at the very least three times as many resources as Qt, which is also a cross-platform tool-kit that allows you a lot of freedom (specially with QML) as well as native OS widgets using a single codebase (although probably compromising on the HIGs' patterns for each OS).

I fail to see how Electron lives up to its hype as a holy grail for cross-platform application development, unless my impression of the hype behind it is wrong.

Re: TypeScript Seals My Penchant for JavaScript

#17
post #3

to save readers the time I've just wasted, here are the two sentences about typescript in this sales pitch for cycligent.js: "I am able to keep the freedom and expressiveness of JavaScript to which I have become so accustomed while getting enterprise-level type checking and refactoring capabilities. Declaration of objects and interfaces is a dream."

What on Earth is "enterprise-level type checking"?

Enterprise-level capabilities. I know the E-word is taboo here but aren't you people exaggerating a but on the trolling?

Re: TypeScript Seals My Penchant for JavaScript

#18
post #6
post #5

Earlier quoted context omitted.

But if you're going to transpile, why not transpile from a real language, not a Turing tarpit?

Well Google already did that with Java and GWT, but it never caught on. I guess TS being a superset of JS itself might be an advantage...otherwise it is still a new language designed for web browser programming unlike Java. I suppose it is a fair question why they didn't just use C#.

> Well Google already did that with Java and GWT, but it never caught on.

Actually it did catch on in the enterprise world, just like Typescript. Will Microsoft be as "dedicated" as Google regarding its language? wait and see.

Re: TypeScript Seals My Penchant for JavaScript

#19
post #3

to save readers the time I've just wasted, here are the two sentences about typescript in this sales pitch for cycligent.js: "I am able to keep the freedom and expressiveness of JavaScript to which I have become so accustomed while getting enterprise-level type checking and refactoring capabilities. Declaration of objects and interfaces is a dream."

What on Earth is "enterprise-level type checking"?

> What on Earth is "enterprise-level type checking"?

It doesn't mean anything. I guess the author just meant static typing.

Re: TypeScript Seals My Penchant for JavaScript

#20
post #7

Earlier quoted context omitted.

I think these reports from the field are worthwhile. The guy is an experienced programmer. I thought it was interesting that he was a hard core Java/C# and hated JavaScript when he had to use it. Then after a couple of years of JavaScript, he fell in love with the expressiveness and ease of coding and chaffed at the restrictions of Java/C#. Then he had to do a large app in JavaScript and hit the point where he it was…

>I got there from thier other article "Does Electron live up to the hype?" tl;dr - It does It creates applications that require at the very least three times as many resources as Qt, which is also a cross-platform tool-kit that allows you a lot of freedom (specially with QML) as well as native OS widgets using a single codebase (although probably compromising on the HIGs' patterns for each OS). I fail to see how Elec…

It is just the second coming of Mozilla XUL, just that this generation hyping Electron was still on their diapers, so they haven't seen it coming and going away without living any trace of it besides Firefox and Thunderbird.
Post reply on HN