cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian>
Subject [Node 101] Part 1: Small Modules
Date Thu, 12 Dec 2013 23:06:02 GMT
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].


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message