{"id":26,"date":"2015-02-24T15:00:30","date_gmt":"2015-02-24T07:00:30","guid":{"rendered":"http:\/\/woohuiren.me\/blog\/?p=26"},"modified":"2015-02-24T15:07:40","modified_gmt":"2015-02-24T07:07:40","slug":"why-you-should-not-use-nodejs","status":"publish","type":"post","link":"https:\/\/woohuiren.me\/blog\/why-you-should-not-use-nodejs\/","title":{"rendered":"Why you should not use NodeJS"},"content":{"rendered":"<p>Hello everyone,<\/p>\n<p>I&#8217;ll be taking you through NodeJS from a different perspective. Currently, NodeJS is being &#8220;fanboyed&#8221; by tons of fanboys and have a lot of bias articles out there to promote the use of NodeJS. Therefore, I see a really strong need for this article to be written.<\/p>\n<p>Here&#8217;s\u00a0a brief introduction of how I knew about NodeJS. Words on the Internet spread really fast and I was told that NodeJS was great. At first, I believed the rumors. Then I used NodeJS and found it very easy to built web socket web pages through Express.js and Socket.IO. It was fine until I read through some of the NodeJS code and saw the horror&#8230;<\/p>\n<p>First off, you\u00a0will\u00a0need to answer this question,\u00a0why should you even use NodeJS? Most of you would answer\u00a0asynchronous Input\/Output capabilities provided through libuv. I would not consider that an advantage at all and would even consider it a sneaky move by NodeJS developers. Asynchronous I\/O is a &#8220;hack&#8221; to make NodeJS seems like it has multi-threading ability via &#8220;eventing&#8221; but as a matter of fact, NodeJS is single threaded. Some may argue that\u00a0the code\u00a0is executed through multi-threading at the C\/C++ level. However, they forget the fact that at the Javascript level, the code is still being executed through a single thread. Others argue that\u00a0NodeJS is more resource efficient\u00a0because it is single threaded but this comes with a great\u00a0drawback, it\u00a0will not scale\u00a0better than the\u00a0traditional thread-per-request model.<\/p>\n<p>So folks usually solve this &#8220;invisible&#8221; single threading problem by running multiple NodeJS servers within a physical server and then load balancing the traffic in between these NodeJS servers. This means that another web server, typically Nginx or Apache, has to come into place to proxy and do the load balancing! Hahaha, how hilarious and how stupid NodeJS is! Oh and some may also argue that multi-threaded code is incredibly hard to debug, I have to agree. Its definitely easier to write code than to read code, so leave that to the professionals at Apache to do it while NodeJS developers can continue writing their single threaded codes.<\/p>\n<p>There is absolutely no reason for you to use NodeJS, other than it being easy to execute web socket stuff. Other languages such as PHP, Ruby and Python can do that too but its slightly more difficult. It is not sane to sacrifice multi-threading functionality just for\u00a0the sake of convenience.<\/p>\n<p>By now, you should be able to observe and recognise that all of these problems are mainly caused by a single issue &#8211; the use of Javascript. Hence, NodeJS is definitely not &#8220;the future&#8221; as claimed by the NodeJS fanboys but rather, a fad that will die out as time passes by. However, this might change if NodeJS developers solve the above issues but that is almost impossible as of now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone, I&#8217;ll be taking you through NodeJS from a different perspective. Currently, NodeJS is being &#8220;fanboyed&#8221; by tons of fanboys and have a lot of bias articles out there to promote the use of NodeJS. Therefore, I see a really strong need for this article to be written. Here&#8217;s\u00a0a brief introduction of how I &hellip; <a href=\"https:\/\/woohuiren.me\/blog\/why-you-should-not-use-nodejs\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Why you should not use NodeJS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":28,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2,4,5],"tags":[23,26,25,24],"class_list":["post-26","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-information-technology","category-it-softwares","category-programming","tag-nodejs","tag-nodejs-fad","tag-nodejs-fanboy","tag-sucks","post_format-post-format-image"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2015\/02\/node-js.png?fit=500%2C374&ssl=1","_links":{"self":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/26"}],"collection":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":2,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":30,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/26\/revisions\/30"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media\/28"}],"wp:attachment":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}