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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why Node.js?

13 点作者 mahadazad将近 10 年前
I am a developer with a very strong PHP background. Experience over 5-6 years in PHP and related technologies.<p>For the past 6 months or so I have been totally working with nodejs and its eco-system. I do agree its blazing fast and has a very good eco-system. But I really don&#x27;t believe that it is that much strong in web-development. I guess the only stable web framework is Express. But you have to do alot in it to achieve things. After researching I found Sails.js is gaining popularity and has many features out of the box. But after trying it for a month or so, I found that its very much buggy. The thing that works on my local environment does not work in production, however it has the same technology stack with same versions.<p>npm packages are outdated, dependencies not updated. I wonder why there is so much hype about nodejs and what it is really good at?<p>What would you say?

10 条评论

TurboHaskal将近 10 年前
Oh there are many benefits:<p>- Need any specific feature? Just give NPM a quick search and you&#x27;ll find not one, but a dozen half-assed implementations. The wide range of unfinished, poorly tested, not-invented-here packages giving the impression of a pragmatic and vivid community guarantees that the platform won&#x27;t lose its momentum anytime soon. I mean just look at <a href="http:&#x2F;&#x2F;www.modulecounts.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.modulecounts.com&#x2F;</a><p>- It has a Windows installer so it works on Windows. Guaranteed!<p>- Significant pool of young, cheap and over-motivated developers that are yet to experience burnout. Not having to deal with employees&#x27; family responsibilities or that COBOL dinosaur who just happened to forget his own cubicle number is a big plus.<p>- Running the same language on the server and the browser means you won&#x27;t ever have to learn another language. Sans the language that compiles to JavaScript of the month, of course.
dugword将近 10 年前
I think there are several great reasons to use Node.js.<p>First, JavaScript is a darned good language. It has some quirks, and some down right awful parts. But they are easily avoided, and often can be automatically detected by static analysis tools like JSLint, JSHint, etc.<p>Lexically scoped anonymous functions, closures, first-class functions, immediately invoked function expressions, object literals, dynamic objects, are all magical once you twist your brain into really understand how to program in that paradigm.<p>And yes, other programming languages have combinations of these features and maybe implement them better. But if you look at the other most popular programming languages (<a href="http:&#x2F;&#x2F;www.tiobe.com&#x2F;index.php&#x2F;content&#x2F;paperinfo&#x2F;tpci&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;www.tiobe.com&#x2F;index.php&#x2F;content&#x2F;paperinfo&#x2F;tpci&#x2F;index....</a>) JavaScript is really it for this sort of dynamic, functional-esque style programming.<p>And popularity matters when you are looking for support, documentation, or libraries to interact with other systems.<p>Secondly, asynchronous event driven programming is a truly powerful model. And while you can do event driven programming in any language. Node.js treats it as a first class citizen, with it&#x27;s standard lib implemented as non-blocking with callbacks.<p>But what really makes Node.js so awesome is the marriage of it&#x27;s dynamic nature with the event driven model. They just work so well together. Passing functions as callbacks for events just works so elegantly compared to how&#x27;d you have to do that in other languages. Building out constructs like promises or event emitters is trivial because JavaScript is so flexible.<p>I think Node.js gets shoehorned into doing a lot of work where maybe it doesn&#x27;t make sense. I still use Perl&#x2F;Python for CLI scripts. But for distributed network applications, Node.js makes solving a lot of problems way easier.
justus_将近 10 年前
I still believe a lot of the hype for node comes from the absurdly large number of js-only or virtually js-only developers who enjoy the idea of using the language they have grown so familiar with everywhere where possible.<p>The trend gets accelerated because most new programmers start with javascript, or soon switch to javascript because they see it as the one language they can do &quot;the most&quot; with.<p>The fresh blood is, due to being new to programming, very explorative and curious about platforms and such drive the use of (back then) experimental tools up a lot.<p>I personally think that both PHP as well as javascript suffer from being designed not just with flat-out bad syntax, but also for a rather narrow use case and then being adopted widely for lack of widespread availability of other tools.<p>As a result they are used in places they were not expected to be used and for systems of scale that they were not intended to handle.<p>The backend of the future may run with node or it may run with PHP, I hope for neither. There are languages out there with more powerful and safer abstractions, with more carefully designed APIs and standard libraries that do not just clutter the global namespace, with usable import functionality from the get go and with type checking and -inference.<p>But that&#x27;s just my two cents, I could be wrong :)
评论 #10010101 未加载
anonyfox将近 10 年前
The best &quot;framework&quot; node.js has to offer is Meteor. Nothing beats Meteor for rapid prototyping so far.<p>Node was the next big thing a few years ago, I was an evangelist by myself. Today, drawbacks and backlashes appear more and more... so if you plan to reorganize yourself or some products to node, you may just skip it.<p>I&#x27;m personally betting on elixir for everything that is related to &quot;server&quot; or &quot;service&quot;, and Rust for when you have to be very close to the metal (or providing an optimized native function to elixir).<p>Using &quot;universal&quot;&#x2F;&quot;isomorphic&quot; JS to build everything everywhere sounds good on paper and feels exciting at the beginning, but later you have to deal with these mountains of layers of wobbly code, when stuff begins to break badly. Not to mention that JS becomes an ugly beast of a language, crammed with loads of useful features without a thoughtful foundation. But, this is just my experience.
评论 #10010138 未加载
ksherlock将近 10 年前
It&#x27;s really good at generating hype...<p>Like PHP, it lowers the barriers for entry, so you get a lot of new users that aren&#x27;t aware of any CS prior to 2005 or so. But they like to write blogs and you like to hang out on blog aggregator websites.
risyasin将近 10 年前
Honestly my situation is similar to yours. Using PHP for web applications mostly more than 8 years. I had many frustration with PHP over the years, but it has a quite strong community &amp; mature documentation, millions of code samples. a dozen of giant MVC frameworks that some of them are famous as PHP itself. what my problem in getting started with Nodejs was lack of understanding JS&#x27;s basics not even Nodejs itself (yea i was really blind &amp; fool but i was thinking that i knew JS) i was reading source codes of famous libraries in Nodejs. Quickly I have seen my problem. i didn&#x27;t knew JS even though i was using it more than 8 years. i was unable to understand even the basic libraries or frameworks. That moment was an illumination for me. then i started to learn JS in real. i&#x27;ve read the famous JS books during 6 months. with the decision of never try to code before fully understand. that was my leap for being a better developer (it worked even for my PHP knowledge) by the way i still read the books :)<p>After that 2 years i have developed more than 5 projects with nodejs. i still don&#x27;t have a stable MVC structure for expressjs (not like SF2 or ZF2 etc.) keep changing it every project, improving. but it&#x27;s a nice journey to learn something new when you are 36 years old. now i have quite stable vision&#x2F;exprience right before starting a project while planning. Already started to use task runners grunt&#x2F;gulp, actually i have developed a deployment app with nodejs &amp; connected it with my own git server. i work way professional &amp; efficient than before. My humble advice is read the source codes of Express.js Sails.js maybe even Backbone.js then see if there is any black spot in your understanding. (if not that&#x27;s nice of you :) ) Node.js is upto something very nice for all web developers.
评论 #10017988 未加载
avoidwork将近 10 年前
What you&#x27;re describing now is how php was in the early years. I started using it with 2.0, just after it upgraded from perl scripts. It&#x27;s pretty different ~15yr later (I think it&#x27;s going on 20 now). Give node some time to mature.<p>There&#x27;s a lot more to node than express; that&#x27;s like the jquery of node.js.... every one uses it, and usually not very well.
bricss将近 10 年前
Try to read this -&gt; <a href="https:&#x2F;&#x2F;www.paypal-engineering.com&#x2F;2013&#x2F;11&#x2F;22&#x2F;node-js-at-paypal&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.paypal-engineering.com&#x2F;2013&#x2F;11&#x2F;22&#x2F;node-js-at-pay...</a><p>And take a look at this -&gt; <a href="http:&#x2F;&#x2F;hapijs.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;hapijs.com&#x2F;</a>
thamizharasu将近 10 年前
I have no experience with Sails.js But I worked with Meteor.js framework.<p>I spent a little time to understand the framework and was able to develop a web application quickly. May be you can try that.<p>I have planned to post some regular blog posts &#x2F; videos on my blog (h2labz.blogspot.com) in the future.
romanovcode将近 10 年前
Because it&#x27;s super hyped and your managers force you to use it.