atom feed11 messages in org.apache.incubator.callback-dev[Node 101] Part 1: Small Modules
FromSent OnAttachments
Brian LeRouxDec 12, 2013 3:05 pm 
Gord TannerDec 12, 2013 3:24 pm 
Brian LeRouxDec 12, 2013 3:34 pm 
Brian LeRouxDec 12, 2013 3:36 pm 
Gord TannerDec 12, 2013 3:59 pm 
Brian LeRouxDec 12, 2013 4:36 pm 
Patrick MuellerDec 15, 2013 8:45 am 
Brian LeRouxDec 15, 2013 5:08 pm 
Brian LeRouxDec 15, 2013 11:00 pm 
Patrick MuellerDec 16, 2013 4:49 am 
ShazronDec 16, 2013 9:49 am 
Subject:[Node 101] Part 1: Small Modules
From:Brian LeRoux (b@brian.io)
Date:Dec 12, 2013 3:05:39 pm
List:org.apache.incubator.callback-dev

Create modules that are the smallest possible unit of code. Less code is fast code. Faster to write. Faster to maintain. Faster to test. On the extreme end characters in the Node community such as Substack advocate a single function per module definition.

module.exports = function() { // my logic here }

This is kind of extreme and not always possible but a good practice nonetheless. The idea is not new. Its a part of the UNIX philosophy: "do one thing well" coined by Doug Mcilroy. [1]

It can help you make code that looks like this [2] into this [3].

[1] http://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html [2] https://github.com/apache/cordova-js/blob/c320378b484a172a02d3ee26634bcc584f43b939/Gruntfile.js [3] https://github.com/apache/cordova-js/blob/master/Gruntfile.js