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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

At some point, JavaScript got good

27 点作者 jonbeebe大约 1 年前

8 条评论

bhaak大约 1 年前
Better than before is not necessarily good. There are still lots of warts and gotchas.<p>In that regard JavaScript is a lot like C++. You can write pretty good C++ if you know what you are doing but the old ways are still possible and haunt you in legacy code.
评论 #40280607 未加载
austin-cheney大约 1 年前
This is something I have always found interesting. Most people cannot write JavaScript but think they can because the syntax looks familiar and then complain when the result is shit.<p>There is some hidden assumption this language should reflect some other language a given programmer is formerly trained in and then disappointed when JavaScript is not their favorite pet language. Further interesting is that there is no interest or investment in formal training in JavaScript, just assumptions and failed dreams.<p>In that spirit when people say <i>getting good</i> I usually take that to mean looking more like Java, C#, or whatever.
评论 #40258362 未加载
评论 #40313624 未加载
mst大约 1 年前
Block scoping has been -huge- for me.<p>ES6 &#x27;let&#x27; has very similar semantics to perl&#x27;s &#x27;my&#x27; and the absence of an equivalent elsewhere has always made me feel like I was missing a limb.<p>There&#x27;s currently a proposal (which I think looks likely to succeed) to add a &#x27;do BLOCK&#x27; syntax to ES6 as well, which is (now I get sane scoping) the top perl feature I miss All The Time when writing JS, and I can&#x27;t wait.<p>(in the cases of both ruby and python the function scoping seems to be a deliberate choice rather than an omission and I just Do Not Understand how it doesn&#x27;t bother people more)
评论 #40258613 未加载
Hammershaft大约 1 年前
I got less of a &quot;Javascript got good&quot;, and more of a &quot;Javascript got less unbearably bad&quot; from this article. It is still a travesty that Javascript. alone is the language of the web (sans transpilation).
评论 #40257615 未加载
jononomo大约 1 年前
I read the entire article based on the misconception that the title was &quot;At some point, JavaScript not good&quot;, which I thought was an amusing title, and also a pithy way to express what I&#x27;ve felt for a long time. So I read and read, expecting to get to the part where the author explains why JavaScript is not good at some point. But it never came.<p>I spent four years building an in-browser digital ad auction manager in JavaScript that truly bent my mind and that also delivered millions of dollars in ad revenue. You would think I would come away from that experience thinking &quot;I know JavaScript&quot;, but I instead I came away thinking &quot;That was hell, I never want to work in JavaScript again&quot;.<p>I worked on that project over the time period when ES6 was introduced and also later transitioned everything to TypeScript. I agree that things got better, but I still think that JavaScript is pathetic.
评论 #40257796 未加载
kaycey2022大约 1 年前
Literally 3 months back I would have disagreed with this article. Since that time I’ve been working on contract for a startup coding their backend from scratch in Typescript. The CTO&#x2F;advisor insisted on nodejs because that’s what he’s familiar with. When I started I didn’t know quite enough about modern Javascript, didn’t know anything about Typescript, about mongoose or deploying and scaling node apps on the cloud. About the only thing in my favour was that this is still a C style language with familiar syntax.<p>I decided to go with Nestjs since it sets up somethings for you out of the gate. I’m still not fully happy with that decision, but it is what it is. Btw, I don’t even know how to write tests for any of the code I wrote. I’m still figuring that out. We just needed quick and dirty code that we can test in real world. But we’re happy with this, admittedly shitty, backend for now while we have been testing it with our initial audience.<p>So now I’m leaving heavily on the author’s side that the modern JS ecosystem and the language itself is pretty good. It still requires quite a bit of sophistication to understand what is going on, but it isn’t a nightmare inducing mess that popular programming culture makes it out to be.<p>I don’t think a complete newbie would have been able to do what I’ve done over that last few months. You still need to check a lot of your expectations of the language and be careful. But quite a lot about this ecosystem and the tooling available is undeniably impressive.<p>I would just advise people not to fall for the “backend elitist” mentality that is so prevalent in the discourse and actually try things out for themselves.
JoeyBananas大约 1 年前
If Javascript is good, explain String.splice.
评论 #40280577 未加载
jillesvangurp大约 1 年前
I started using kotlin-js a few years ago. That was after using typescript in a project. Unlike typescript, kotlin-js is very unapologetically Kotlin first. It has some facilities to enable interfacing with javascript libraries (mainly the dynamic keyword) but mostly it&#x27;s just Kotlin. Which means things like refactoring works. The compiler stops you from deploying broken code. And it&#x27;s a nice language that is well suited for frontend development as demonstrated by its popularity on Android (and increasingly IOS via compose IOS).<p>I come from a Java background and have mostly done server side until a eight years ago when being in charge of a startup meant I could not be picky about what I did and had to be able to do all of it (web, server, devops, etc.). That started with me inheriting a javascript code base. As javascript codebases go, it wasn&#x27;t horrible but still pretty mediocre compared to what I was used to. No tests, obviously. And a lot of very verbose gibberish dealing with promises and what not.<p>I took the opportunity to learn typescript and migrated quite a bit of javascript code to that. I like typescript; it&#x27;s great. But it is a bit of a compromise in that all javascript is valid typescript. Meaning, you inherit all the ugliness and weirdness with typescript and you need to be careful with how you use it. But it&#x27;s a fine language and having a decent static type checker just wipes out whole categories of bugs that I don&#x27;t need in my life. I found plenty of those migrating the Javascript code. Or rather the compiler did. I just fixed them as it found them. Cheap success IMHO. The downside of migrating javascript code is that a lot of it is still javascript and you end up either replacing a lot of its ugliness or not touching it until you have to because, for example, it&#x27;s obviously broken or not right.<p>Fast forward a few years and another startup and I had a frontend developer whose only experience was Kotlin on Android. And I needed a webapp in a hurry and had no budget for bringing in re-enforcements. I considered doing react and typescript and training the person up. But instead, we evaluated using kotlin-js. Much to my surprise, this was actually pretty good. I had been using Kotlin server side for a few years and it obviously worked well on Android. But kotlin-js on the web felt risky. Yet a few weeks in we were getting kind of productive. We had integrated a few javascript libraries, picked a ui framework (fritz2) and my frontend developer was getting quite productive with it.<p>That was three years ago. That app still exists. As a technology choice it&#x27;s been great. It was definitely a wild ride though in terms of being an early adopter. We were dealing with a rapidly evolving library ecosystem (kotlin multi platform), compiler bugs, a complete compiler rewrite in several steps (2.0 RC2 was released a few days ago), and a lot of other things. However, life is pretty good doing kotlin-js these days. If you want a break from typescript, it&#x27;s well worth checking out. It would probably be considered cutting edge or risky in a lot of places. But it definitely worked well for us.
评论 #40258517 未加载