Undoubtedly, this is a good article on javascript and related good practice, and it expained a lot of concepts in easy words. But I think some of its parts worth further discussions.
1. Should parallel be an explicit attribute/mechanism when used? Such as when lock mechanism is used in thread-programming.
Alejandro Hernandez provided a piece of snippet as an simple example for parallel.
db.query("SELECT * FROM 'table'", function(resultset){
drawTable(resultset);
});
doSomeThingElse();
In this snippet, Even though the function db.query blocks, the execution of the code would be able to go on to the next statement outside of db.query. So the doSomeThingElse(); can be executed without any delay. This is what parallel here means. But the snippet here can bring a confusion to programmers.
Block and parallel are two different mechanisms. So when a programmer sees a piece of code like this, he is probably not sure what would happen when it blocks. If he is unfamiliar with the code, nothing could tell him about the handling mechanism on blocking related to this piece of code. He simple doesn't know if the execution would go on or pauses.
Further more, the event-polling mechanism itself could be time-consuming or resource-consuming. So it's something that should be paused or ended under certain conditions. The conditions could be various and quite different in different environment. This might mean, that the event loop mechanism of Javascript need to be extended a lot in real world. In other words, you need your own scheduler. I'm not sure how Javascript could help developers face this challenge.
It is good that Javascript could provide a light-weighted event loop or scheduler mechanism that's already handy or built-in. But it's better if programmers could use an existed library or write their own library to do the non-blocking jobs for flexibility. And, without underlying interfaces that Javascript could provide, programmers cannot finish this job easily.
2. The title of this article.
If it is called something like "fully-equipped javascript" instead of "Full-Stack JavaScript", it might be better.
In the end, put a comment I saw from Christopher Probst:
"Python for instance has very nice async support using gevent (no callback hell - coroutine based) or twisted. And everybody knows that callback based I/O is just horrible. Ever heard of haskell ? Async I/O done right!"
http://chetansurpur.com/blog/2010/10/why-node-js-is-totally-awesome.html
Ever heard of haskell ? Async I/O done right!
Original articles:
English:
An Introduction To Full-Stack JavaScript:
http://coding.smashingmagazine.com/2013/11/21/introduction-to-full-stack-javascript/
Chinese:
全栈式 JavaScript 介绍:
http://segmentfault.com/a/1190000000355221
related:
Part 1: Understanding event loops and writing great code for Node.js:
http://developer.yahoo.com/blogs/ydn/part-1-understanding-event-loops-writing-great-code-11401.html
A Curious Course on Coroutines and Concurrency
http://www.dabeaz.com/coroutines/
Coroutines via Enhanced Generators:
http://www.python.org/dev/peps/pep-0342/
相关推荐
Using Vapor, we will build a full-stack web application that will act as an API server for our iOS and tvOS app, and will also be our web server, which will render a web view of our app. Several ...
Then, we will move on to the frontend, where you will be introduced to React, a modern JavaScript library for building fast and reliable user interfaces, and its app development environment and ...
Hands-On Full-Stack Development with Swift 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Full-Stack Vue.js 2 and Laravel 5 Bring the frontend and backend together with Vue, Vuex, and Laravel 原版转换,目录完美.
Full-Stack Vue.js 2 and Laravel 5 Bring the frontend and backend together with Vue, Vuex, and Laravel 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网...
If MEAN demonstrated just how effective combining JavaScript frameworks and tools could be for the modern web developer, by replacing Angular with React, developers have an easier way to build ...
redis-stack-server-7.2.0-v9.arm64.snap redis-stack-server-7.2.0-v9.bionic.arm64.tar.gz redis-stack-server-7.2.0-v9.bionic.x86_64.tar.gz redis-stack-server-7.2.0-v9.bullseye.x86_64.tar.gz redis-stack-...
Explore the techniques involved in creating a full stack app by going through a methodical approach. Learn to add CRUD functionalities and use Material UI in the user interface to make it more user-...
MEVN 全栈开发(MongoDB + Express + Vue + NODEJS)
Go Web Development Cookbook Build full-stack web applications with Go 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
详细介绍用EC6+构建Apps,使用React开发SPA应用,用create-react-app安装项目、Redux、React Router、TypeScript, Node用Express和GraphQL开发WEB服务等内容。
Bacnet-stack-0.8.0 是一个针对BACnet协议的开源实现,适用于各种嵌入式设备。这个版本的堆栈(stack)是0.8.0,它旨在为不同平台提供支持,包括Linux、Windows 32位系统、PIC微控制器以及ARM7架构的处理器。BACnet...
Go Web Development Cookbook Build full-stack web applications with Go 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Go Web Development Cookbook Build full-stack web applications with Go_Code 源码 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Agile Data Science 2.0 Building Full-Stack Data Analytics Applications with Spark 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者...
### Android NDK-Stack 使用说明 #### 一、概述 在使用Cocos2d-x、JNI及Android NDK进行开发时,经常会遇到调试困难的问题。尤其是对于C/C++代码的调试,由于涉及到本地代码与Java层之间的交互,使得调试过程变得...