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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

For modern development, Javascript is just something you need to learn

84 点作者 timruffles超过 11 年前

23 条评论

jpgvm超过 11 年前
I&#x27;m sorry but I have to side with the JS is utter crap crowd.<p>The single redeeming feature of JS is that it&#x27;s implemented in all current browsers. If it wasn&#x27;t for that fact I doubt anyone would have cared much.<p>It&#x27;s just nowhere near as good as current alternatives for application development. Everything it can do another language can do better, except run in a browser - which is entirely out of control of the other languages so somewhat of a moot point.
评论 #6634204 未加载
评论 #6634250 未加载
评论 #6634022 未加载
nbevans超过 11 年前
&quot;The intrinsic smallness of the language can be alarming when you come from a bigger language (Ruby, Java)&quot;<p>Bad examples. Ruby and Java are small languages too, just like JS. This immediately calls into question the credentials of the author. Not a good start.<p>&quot;Null everywhere Attempting to access a property of a JS object that’s not defined gives you… undefined. If it’s important to your program that you know about this: write some code.&quot;<p>Or just, you know, use a better language?<p>&quot;‘Callback hell’ isn’t a problem for people who’ve written a lot of JS.&quot;<p>So that makes it okay then?<p>It&#x27;s just another article written by someone so immersed in their own little world that they can&#x27;t see the wood for the trees. The author probably thinks he has put together a nice a little counter-attack to that &quot;other&quot; article; but really he has just reinforced it.
评论 #6634010 未加载
评论 #6634048 未加载
评论 #6634071 未加载
评论 #6634762 未加载
sisk超过 11 年前
&quot;There is no need in this world for manual screwdrivers because a drill can do the same job with less work.&quot;<p>I don&#x27;t understand the vitriol. Is JavaScript perfect? No but I don&#x27;t think anyone has ever made that argument. Can you build web applications with it? Absolutely.<p>The fact of the matter is JS can run on more &quot;things&quot; than anything else. Period. This includes legacy systems. Don&#x27;t like the language? That&#x27;s totally fine and, to an extent, understandable. But, holy shit, it&#x27;s a highly accessible tool: learn it and stop complaining.<p>&quot;But there are better tools!&quot; Ok, that&#x27;s great, but those tools aren&#x27;t presently available in your toolbox. So write your own library to implement missing feature x. Syntax not terse enough for you? Write a preprocessor. Since you won&#x27;t be the first, a lot of the hard work has already been done for you. Consider publishing it. Do what every other developer doing anything on the web has had to do for years: improve your sandbox.<p>&quot;But these features should be standard!&quot; They&#x27;re not. Write the 3-5 lines to fix it and move on. Want to go the extra mile? Talk to the folks who run the show (the ecma folks).<p>Not happy with the tools? Fix them. Chromium and Firefox are OSS; write other runtimes into them. Push for their adoption. Does that seem like an insurmountable task? Then perhaps leverage what is available to you.<p>All of this religious debate is nonsense.
评论 #6634533 未加载
评论 #6634352 未加载
评论 #6634645 未加载
评论 #6634945 未加载
评论 #6634769 未加载
评论 #6634901 未加载
Pxtl超过 11 年前
I really don&#x27;t get all this rage at Javascript. Obviously it has flaws and warts, but I don&#x27;t see it as being <i>significantly</i> worse than other dynamically-typed languages. Yes, there are some misfeatures we&#x27;d all like to see ripped out and those provide some nasty gotchas. But once you learn the language it compares well to Python and Lua and other dynamically-typed C-ish-syntax languages.
chrismorgan超过 11 年前
There&#x27;s significant danger in the fact that people <i>don&#x27;t know that they need to learn it</i>. They just write what they know, and techniques that are actually supported across all browsers they&#x27;re supporting (with IE8 or hopefully IE10 being the minimum supported browser) lie unused for quite a few years. That these techniques <i>need</i> deep knowledge to make a solid result indicates a point of concern in the suitability of JavaScript for such things. Are ES5 and ES6 merely papering over the problems where a fresh-room approach might work better? (My answer: I frankly don&#x27;t know. In the very long term, replacing JavaScript might be a good thing, but it would wreak significant havoc for quite a few years and would be impressively difficult to orchestrate from the browser manufacturers&#x27; perspective.)<p>I&#x27;d still love to have the safety of a language like Rust for modern web development. At some point, someone will fix Emscripten support up for it, so then it&#x27;ll be comparatively alright. (I like the theory of the one-language-from-end-to-end approach, but I want it to be a safer language than JavaScript.)
CountHackulus超过 11 年前
Just saying that JS has a good debugger (it isn&#x27;t that good, really) isn&#x27;t nearly enough to counteract the original points about terrible exception handling. Exception handling isn&#x27;t just about fixing errors, it&#x27;s about controlling the flow of errors through your programs and handling them as best you can. Your customer doesn&#x27;t want to step into a debugger to see what went wrong, they just want a nice error message.
mariusz79超过 11 年前
Web applications are only small part or &quot;modern development&quot;, so no you don&#x27;t need to learn js. Unless you&#x27;re working on a &quot;cool, but ultimately useless&quot; web apps, JavaScript is useless.
评论 #6634089 未加载
badman_ting超过 11 年前
Javascript <i>is</i> shitty, though. I say this as someone who loves it, enjoys using it and understands it better than most. There are just some real undeniable fuck-ups in the design of the language. Don&#x27;t get all defensive about it, be honest.
cygwin98超过 11 年前
Stockholm syndrome? You have to use&#x2F;write Javascript doesn&#x27;t mean it isn&#x27;t bad.
Mikeb85超过 11 年前
Great article. While JS isn&#x27;t my favourite language, it has many redeeming features. For one, to get started, just open up a browser console, and have at it! No other language offers such a low barrier to entry. You can create a simple HTML file, run it strait from the browser, and voilà, you have a program.<p>Javascripts flexibility is why you see emulators, 3D games and simulations, everything written in Javascript. Every language compiles to Javascript, and you can edit code live in Javascript, having it render directly into the browser, without running a server, REPL, etc...<p>The main advantage of Javascript though is the freedom it gives to developers - you can be productive in it quickly, individual developers can get alot done with it in a short time, and it enables web apps to be created quickly.<p>Look at something like Firefox OS, how easy it is to script and develop for, and then you&#x27;ll understand why JS is great.
评论 #6634547 未加载
bayesianhorse超过 11 年前
For me, javascript is not a brilliant language designed and descended from heaven from God (or from Guido van Rossum), instead javascript is a political plattform.<p>It is currently the platform which is able to spread over the biggest range of devices because it evolved from an ongoing cooperation game.<p>This game isn&#x27;t sane, it&#x27;s not efficient and the result is a mess, but it&#x27;s our mess for the time being.
agentultra超过 11 年前
I&#x27;ve yet to find a function, <i>better</i>, which can apply even a partial ordering on language designs.<p>A lot of the same arguments against Javascript are heaped on C as well. I think anyone has used these languages long enough and understand them deeply enough are more than aware of their short-comings. It hasn&#x27;t stopped C programmers from writing the software that runs pretty much the entire world. Neither has it stopped Javascript programmers from making awesome things.<p>I think the argument that, <i>X is a crappy language because it lets you do stupid things like Y</i>, should be removed from the lexicon. I assume you&#x27;ve all seen the video of the <i>wat</i> talk and any Javascript programmer worth their salt has committed it to memory. If they haven&#x27;t then they&#x27;re either still new to the language or ignorant and could use some help. Maybe point them in Doug Crockford&#x27;s direction.<p>There&#x27;s no perfect defence against human error. It&#x27;s why we write tests, static analyzers, linters and come up with practices like code review and prayer (hah!).
romaniv超过 11 年前
<i>‘Callback hell’ isn’t a problem for people who’ve written a lot of JS.</i><p>I get the feeling that people who say this <i>write</i> a lot of JS, but don&#x27;t <i>read</i> a lot of JS written by others.
drderidder超过 11 年前
This was a really insightful response to a fairly typical neophyte language rant. I run a popular JavaScript meetup group and see a lot of JS devs trying to fit square pegs in round holes, struggling to make conceptual jumps from synchronous, O-O programming to a functional, continuation passing style. They gravitate to Promises or CoffeeScript, search endlessly for better control flow libraries, and try to write their own frameworks to make JS work like php&#x2F;ruby&#x2F;java, until eventually the light bulb goes on, and they get some of the concepts this article hit on. Thanks for posting.
nachoplatter超过 11 年前
&quot;The built-in option to check an object’s ‘type’ is instanceof, which looks at the function an object was created with.&quot;<p>Nitpick, because I happen to be teaching myself the Javascript class system right now: <i>instanceof</i> examines an object&#x27;s prototype inheritance, not its constructor. <i>x instanceof Y</i> if <i>x</i> inherits from <i>Y.prototype</i>, so it&#x27;s possible to &quot;sever&quot; an object from its constructor by replacing the constructor&#x27;s prototype property. Coming from a strongly typed language, this takes some getting used to!
patrickocoffeyo超过 11 年前
Javascript is a tool. The fact that it runs in a browser and on a server means that communication between the client and the server in a Javascript-based web application becomes a lot simpler. If you know how to use the tool, it will serve you well.<p>You can find things to gripe about in every language you&#x27;ll ever work with. Javascript is available. Use it and contribute to it&#x27;s community, or don&#x27;t. Griping is not contributing. It doesn&#x27;t solve any problems.<p>If you think Javascript could use improvement, write a library to help solve a specific problem or contact emca and report your problem&#x2F;issue&#x2F;idea-for-improvement.<p>Basically just stop complaining and start working. If you are of the opinion that Javascript is a horrible language that is bound to make your project un-maintainable and disgusting regardless of your expertise then choose a different language.<p>Off to write come C :)
lampe3超过 11 年前
To the Comments here: Why on HN is always so much hate? Because you don&#x27;t like Language X you have to say it in every post about it?<p>99% of the Comments are not about the Topic just about beliefs of other Commenters....
评论 #6634643 未加载
评论 #6634197 未加载
评论 #6634660 未加载
ksk超过 11 年前
JS might be a great language in isolation, but modern development or modern web development anyway.. in my experience wastes too many CPU cycles doing stuff that native applications were doing with higher performance years ago on some pentium 3..<p>Hopefully someone can solve the problem of distributing and updating native apps as smoothly as web apps (or websites, to be more accurate) with a minimal security impact and we can all go do some real &#x27;modern&#x27; programming.
kevinSuttle超过 11 年前
Regardless of technical quirks, if you don&#x27;t know JS, you can&#x27;t work on the web. Period.<p><a href="https://www.quora.com/Computer-Science/What-is-the-most-valuable-computer-programming-language-to-know-for-the-future-of-technology-and-why" rel="nofollow">https:&#x2F;&#x2F;www.quora.com&#x2F;Computer-Science&#x2F;What-is-the-most-valu...</a>
thinkpad20超过 11 年前
There are a few warts in javascript, but especially with &quot;the good parts&quot;, it&#x27;s really not that bad. Besides, it allows and encourages a lot of techniques which come from functional programming, which makes it a lot of fun for a functional programming hobbyist like me :)
DmitryKoterov超过 11 年前
How could one compare &quot;exception handling&quot; and &quot;debugging&quot;? They are two differed things. JS exceptions handling IS weak by design, no matter what debugger you are using. :)
CmonDev超过 11 年前
ES6 is a &#x27;future&#x27; development not &#x27;modern&#x27; development language. It has not been released yet and it is unknown when it will be fully implemented by all mainstream browsers.
评论 #6634172 未加载
rogerthis超过 11 年前
I vote this because the post layout is much better to read (I doubt people are going to understand my point).