TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why does TypeScript have be the answer to anything?

94 点作者 andrijac超过 12 年前

13 条评论

krohrbaugh超过 12 年前
First of all, I'm glad Microsoft is getting involved in this space. They have a deep talent pool when it comes to language design and tooling and it'll be interesting to see where TypeScript goes.<p>Unfortunately, the arguments trying to draw some kind of monumental distinction between TypeScript, Dart and CoffeeScript are silly. They are all a response to the state of client-side development and are all applying essentially the same strategy (i.e., some syntax changes and a pre-compiler). It's great that TypeScript is a superset, which is what makes it pretty interesting to me, but it's still more similar to the other two than not.<p>Plus, what's so bad about being Microsoft's "answer" to something else? Windows was the response to Mac OS, Xbox was a response to PlayStation, .NET was the response to Java, ASP.NET AJAX was the response to Prototype (later abandoned for jQuery), ASP.NET MVC was the response to Rails, Entity Framework was the response to Hibernate/Active Record, NuGet was the response to Rubygems/npm. Each of these moved MSFT forward and several of them moved the industry forward. The ASP.NET team (of which Mr. Hanselman is a member) is doing a lot of great stuff inside MSFT, but a lot of is derivative. That's okay. It's largely the strategy MSFT has always followed, so why waste energy defending what has worked well in the past?<p>I agree with one point, however: It <i>is</i> disappointing when smart people display a profound ignorance of computing history.
评论 #4604928 未加载
评论 #4602774 未加载
eranation超过 12 年前
I think google missed big time on Dart, and something like TypeScript is what they should have done. I really find it hard to come up with bad things to say about Microsoft's move, it's a mental cognitive dissonance, but I have to admit, they are doing something very right.<p>1) it's just JavaScript - winning some CoffeeScript fans<p>2) regular JavaScript is valid, (just like SCSS vs SASS)<p>3) it has day 1 interop with vanila JS (Dart just started, and until it has it, it's just a play-with language)<p>4) TypeScript support for most popular editors (Dart has mostly Eclipse I think, TypeScript has support for everything but eclipse, but an eclipse plugin is just a matter of time probably)<p>5) TypeScript has a bit more chance becoming a standard, (future ECMASCript 6?)<p>Well played Microsoft, didn't see it coming...<p>VS 2012 is actually nice, still I would probably wait for an Eclipse plugin (I'm sure someone out there is already working on it) but this is for me a big reason not to start learning Dart
评论 #4614625 未加载
评论 #4605960 未加载
ivanjovanovic超过 12 年前
The way I see it:<p>1. TypeScript is an answer to the poor state of JavaScript development today and an attempt to get more structure into it. There are other answers as well, and it can be discussed on properties of each of them, but they are competing in the same domain.<p>2. Since state of JavaScript is as it is, it is obvious that there is a lot of potential benefit in being a leader of the technology in that domain. Regarding that, it is kind of answer to forces that are trying to ensure domination in that domain for the future.
评论 #4603772 未加载
评论 #4602321 未加载
评论 #4602509 未加载
rbellio超过 12 年前
I've been testing it out and I like it so far. I personally don't enjoy writing JavaScript in text editors and the tools like PHPStorm, while being decent don't really give me the slick development environments that I've come to enjoy.<p>Since I do a lot of Windows and .NET web app development for my day job, I really enjoy the fact that Microsoft is putting a concerted effort into not only adding more support for JavaScript, but also for looking at the state of JavaScript and looking to improve the experience for people like me.<p>In Anders introduction to TypeScript, he mentions the gap between .NET development and JavaScript and hints that this is just the beginning of bridging that gap.<p>Rather than being a language that hides the underlying structure (a la ASP and ASP.NET) it is much closer to native JavaScript development. I'm really excited to see where this might go and have my fingers crossed that it only improves the state of JavaScript development.
benatkin超过 12 年前
The author ignores the fact that TypeScript is being heavily promoted by Microsoft. TypeScript isn't an experiment, but something Microsoft is trying to sell, along with their IDE. He starts it with a quote from a colleague rather than citing examples of people attacking TypeScript, as if it's a forgone conclusion that people have gone overboard on attacking it. I hate to see an argument for a programming language start with the author's persecution complex.
评论 #4602790 未加载
评论 #4632731 未加载
devgutt超过 12 年前
This is a ingenious move. A much smaller subset than CoffeeScript and still a sensitive and important one that probably will be incorporate at ECMAScript 6. If not, you still have your vanilla JS. I'm not sure with TypeScript will succeed, but I'm sure that this is the way to fix JS's problems.
bascule超过 12 年前
"What I like about TypeScript - so far - is that TypeScript’s static typing could enable better tooling with warning squiggles, easy statement completion, plus smart refactoring. You also get easy navigation around code, as well as find references, rename, and more."<p>RubyMine (by IntelliJ) can do all of that. Don't get me wrong, the refactoring support for statically typed languages is a <i>lot</i> better (e.g changing method signatures) but none of the examples he listed require one.
jmmcd超过 12 年前
This isn't exactly the right place, but I don't know where else to ask this.<p>When people argue for static types (whether optional as in TypeScript or mandatory), one of the main reasons is "tooling". Why?<p>I know that writing a "go to definition" function for your IDE is impossible to do 100% correctly, when types are dynamic. But I would've thought it'd be pretty easy to do a 99% implementation, which rarely fails if you don't deliberately write code to fool it. Right?
评论 #4603635 未加载
评论 #4603591 未加载
评论 #4604004 未加载
评论 #4604526 未加载
MatthewPhillips超过 12 年前
I agree with this. If it's nothing more than a forward-compatible superset of JavaScript, with <i>optional</i> static typing, it has a place in the world of JS target languages.
评论 #4602322 未加载
mistercow超过 12 年前
&#62;Dart interops with JavaScript...but it's not JS. It doesn't even use the JavaScript number type for example.<p>What is meant by this? As far as I know, the only way that you can use Dart in any browser currently is by compiling it to JS, and when you do that it most certainly does use native JS numbers. In fact, the type check function it creates for numbers contains this line:<p><pre><code> if (!(typeof value === 'number')) {</code></pre>
评论 #4602553 未加载
评论 #4602417 未加载
评论 #4603031 未加载
jconley超过 12 年前
The Typescript syntax looks shockingly like Adobe's ActionScript. Next up, Adobe releases an ActionScript to Javascript cross compiler?
评论 #4604485 未加载
评论 #4606848 未加载
nahname超过 12 年前
I have to build my entire project every time I want to update my client side code? That is an enormous tax to charge the developer just to add static typing to your client side code. I can't see this doing anything but slowing a team down.
评论 #4602171 未加载
评论 #4602213 未加载
评论 #4602185 未加载
评论 #4602199 未加载
评论 #4603026 未加载
cmccabe超过 12 年前
Seems like a troll article to me.<p>Of course people are comparing TypeScript to Dart. They do the same freaking thing-- provide you with a different way to write code to run in the browser.<p>Then he presents the metaphysical distinction between "building on JS" (good) versus "interop with JS" (bad). What's the difference? Neither language is JS. If something breaks, you're still going to be debugging code that isn't the code you wrote-- it's generated code.<p>I feel no better informed after reading this article than before. Will someone please do a straightforward comparison between Dart, TypeScript, and CoffeeScript? It might be kind of hard because as far as I can see, TypeScript does not build on Linux.<p>P.S. Is "it doesn't even use the JS numeric type" supposed to be a put-down of Dart? I always thought the JS numeric type was a big mistake. Who would want to be forced to use floats for everything? Inaccurate and slow-- two great tastes that taste great together.
评论 #4606211 未加载