Friday, April 17, 2015

Where all Good Software Goes to Die

TL;DR

My local NodeJS build started breaking. It caused me heartache (and is no doubt affecting others). I learned that it was because some employees at Joyent--the company that took ownership of NodeJS--ticked off core NodeJS software engineers; They left to form a new truly open source software package called IOJS (that's a fork of NodeJS and now is far better than NodeJS).

Where does all good software go to die?

Corporations that put politics, political correctness, and profits ahead of creating great software.

Here are a few examples:
  • Oracle - MySQL
  • Oracle - OpenOffice
  • Joyent - NodeJS

There are no doubt many more, but these are the ones that percolate to the top of my mind.

Decline in Interest in MySQL

Interest peaked before Oracle acquired MySQL:


MySQL was left to the roadside, usually, since it was considered a useless appendage that prevents people from using the Oracle DB software. There were several community blunders (not making source public, not accepting patches, long-standing bugs with existing patches, etc) that forced MySQL guys to move to MariaDB. There was a big renaissance after the move, with many new features added and many bugs fixed. Sort of like the party when the house drops on the witch in the Wizard of Oz.
~ reddit

LibreOffice Forked from OpenOffice

Interest peaked before Oracle acquired OpenOffice:



OpenOffice. Oracle botched this so hard. No patches accepted, no timelines, no community communication. Oracle only paid attention to Fortune 500 contributors. Eventually, OpenOffice heads formed a foundation to start correcting some of these compounded issues. Oracle responded by kicking the members out of the project, telling them they couldn't use the OpenOffice trademark, etc. So all the experts left and formed LibreOffice. Another renaissance was had, and many long-standing issues were fixed. Code was maintained. The LibreOffice guys now regularly publish updates, statistics, reports, etc. It's a great example of how a professional FOSS project should be.
~ reddit

Number of NodeJS Releases

The following chart shows the number of stable NodeJS releases, per year:



The rest of this article will focus on NodeJS.

Implications

The number of stable releases of a software package is a good indication of its health.

It's clear that NodeJS should be in the ER. STAT.

As with other open source projects, a decline in the number of stable releases immediately precedes a major decline in public interest in it.

Common Thread

Mostly poor management decisions caused the best software development talent to leave the project, which directly related to the decline in that software's quality, interest and significance in the industry.

Joyent Calls Prolific NodeJS Contributor an "Asshole"

I'm not making this up. Seriously, I'm not.

Read it for yourself here.

First, it would help to understand how software development works using the Git Workflow that NodeJS was using.

I explained the pertinent part of it in this snippet from this post.
  • Developer creates feature branch, commits file changes and then submits a Pull Request
  • Other developers are notified of Pull Request, perform code review and the last one merges the feature branch to master


  Here's what happened:
  1. A code reviewer noticed that Ben Noordhuis wrote the pronoun, "him", a few times instead of "him/her" or "them", in an inline comment that described part of the NodeJS logic and submitted a Pull Request (PR) to change the pronouns. See patch here.
  2. Ben rejected the PR, providing this comment: "Sorry, not interested in trivial changes like that."
  3. A shit storm of bullying comments ensued from, "...always assumed to be male first on the internet. I'm +1 on this documentation change." to the more direct, "Stop pissing around and merge the damn PR."
  4. Some other contributor undeleted the trivial pronoun-changing PR and force pushed it.
  5. A stream of praise was given to that committer that pushed the PR to replace "him" with "them", e.g., "I believe these kinds of things do make a difference. Same for speakers, presenters, organisers etc. at events making an effort to e.g. switch between gendered pronouns (because yes, for many this is indeed still an effort, and probably even more so for non-native speakers of English, who are often not so aware of the finer points of the language or "accepted" alternative ways to express things). I'm always happy when someone does this!"
  6. Ben left the NodeJS community to help form IO.JS (an improved version of NodeJS) and is back to being highly productive.
  7. Joyent calls Ben an "asshole".


Cyberbullying

Cyberbullying is a global term that means the harassment of someone by use of electronic media, usually but not always social media.

The Thread That Took Down NodeJS

Whoever said NodeJS was fault tollerant was wrong.



Can you find any technical merit in any of the above (un-edited) comments?

Does that sort of dialog belong in a source code repository?

How does any of that help Joyent sell more NodeJS services?

There is a clear lack of vision from the technical management team at Joyent.

Here it is in it's entirety: https://github.com/joyent/libuv/pull/1015#issuecomment-29568172

Joyent's behavior (lack of leadership/poor management practices) has replaced NodeJS core contributors with individuals that are obviiously more interested in the proper use of pronouns in comments than improving what matters, the NodeJS software.

Is NodeJS doomed to the same fate as other similar, significant open source software products?

Joyent and the Future of NodeJS


Currently, it's not clear what will become of NodeJS.

NodeJS' corporate owner, Joyent, is apparently still at awe with its "progessive views" as it continues to publish an article that calls one of NodeJS' most talented contributors an "asshole".

Technically minded, merit-based software engineers are going to have a hard time getting behind a company that pushes its social agenda ahead of software development.

The vast majority of NodeJS' core developers left the NodeJS community to form IO.JS

Joyent is making the appearance of mending fences, but time will tell ...

You can read the active dialog in the Reconciliation Proposal thread.

But the task force may find it difficult to reconcile with reasoning like the following from the IOJS community:

i'd rather not reconcile. the benefits are not substantial, and i'm very happy with how iojs has been run. i don't want iojs to change organizationally in the name of reconciliation. for me, iojs' organization is an ultimatum. i don't really care about naming and recognition. i'd rather just start pushing #!/usr/bin/env iojs and iojs-only (specifically, ES6+) support everywhere.

MIT License

There is a big difference. Node is MIT. And other companies with power and interest in node could simply fork if Joyent were to act foolishly. ~ Tim Caswell

For details, see Joyent & Node

JSDOM

One of the major components in most of my current front-end application architectures is JSDOM.

JSDOM is the first component in my stack to formally declare a divergence from NodeJS.

Here's what it says at the top of their README:

Note that as of our 4.0.0 release, jsdom no longer works with Node.js™, and instead requires io.js. You are still welcome to install a release in the 3.x series if you use Node.js™.


Available ES6 features in IO.JS

The following list of features are available without using any flags:

  • Block scoping (let, const)
  • Collections (Map, WeakMap, Set, WeakSet)
  • Generators
  • Binary and Octal literals
  • Promises
  • New String methods
  • Symbols
  • Template strings


Those ES6 features are very important. I'm sure I'll blog more about them in the future.

When the other NodeJS dependencies (besides JSDOM) support IO.JS I'll jump ship.

Personal Value Driven Decisions

I chose to move from MySQL to PostgreSQL

I chose to drop OpenOffice in favor of LibreOffice

I will very likely drop NodeJS in favor of IO.JS  

The NodeJS Debacle - Lessons Learned for CTOs

Here are some suggestions, if implemented, could help with some issues of software development, socially aware employees and profitability:
  • Retain your real talent
  • Streamline software development governance
  • Do not allow the political correctness dept, finance dept., etc. to make decisions that impact software quality
  • Keep politics and social agendas out of your Git Workflow
  • Create an internal social media site for your writers and comment editors to discuss their non-technical beliefs
  • Hire a management team that can reconcile all time spent (X) to the question, "Does X help us sell more product?"

When you perceive that one of your software vendors is offering more and more discounts (frequently in the form of a recurring revenue scheme), you should look into the technical viability of the product being pushed.

If there is another open source alternative that has sprung out of the discontent of the lead developers of the software you're considering (or have been sold), beware.


Personal Opinion

I think that Joyent will continue to take the lead in gender-neutral-pronoun political correctness.

NodeJS may have the most politically correct, properly conjugated documentation, but that's not important to me.

What is important is being able to rely on the current and future stability of my software platform.

I bet that the interest curve and hence the viability of NodeJS is going to take a much steeper dive into insignificance than either MySQL or OpenOffice.

I personally applaud Ben for his professionalism and technical and social contributions.

I see the IOJS / NodeJS situation as a David / Goliath story.

It's only a matter of time before Joyent and its flagship product, NodeJS, fall to the feet of IOJS.

Reality and Drama

Money talks.

So, here's what I think is going to happen:
  1. Joyent financial backers will soon understand why their cash cow is dying
  2. Joyent's management team will replaced
  3. The real talent(s) behind NodeJS (doing IOJS development) will be offered a deal and we may soon see an announcement like, "Joyent's core business (cloud computing) aligns well with a free and open IO.js."
Will the IOJS talent(s) take the hush money and be good boys or retain their dignity?





References


Share this article



This work is licensed under the Creative Commons Attribution 3.0 Unported License.

Automatic Semicolon Insertion in Javascript

You can write (mostly) semi-colon-less Javascript code. See example below.

However, there is a significant performance impact for doing so. See example below.



ASI performance is abysmal

A bug was created on 2013-01-24 and assigned to nobody. See Bug 107901: ASI performance is abysmal

Summary

IMHO - Perhaps, one day ASI performance will become a priority and the hit won't be significant, but until then keep using semicolons.

Share this article



Share this article



This work is licensed under the Creative Commons Attribution 3.0 Unported License.

Wednesday, April 15, 2015

Cleanly Install NVM, NODE and NPM

Today, while I was installing a debugger for Node the install failed.

That made me take a long look at how I installed node, npm and nvm.

Here's what I decided:

Node comes with it's own package manager. It's called npm.

Brew is an awesome package manager for software you install on a mac, but should not be used to install node.

I had a bunch of cruft left over from previous installs of node, npm and nvm; Some of which was getting in the way of cleanly installing node, npm and nvm.

So, I wrote a bash script that does the following:
  • Remove previous installation cruft
  • Use brew to install nvm
  • Use nvm to install node (with also installs npm)

Here it is:

install-nvm-npm-node


# filename:  install-nvm-npm-node
# author:    Lex Sheehan
# purpose:   To cleanly install NVM, NODE and NPM
# dependencies:  brew

NOW=$(date +%x\ %H:%M:%S)
CR=$'\n'
REV=$(tput rev)
OFF=$(tput sgr0)
BACKUP_DIR=$HOME/backups/nvm-npm-bower-caches/$NOW
MY_NAME=$(basename $0)
NODE_VER_TO_INSTALL=$1
if [ "$NODE_VER_TO_INSTALL" == "" ]; then
    NODE_VER_TO_INSTALL=v0.12.2
fi
if [ "`echo "$NODE_VER_TO_INSTALL" | cut -c1-1`" != "v" ]; then
    echo """$CR""Usage:   $ $MY_NAME "
    echo "Example: $ $MY_NAME v0.12.1"
    echo "Example: $ $MY_NAME $CR"
    exit 1
fi
echo """$CR""First, run:  $ brew update"
echo "Likely, you'll need to do what it suggests."
echo "Likely, you'll need to run: $ brew update$CR"
echo "To install latest node version, run the following command to get the latest version:  $ nvm ls-remote"
echo "... and pass the version number you want as the only param to $MY_NAME. $CR"
echo "Are you ready to install the latest version of nvm and npm and node version $NODE_VER_TO_INSTALL ?$CR"
echo "Press CTL+C to exit --or-- Enter to continue..."
read x

echo """$REV""Uninstalling nvm...$CR$OFF"
# Making backups, but in all likelyhood you'll just reinstall them (and won't need these backups)
if [ ! -d "$BACKUP_DIR" ]; then 
    echo "Creating directory to store $HOME/.nvm .npm and .bower cache backups: $BACKUP_DIR"
    mkdir -p $BACKUP_DIR
fi 
set -x
mv $HOME/.nvm   $BACKUP_DIR  2>/dev/null
mv $HOME/.npm   $BACKUP_DIR  2>/dev/null
mv $HOME/.bower $BACKUP_DIR  2>/dev/null
{ set +x; } &>/dev/null

echo "$REV""$CR""Uninstalling node...$CR$OFF"
echo "Enter your password to remove user some node-related /usr/local directories"
set -x
sudo rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/lib/node
rm -rf /usr/local/include/node
rm -rf /usr/local/include/node_modules
rm /usr/local/bin/npm
rm /usr/local/lib/dtrace/node.d
rm -rf $HOME/.node
rm -rf $HOME/.node-gyp
rm /opt/local/bin/node
rm /opt/local/include/node
rm -rf /opt/local/lib/node_modules
rm -rf /usr/local/Cellar/nvm
brew uninstall node 2>/dev/null
{ set +x; } &>/dev/null

echo "$REV""$CR""Installing nvm...$CR$OFF"

echo "++brew install nvm"
brew install nvm 
echo '$(brew --prefix nvm)/nvm.sh'
source $(brew --prefix nvm)/nvm.sh

echo "$REV""$CR""Insert the following line in your startup script (ex: $HOME/.bashrc):$CR$OFF"
echo "export NVM_DIR=\"\$(brew --prefix nvm)\"; [ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"$CR"
NVM_DIR="$(brew --prefix nvm)"

echo """$CR""Using nvm install node...$CR"
echo "++ nvm install $NODE_VER_TO_INSTALL"
nvm install $NODE_VER_TO_INSTALL
NODE_BINARY_PATH="`find /usr/local/Cellar/nvm -name node -type d|head -n 1`/$NODE_VER_TO_INSTALL/bin"
echo "$REV""$CR""Insert the following line in your startup script (ex: $HOME/.bashrc) and then restart your shell:$CR$OFF"
echo "export PATH=\$PATH:$NODE_BINARY_PATH:$HOME/.node/bin"

echo """$CR""Upgrading npm...$CR"
echo '++ install -g npm@latest'
npm install -g npm@latest
{ set +x; } &>/dev/null
echo "$REV""$CR""Insert following line in your $HOME/.npmrc file:$OFF"
echo """$CR""prefix=$HOME/.node$CR"
echo "Now, all is likley well if you can run the following without errors:  npm install -g grunt-cli$CR"
echo "Other recommended global installs: bower, gulp, yo, node-inspector$CR"


References

https://www.npmjs.com/
https://nodejs.org/
https://github.com/creationix/nvm
Gist for install-nvm-npm-node (that I might update)


Share this article



This work is licensed under the Creative Commons Attribution 3.0 Unported License.