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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

TypeScript sucked out much of the joy I had writing JavaScript

26 点作者 EastSmith大约 2 年前

8 条评论

smt88大约 2 年前
I feel the exact opposite. It changed JS from a language I loathe to one I really like. There are no other mainstream languages with a similar type system, which means it&#x27;s uniquely easy to do very complex things with type safety.<p>Even Rust is still nominally typed, which means you have a lot more boilerplate.
评论 #35856723 未加载
turtleyacht大约 2 年前
Anyone try out the tenets in <i>Reliable Javascript</i> (2015), pre-Typescript?<p>The authors praise--and begin with an example from--D3.js, and work through handrolled dependency injection, aspects, and test-driven development with Jasmine.<p>Truly understanding `this`, .bind, .apply, and .call may be essential to a mastery of (vanilla) Javascript.
评论 #35857385 未加载
agency大约 2 年前
Never have I related less with a take. TypeScript has elevated a truly mediocre language to being the one I am most productive in because its type system strikes such a nice balance. Where is the joy in looking at a variable named `opts` and having no clue what properties it can have?
russellbeattie大约 2 年前
This is the same typed vs. untyped argument which is as old as vi vs. emacs. Different devs have different requirements and preferences. Neither is &quot;wrong&quot;. Some people are just naturally anal retentive pedants who must know their code is correct while writing it, even if it means downloading 500mb of build tools and requiring a jury rigged non-standard transpilation step for it to run. The fact that there&#x27;s not a single example of a well written non-bloated open source project that uses TypeScript won&#x27;t put them off, and that&#x27;s perfectly OK! To each their own! Having yet another flame war about it, no matter how deluded many devs are, is just unproductive.
MatthiasPortzel大约 2 年前
Rather than defend JavaScript, I just want to say that learning Ruby, and Rails, to me was an amazing experience. I&#x27;ve always enjoyed programming, and I&#x27;ve always preferred loosely typed languages, it was really fun to learn Ruby+Rails because it sets out to maximize the amount of joy that you can have writing code. That mindset is normally constrained to people writing hobby projects in uncommon languages. I think Rails is unmatched in striking a balance between code that is fun to write, and yet extremely productive.<p>(For those who don&#x27;t know, the tweet author is the Rails creator.)
rektide大约 2 年前
Writing TypeScript can be a bit hard or difficult at times. You can definitely get sucked into battles trying to figure out a lot of dumb shit that obviously works great but that you need to contort to something TypeScript can grok. Some of the errors it complains about are awful.<p>But on the other side, writing code consuming TypeScript libraries is amazing. Seeing all the type information in the IDE reveals so much, resolves so many questions, and builds confidence so quickly.<p>The other issue with TypeScript is that tooling is all awful &amp; terrible. Tsconfig is a drag. There&#x27;s a serious lack of good conventions to follow &amp; tons of ad-hoc stringing shit together. Ideally libraries should output both esm &amp; cjs but typescript literally doesn&#x27;t support it &amp; you have to run typescript twice, so now you maybe are introducing yet more new tools like concurrently if you want to do a good job. Oh and now your &quot;watch&quot; script is even more janked up too. Deno does a good job of making this pain all go away, but in general TypeScript is one of multiple layers of tooling that simply sucks, that thieves energy &amp; attention.
baddevtool大约 2 年前
“I can’t pretend my shitty code actually works and get pissy when my coworkers don’t intuitively understand the garbage I’ve written”
Existenceblinks大约 2 年前
General response to this is assuming the contrarians don&#x27;t like type or see no type benefit. But there are those who love static typing enough to dislike Typescript. It&#x27;s ugly and unsound, how could someone loves static type to death likes Typescript.