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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HW: What is the state (for you) of CoffeeScript?

4 点作者 usernamebias大约 8 年前

3 条评论

uwu大约 8 年前
&gt; for you<p>a project i know uses coffeescript and i see it as an additional hoop for possible contributors who otherwise know the web platform to jump through<p>(i contributed to that project once and accidentally introduced a bug related to variable scoping...)<p>i think nowadays people should be writing es6+ javascript instead (won&#x27;t even need to transpile it in the future)
twobyfour大约 8 年前
Irrelevant. Never needed it, never wanted it. And I develop for web (full stack).
rraval大约 8 年前
For background, my startup has been using CoffeeScript since August 2012. A quick check of our git monorepo says that we have 130k lines of code at HEAD, and have probably thrown out at least as many lines in rewrites over the years.<p>I have a love&#x2F;hate relationship with CoffeeScript. I detest the implicit function call and object literal syntax. At various points in the language&#x27;s history, it seemed like the language was essentially &quot;done&quot; and in maintenance mode. Especially when the eco-system stagnates around it and large parts of the community move on to things like ES6 and TypeScript. For example, the JSX tool was essentially a prototype [1], with tons of bugs [2] that were never fixed. And in the 6 months since its deprecation, there isn&#x27;t a single tool to replace it.<p>Personally speaking, I consider the language dead and was considering alternatives so we could move off it. However, I still haven&#x27;t been able to justify it because the alternatives don&#x27;t make the same tradeoffs that make me love CoffeeScript:<p>- Minimal to zero runtime requirements. CoffeeScript generates a few things like `__extends` but that&#x27;s it!<p>- One to one correspondence with generated JS. Source maps are nice but it&#x27;s great to step through the JS debugger when looking at JS, and being able to convert the JS you&#x27;re looking at with the CoffeeScript that generated it is not something I want to give up.<p>- Recognizes the warts, fixes what it can, and then gets the hell out of the way. `==` in JS is a mistake and IMO no language should carry that forward. Lexical `this` binding shouldn&#x27;t require hoops to jump through. That sort of thing.<p>Ideally, if we are paying the cost of switching away from CoffeeScript, we&#x27;d move to a language with static type checking and solid support for sum types. I haven&#x27;t been able to find any such language though, and the recent development spurt in CoffeeScript seems to have staved off that need for now.<p>PS: Yes, I&#x27;m aware of TypeScript. It&#x27;s sum type support is rather weak. As part of my initial testing to see if it was a suitable language, I found a 5 line program that crashed at runtime. The bug report was closed as &quot;Working as intended&quot; [3]<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;jsdf&#x2F;coffee-react-transform" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsdf&#x2F;coffee-react-transform</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;jsdf&#x2F;coffee-react-transform&#x2F;issues&#x2F;62" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsdf&#x2F;coffee-react-transform&#x2F;issues&#x2F;62</a> [3] <a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;TypeScript&#x2F;issues&#x2F;13884" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;TypeScript&#x2F;issues&#x2F;13884</a>
评论 #14124221 未加载