clean code comments edit

I was listening to The Tim Ferris Show with David “DHH” Heinemeier Hansson this weekend. DHH is the creator of Ruby on Rails and the founder of Basecamp (formerly 37signals).

He described his approach for writing code:

Take 1: Let’s get this working.

Take 2: Let’s make this right.

Take 3: let’s make this beautiful.

Take 4: Let’s simplify this.

Take 5: …

This really resonated with me. So often we (myself included) tend to stop after Take 1. This leads to code that is buggy and difficult to maintain. Only rare individuals ever do three or four takes to create good quality code.

web frameworks, aurelia comments edit

Building upon the work done in my previous article, let’s add Bootstrap to our application:

jspm install bootstrap

While we’re at it, add the Typescript definition file too, just in case we want to programmatically display a modal or popover:

typings install bootstrap --ambient --save

Now, update the the template, app.html:

<template>
  <require from="bootstrap/css/bootstrap.css"></require>
  <require from="toastr/build/toastr.css"></require>
  <div class="container">
    <div class="row">
      <div class="col-md-12">
        <h1>Toastr Message Generator</h1>
        <form submit.delegate="submit()" class="form-inline">
          <div class="form-group">
            <label>Title</label>
            <input type="text" value.bind="title" class="form-control" placeholder="Enter title" />
          </div>
          <div class="form-group">
            <label>Message</label>
            <input type="text" value.bind="message" class="form-control" placeholder="Enter message" />
          </div>
          <button type="submit" class="btn btn-success">Show Toast</button>
        </form>
      </div>
    </div>  
  </div>
</template>

Mainly, this is just some bootstrap styling around the previous markup. But, you will notice at the top of the template two lines:

<require from="bootstrap/css/bootstrap.css"></require>
<require from="toastr/build/toastr.css"></require>

The element ensure that the styles are loaded as part of the view load process. When used in this way the CSS will be added to the head of the document. And, if you the CSS file from multiple templates or components, it will only be added to the document once.

That’s it. Now you can use bootstrap to make your application look awesome!

Toastr Generator with Bootstrap

Source code for this article can be found here.

web frameworks, aurelia comments edit

Rob Eisenberg first showed up on my radar in 2010 when he presented at the MIX conference. His presentation, Build Your Own MVVM Framework in 500 Lines blew me away.

You see, at the time, Silverlight was the hot new technology and average developers, like me, struggled to understand all the intricacies of data binding and commands. Rob, without a lot of flash, demonstrated how to get rid of a ton a boilerplate code and simplify wiring up the view model to the view.

From those humble beginnings, Rob expanded on his framework to create Caliburn.Micro. In his words, “A small, yet powerful framework, designed for building applications across all XAML platforms”.

Fast-forward a couple years, and Rob turned his attention to Javascript and created Durandal. This lightweight framework brought many of application design concepts to the wild world of Javascript development. It provided strong support for MVC, MVP and MVVM. It is still an excellent framework if you need to use legacy browsers.

In 2014, Rob joined the Angular team to contribute to the design and development of Angular 2.0. But after 6 months, Rob left the effort and began work on the Durandel’s successor, Aurelia

Aurelia is a next gen JS client framework that leverages simple conventions to empower your creativity. Built for modern browsers, it enables a forward-thinking, elegant approach to development.

Creating a (super) Basic Aurelia App from Scratch

Create a new directory and open a command prompt. First, lets initialize our node package.json file:

npm init

Just accept all of the defaults. Now we’ll install the jspm. jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader

npm install jspm --save-dev

Note: If you get errors while running this command, look at the following things:

  • If you are behind a firewall, make sure you’ve set your HTTP_PROXY properly
  • Add a rule to your virus protection software to exclude the directory you’re working with. I’ve seen some random issues occur while npm is attempting to delete temporary files.

Now setup jspm:

jspm init

Would you like jspm to prefix the jspm package.json properties under jspm? [yes]
Enter server baseURL (public folder path) [./]:
Enter jspm packages folder [.\jspm_packages]:
Enter config file path [.\config.js]:
Configuration file config.js doesn't exist, create it? [yes]:
Enter client baseURL (public folder URL) [/]:
Do you wish to use a transpiler? [yes]: NO

Now pull in Aurelia:

jspm install aurelia-framework
jspm install aurelia-bootstrapper
jspm install jquery
jspm install toastr

If you’re interested in what just happened, take a peak in the config.js file. When “jspm install” is run, it looks in the global jspm registry to determine where the library and its dependencies are located. Most popular javascript libraries are already registered there.

If a library is not listed in that registry, you can still install it. For instance, even though pace is a handy library to automatically add a progress bars to your web application. If you want to install it using jspm, you can reference it’s GitHub repository:

jspm install pace=github:HubSpot/PACE

or it’s npm package

jspm install pace=npm:pace

Either way will work. pace= is the alias or nickname you give the library, so it can be whatever you want.

Finally, let’s create a simple webpage that will load up all of the javascript libraries using SystemJS

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>My First Aurelia App</title>
        <link rel="stylesheet" href="jspm_packages/npm/toastr@2.1.2/package/toastr.css" media="screen" title="no title" charset="utf-8">
    </head>
    <body>
        <script src="jspm_packages/system.js" charset="utf-8"></script>
        <script src="config.js" charset="utf-8"></script>
        <script type="text/javascript">
            System.import("toastr").then(function(toastr){
                toastr.success("Loaded with System");
            });
        </script>
    </body>
</html>

We’re almost there. Now we need some way to serve up our website. We will use the excellent BrowserSync which will act as web server and automatically refresh the page whenever changes as made to the underlying files

npm install browser-sync --save-dev

And the scripts section in your package.json with:

"scripts": {
	"start": "browser-sync start --server --files *.*"
},

Now let’s see if it works

npm run start

If everything is setup properly, your browser should be opened to http://localhost:3000/ and you should briefly see a green “Loaded with System” notification pop up for a couple seconds.

Typescript

Now let’s add a Typescript view model

First, add a Typescript configuration file, tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}

Now, let’s update our tooling:

npm install concurrently --save-dev
npm install typescript --save-dev

And replace the scripts section in package.json with:

"scripts": {
	"start": "tsc && concurrently \"npm run tsc:w\" \"npm run serve\" ",
	"postinstall": "typings install",
	"serve": "browser-sync start --server --files *.*",
	"tsc": "tsc",
	"tsc:w": "tsc -w",
	"typings": "typings"
},

Now, let’s add a view model and template to the application. First, add a view model called app.ts:

import * as toastr from "toastr";

export class App {
  public title: string = "";
  public message: string = "";

  constructor() { }

  submit() {
    if (!this.title && !this.message) {
      toastr.error("Please fill in the form!", "error");
    }
    else {
      toastr.success(this.message, this.title);
    }
  }
}

Since your browser can’t directly interpret Typescript, you have to transpile it into javascript:

npm run tsc

At first, you’ll get some errors because it doesn’t know what toastr is. We need to install the type definition files.

First install the Typescript Definition Manager globally:

npm install typings -g

Now, install the type definition files for toastr and jquery:

typings install toastr --ambient --save
typings install jquery --ambient --save
typings install es6-shim --ambient --save

Note: If you’re behind a firewall, you will need to create a .typingsrc file to register the proxy server so this command will work. It will look a lot like your .npmrc file

proxy=http://proxy.mycompany.com:8080

Now try it again

npm run tsc

and you should see app.js generated

In Aurelia, every view model needs a corresponding template file, so let’s create app.html:

<template>
  <require from="toastr/build/toastr.css"></require>
  <form submit.delegate="submit()">
    <input type="text" value.bind="title" placeholder="Enter title" />
    <input type="text" value.bind="message" placeholder="Enter message" />
    <button type="submit">Show toastr</button>
  </form>
</template>

Finally, update the index.html file to bootstrap the Aurelia application. Replace the contents of the file with this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>My First Aurelia App</title>
  </head>
    <body aurelia-app>
        <script src="jspm_packages/system.js" charset="utf-8"></script>
        <script src="config.js" charset="utf-8"></script>
        <script type="text/javascript">
            System.import("aurelia-bootstrapper");
        </script>
    </body>
</html>

Now spin up browser-sync again using your brand new NPM script:

npm run start

This command compiles all of your typescript files, watching them and recompiling them when you make changes and concurrently, starts up browser-sync.

You should now see a page with two text boxes, allowing you to specify the title and message you want to display in a toast.

If you want to see browser-sync in action, add a header to the app.html and save the file.

<template>
  <require from="toastr/build/toastr.css"></require>
  <h1>Toastr Message Generator</h1>
  <form submit.delegate="submit()">
    <input type="text" value.bind="title" placeholder="Enter title" />
    <input type="text" value.bind="message" placeholder="Enter message" />
    <button type="submit">Show toastr</button>
  </form>
</template>

And the browser will automatically refresh.

Summary

Even though Aurelia offers a comprehensive set of skeleton projects to kick start your development efforts, I find it useful to walk through the steps myself so I can gain a better understanding of how everything works together. Hopefully, you found this article useful.

Source code for this article can be found on Github.

Acknowledgments

Thanks to Florian Verdonck for a great article that helped me put a lot of these pieces together!

git, development comments edit

I collected tips and tricks for using Git and Github from many places over the years. This is my attempt to consolidate some of this knowledge into a single spot. I am primarily a Windows user, so some of the file paths may be different in your environment.

.gitconfig file

Add the following lines to your .gitconfig (found in c:\users\your_idsid)

[user]
    name = Your Name
    email = your.name@company.com
[credential]
[http]
    proxy = http://your-proxy.company.com:8080
[https]
    proxy = http://your-proxy.company.com:8080
[push]
    default = simple
[url "https://"]   
	insteadOf = git://

[alias]
    co = checkout
    ec = config --global -e
    up = !git pull --rebase --prune $@ && git submodule update --init --recursive
    cob = checkout -b
    cm = !git add -A && git commit -m
    save = !git add -A && git commit -m 'SAVEPOINT'
    wip = !git add -u && git commit -m "WIP" 
    undo = reset HEAD~1 --mixed
    amend = commit -a --amend
	nuke = !git reset --hard && git clean -fdx
    wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard && git clean -fd
    bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
    bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
	squash = !git checkout master && git merge --no-ff --no-commit

Windows Clients

First, install Git For Windows). This provides you with the basic command line tools needed to interact with Git and Github.

My GUI client of choice is TortoiseGit. This open source client integrates directly into File Explorer and provides an intuitive set of tools to do just about everything you need to do with Git.

There are other good clients available too: Atlassian Sourcetree and Github for Windows are both quality clients for interacting with Git repositories.

Command Line

But for raw speed, sometimes the command line is best. Navigate to a local directory where you want to store you repositories and open a command prompt.

Clone

The first time you work on a project, you will need to clone, or download, the repository to your machine.

Get the URL for the repo (you can find it on the main page of any github project) - it will look something like this: https://github.com/jquery/jquery.git. Now, execute the following command:

git clone url_for_git_repo

Checkout

Before creating a new branch or continuing work on master, make sure that your working directory is up to date with the server (origin). First run pull:

git pull --rebase --prune

This pulls changes from the server. If there are any local commits, it’ll rebase them to come after the commits that are on the remote server. The –prune option removes remote-tracking branches that no longer exist on the remote.

git submodule update --init --recursive

This command will update any submodules (links to other git repositories) referenced by the project.

You can execute both of these commands by simply running the alias (from your .gitignore file):

git up

Commit

Commit your work often. The more often you commit, the less likely you are to lose work and encounter merge conflicts.

To find out the status of your repository, type:

git status

This will show all of the changes since your last commit.

Now mark any new files to be added into the repo by using the add command:

git add -A

Now you commit the changes to your local repository:

git commit -m "PUT YOUR COMMENT HERE"

You must specify a comment.

This activity is performed so often, you should use the following alias:

git cm "PUT YOUR COMMENT HERE"

Push

First, create a branch

git branch NAME_OF_BRANCH
git co NAME_OF_BRANCH

When you are ready to push to central repository the first time, execute this command:

git push --set-upstream origin NAME_OF_BRANCH

In the future, you can just perform a normal

git push

If you want to pull down the branch that your coworker just pushed to the server, execute:

git co --track origin/NAME_OF_BRANCH

Merge a branch

The Goal: Get a list of all files changed in a feature branch and compare each one’s initial state against its final state, without any noise from merges from master.

The Approach: Pretend I’m going to merge the feature into master but don’t commit it. Diff the pending changes and send my recommendations. Then throw away the changes and clean everything up.

git checkout master
git merge ‑‑no‑ff ‑‑no‑commit name_of_branch

The ‑‑no‑ff (No-fast-forward) flag makes the feature join into master with a single, explicit merge commit. This tells git, even if it could perform a fast-forward merge, where it applies each of the feature-branch commits as if they had been committed straight to master, please don’t. The ‑‑no‑ff option provides a single, show-me-everything commit.

The second flag, ‑‑no‑commit, is even more important: Stage them but don’t commit them.

You can also use the alias

git squash name_of_branch

Tackle and merge conflicts and use your favorite diff tool to inspect the changes.

If you choose to accept the changes into master, perform a commit

git cm "Added cool new feature"

If you decide it needs more work, you’ll want to clean up your working directory. Here are the commands to discard the changes.

git reset ‑‑hard
git clean ‑fdx

This will blow away everything not under source control (nuget and npm packages, bin obj, etc)

You can also use the alias:

git nuke

Delete branch

git branch -D branch_name
git push origin --delete branch_name

Submitting a Pull Request

There is a really good article about using forks and pulls requests to contribute changes to a project at Using the Fork-and-Branch Git Workflow

If you want to get right to it, follow these steps:

Go to a Github and fork the repository to your personal account

Clone the repository to your desktop:

git clone https://github.com/{your_account}/{repository}.git

You will already have a remote link to your Github repository, but it is also handy to create a link to the repository you created the fork from. We will call this upstream (Note: this is a one-time activity. Unless you physically delete your local repository, you shouldn’t have to do this again). For more details, see this article

git remote add upstream https://github.com/{owner}/{repository}.git

Now create a feature branch to do your changes

git checkout -b {feature_branch} {source_branch}

For example:

git checkout -b MyFeatureBranch master

Now interact with your code as normal. Edit code, run tests, commit often. When you are ready to push changes up to your personal Github repo, you will need to set the default remote repo first.

git push --set-upstream origin MyFeatureBranch

After that, you can just push as normal:

git push

Try to keep the number of changes you are making restricted to the feature. It is difficult to read a pull request for changes made to dozens of files.

Create Pull Request

Go to your branch https://github.com/{your_account}/{repository} and click the big green Compare & pull request button. Enter a Title and some comments and press Create pull request.

Now the conversation begins. Other team members can leave general comments or comment on a line of code. You can continue to commit changes to your branch and they will be automatically displayed in the pull request. Once the owner is satisfied with the change, they can merge the change into the main repo.

Cleaning Up

Once your pull request has been merged, you can delete your branch. First delete the local branch

git checkout master
git branch <branchName> -D
git push origin master

Then delete the remote branch:

git push origin --delete <branchName>

Sync your repo from UPSTREAM

Syncing your repo with GTD/MRA is pretty straightforward. For more details, see this article

git fetch upstream

Check out your fork’s local master branch.

git checkout master

Merge the changes from upstream/master into your local master branch. This brings your fork’s master branch into sync with the upstream repository, without losing your local changes. After merging, push the changes up to your repo.

git merge upstream/master
git push origin master

Now you are ready to start on another feature branch

Migrate SVN Repository to Git

Based on this guide: http://www.troyhunt.com/2014/08/migrating-from-subversion-to-git-with.html

Basically:

Install ruby - http://rubyinstaller.org/downloads - you might have to add the c:\rubyXXX\bin folder to your PATH

SET HTTP_PROXY=http://your-proxy.company.com:8080
gem install svn2git

Setup folder to get ready for migration

mkdir _code\github\your_repo
cd _code\github\your_repo 

Kick off the Svn->Git migration (note: do not include /trunk):

svn2git https://your-svn-server.company.com:8443/svn/your_repo 

While you wait for it to complete, go to Github and create a new repository for your project - do not add a readme or .gitignore file

Once svngit is complete, execute:

git remote add origin https://github.com/{owner}/{your_repository}.git
git push

Good Articles

http://haacked.com/archive/2014/07/28/github-flow-aliases/

http://lostechies.com/sharoncichelli/2014/08/15/reviewing-git-feature-branches-when-you-dont-have-pull-requests

http://sethrobertson.github.io/GitFixUm/fixup.html

raspberry pi, diy, christmas comments edit

I finally caught the bug. After seeing a neighbor choreograph his entire outdoor light display with music, I set about trying to figure out how to do something similar. I’m starting small, just trying to automate 6-8 different sets of lights on a tree, but you never know where this will end.

After a quick google search, I stumbled upon this article on by Osprey22 on Instructables Raspberry Pi Christmas Tree Light Show

I bought some gear to get started:

SainSmart 8-Channel Relay Module

SainSmart 8-Channel Relay Module - this is used to turn power on and off to the individual power outlets

Jumper Wire Cables

CanaKit Raspberry Pi 2 Complete Starter Kit with WiFi - to get me started easily

I hooked them up to a wireless keyboard/mouse and a monitor (using a HDMI cable), popped the SD card into the Raspberry Pi (RaPi) and installed Raspian operating system using the NOOBS installer. This already cam installed on the SD card, but you can also visit the Raspberry Pi NOOBS Setup page to learn how to do this yourself

Next I started following the instructions in the Instructables article

Static IP Address

I setup a static IP address by right-clicking on my wifi connection and selecting WiFi Networks (dhcpcdui) Settings. Select interface and wlan0 and set the IP address and Router number

Install Telnet

Next, I installed telnet:

sudo apt-get install telnetd
sudo /etc/init.d/openbsd-inetd restart 

Verify the telnet by opening a command prompt:

netstat -a | grep telnet

You should only see something like this:

tcp 0 0 *:telnet *:* LISTEN

but once you connect to it from another machine using telnet, you’ll see something like:

tcp 0 0 *:telnet *:* LISTEN
tcp 0 0 raspberrypi.loca:telnet 192.168.15.161:49610 ESTABLISHED

Finally, if you want to restrict who can login:

sudo nano /etc/hosts.allow

and add lines similar to these at the bottom of the file:

in.telnetd : 192.168.1.161 : allow
in.telnetd : 192.168.15. : deny

Save and restart the service:

sudo /etc/init.d/openbsd-inetd restart 

FTP Services

Next, I installed an FTP Server

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vsftpd

Let’s see if it’s installed

netstat -npl|grep vsftpd
tcp6   0      0 :::21           :::*            LISTEN      1984/vsftpd     

That’s it. If you want to configure the service (like add security features) check out the article linked above.

Install PyGame

To write scripts to play audio, install pygame for Python 3. I also referenced this article

sudo apt-get install mercurial 
hg clone https://bitbucket.org/pygame/pygame
cd pygame

sudo apt-get install libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev 
sudo apt-get install libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
sudo apt-get install python3-dev python3-numpy

python3 setup.py build 
sudo python3 setup.py install

Wiring up Relay Module

This great video made it really clear about how to connect the Rasberry Pi to the SainSmart relay module. He talks about an issue he had with the Raspberry Pi 2 Model B, but I never experienced it.

Wired the board up using GPIO.Board configuration. Plugged it in and ran the basic.py test script:

python ./basic.py

and everything worked

Automatic Lightshow

I found an article by Chivalry Timbers (it could be his real name) about running a light show directly from a MIDI file. About three paragraphs in, he referenced a project called Lightshow Pi that will allow you to use a MP3 instead.

Download Lightshow Pi

# Install git (if you don't already have it)
sudo apt-get install git-core

# Clone the repository to /home/pi/lightshowpi
cd ~
git clone https://togiles@bitbucket.org/togiles/lightshowpi.git

# Grab the stable branch
cd lightshowpi
git fetch && git checkout stable

Install LightShow Pi

cd /home/pi/lightshowpi
sudo ./install.sh

The install process can take several minutes. You should reboot after the install completes:

sudo reboot

Verifying Your Hardware Configuration

You can verify your hardware setup and configuration are setup properly by blinking each channel one at a time using the following command from the main LightShow Pi directory (/home/pi/lightshowpi if you’ve followed the default install steps):

sudo python py/hardware_controller.py --state=flash

You can also fade each channel in and out using software PWM using the following command:

sudo python py/hardware_controller.py --state=fade

Press -C in the same terminal window to stop the blinking / fading lights test.

geek comments edit

Tesla Powerwall I was listening to the Energy Storage Geek Out episode on dotnetrocks.com and they were talking about the new Tesla Powerwall. I really love this concept - charge the battery at night when electricity is cheap and then use the power from the battery during peak hours when electricity is expensive. Brilliant!

But it got me wondering: does it make financial sense? So I pulled out my calculator and crunched some numbers.

Here are my assumptions (which could all be wrong, so make sure you do your own homework):

  • The daily-use Powerwall can provide 7kWh per day and costs about $3000 (plus installation).
  • According to the podcast, the unit is designed to be used for 5000 days (a little over 13 years) before it starts to degrade.

In Phoenix

I live in the Phoenix area and most people here use a time-of-use plan. So that means, in June, we pay about 7 cents a kWh during the evenings and about 19 cents during the middle of the day. That means if I use the Tesla Powerwall, I can use 7 kWh of electricity during the heat of the day. Since I charge the battery in the evening, I only paid 49 cents instead of almost $1.40, saving me 84 cents per day (7kWh x 12 cents = 84 cents)

Now we have different rates during each season, so I applied this logic for an entire year:

Season Hi/Low Diff Days Savings/Day Savings/Year
Nov-Apr 0.0309 180 0.2163 38.934
May-Jun 0.1219 61 0.8533 52.0513
Jul-Aug 0.1485 62 1.0395 64.449
Sep-Oct 0.1219 61 0.8533 52.0513
Total       207.4856

So, by my calculation, with a savings of $207/year, it will take 14.5 years to recoup the initial investment of $3000. Bummer.

Los Angeles

I wanted to get at least one more data point, so I looked up time-of-use rates from Los Angeles Department of Water and Power. As near as I determine from their site, it looks like it will take even longer to recoup the cost

Season Hi/Low Diff Days Savings/Day Savings/Year
Jun-Sep 0.08 122 0.56 68.32
Oct-May 0.01 243 0.07 17.01
Total       85.33

Over 35 years to get your money back.

Conclusion

Perhaps if I had solar panels on my roof, this might make more sense. I’m not sure what the trade-off is for storing power in a battery compared to selling it back to the grid. Maybe in other area, where the difference between peak and off-peak rates is greater, it would also make more sense.

But until the prices come down for this technology, it doesn’t make financial sense for me.

References

Los Angeles Department of Water and Power

Phoenix Salt River Project Time-of-use Rates

agile development comments edit

Developers need to learn many things: how to write clean code; how to test; how to automate the build; the basics of design; the syntax and idiosyncrasies of language(s) they are working in. Many companies assume that college graduates already know most of this information.

Robert C “Uncle Bob” Martin once compared software development to martial arts. He likened college grads to white or gold belt level. They know the basic kicks and punches, but still have a long way to go before they can be considered black belts. The only way to get to that level if through experience and learning from higher level practitioners.

With that end in mind, I’ve pulled together some of my favorite articles, books and videos that have helped me along my journey to becoming a better developer.

Agile

  • Extreme Programming Explained, v.1 by Kent Beck - one of the most influential programming books of the past generation. Beck inspired me, and tens of thousands of developers to write tests, pair program, refactor and write better code. IMHO, this is the book the sparked the entire agile movement.
  • The New Methodology by Martin Fowler - everything Fowler writes is gold. A great article describing agile development (mainly eXtreme Programming).
  • All I Really Need to Know about Pair Programming I Learned In Kindergarten by Laurie Williams and Robert Kessler
  • Characterizing people as non-linear, first-order components in software development by Alistair Cockburn - a really dry title, but a very interesting paper. Discusses the importance of people as part of a team. My favorite concept: when attempting to introduce any improvement to the process, “I discovered: Problem 1. The people on the projects were not interested in learning our system. Problem 2. They were successfully able to ignore us, and were still delivering software, anyway.”

Embrace Your Craft

  • The Pragmatic Programmer by Dave Thomas and Andy Hunt - not a programming book, per se, but a book about how to be a developer. Outstanding book.
  • Clean Code and Clean Coder by Robert C Martin - describes the what code should look like and how to write it yourself.

Practice Your Craft

  • Take on ownership of your team’s build process - learn the build process inside and out
  • Participate in an open source project of your choosing. Contribute one change by the end of the year (enhancement, bug fix, documentation)
  • Attend a one-day Code Retreat http://coderetreat.org. Already attended a retreat? Facilitate one instead.

OO Design Patterns/Principles

  • Agile Software Development - Robert C Martin (aka Uncle Bob) – This book is misnamed. It’s really about some the principles of good object oriented design. It talks about the underlying concepts and principles that will allow you and your teammates determine if a design is good, or lacking. Read Chapters 1-12; There is also a version for C#. Object Mentor, also offers a class and Bob has a number of videos at http://cleancoder.com.
  • Head First Design Patterns - An entertaining and informative book that will walk you through the most common design patterns for an OO language.
  • Fail Fast – Jim Shore - Great little article that helped me understand why I want my application to fail quickly.
  • Code as Design - Jack Reeves – A precursor to the agile movement, the author does a great job of describing why code is the best way to represent the design. Junior and senior developers will find this paper to be enlightening.
  • Is Design Dead? - Martin Fowler - For many that come briefly into contact with Extreme Programming, it seems that XP calls for the death of software design. Not just is much design activity ridiculed as “Big Up Front Design”, but such design techniques as the UML, flexible frameworks, and even patterns are de-emphasized or downright ignored. In fact XP involves a lot of design, but does it in a different way than established software processes. XP has rejuvenated the notion of evolutionary design with practices that allow evolution to become a viable design strategy. It also provides new challenges and skills as designers need to learn how to do a simple design, how to use refactoring to keep a design clean, and how to use patterns in an evolutionary style.
  • Refactoring by Martin Folwer - pages 1-87

How to Test

Continuous Integration/Automated Build

  • Continuous Integration - Martin Fowler - Continuous Integration is a software development practice where members of a team integrate their work frequently, usually multiple times a day - leading to multiple builds per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. This article is a quick overview of Continuous Integration summarizing the technique and its current usage.
  • Version Control By Example - In this free book, Erik Sink covers all of the common source code control practices. If you’re new to source code control, or need a refresher to bone up on the more advanced topics, check this out.
  • Continuous Integration on a Dollar-a-Day - James Shore
  • Evolutionary Database Design - Martin Folwer and Pramod Sadalage - Over the last few years we’ve developed a number of techniques that allow a database design to evolve as an application develops. This is a very important capability for agile methodologies. The techniques rely on applying continuous integration and automated refactoring to database development, together with a close collaboration between DBAs and application developers. The techniques work in both pre-production and released systems.
  • CruiseControl.Net - CruiseControl is the one of the first continous integration servers in the .Net world. Originally ported from Java, CrusieControl.Net is responsible for kicking off the builds of literally tens of thousands software project around the world. It integrates with all the most popular source code control systems and is very flexible in how it notifies the team about broken builds
  • Team City - Another continuous integration server is TeamCity by Jetbrains (the makers of Resharper)

blogging comments edit

While this is certainly not new, it was new for me. So I wanted to make sure I recorded what I learned this weekend.

Some Context

I was having lunch with a co-worker a couple weeks ago and he started talking about hosting websites on Github. I’ve been thinking about starting a blog over the past few months, but just haven’t been able to decide on the right platform to host it on. I’ve played around with Weebly, Squarespace and even Ghost hosted on Azure, but I was looking for low cost and a reasonable level of control and none of them quite fit the bill.

I remembered seeing an article from Phil Haack some time ago talking about how he ported his blog to Github. To say that Phil inspired my site would be an understatement - I cloned his site and then started replacing images, links and posts to personalize it. Standing on the shoulders of giants. Thanks Phil!

Getting Started

The first thing I did was create a github project to host my site. I could have created a user page repository called https://github.com/turp/turp.github.io, but since I was following Phil’s lead, I created a project called https://github.com/turp/jayturpin.com to host this blog.

Create Repository

If you’re really interested, you can read more about the difference between user and project pages at https://help.github.com/articles/user-organization-and-project-pages/.

To see something quickly, I let Github do some of the work for me. I clicked the Settings button and scrolled down to the Github Pages section and clicked the Automatic Page Generator

Automatic Page Generator

Then I entered the name of my site and selected a theme;

Pick a Theme

And that’s it. You’ll see a new branch setup in your repo called gh-pages and see files that look something like this:

Repository

Point your browser to http://turp.github.io/jayturpin.com

Jekyll

Github Pages are created with Jekyll, a Ruby library that converts Markdown script into HTML. It was created with blogs in mind, so it understands permalinks, categories, pages and posts, making blogging pretty easy.

If you want to be able to run your site locally, while your fine tuning the layout, you will need to install a few things. Follow the instructions here to install Ruby, Bundler and Jekyll. I also recommend that you install Python too, since Jekyll uses it to perform code highlighting.

Once you have everything installed, run from the root of your local repository

jekyll serve

and visit http://localhost:4000

Custom Domain

While it’s cool to be able to send people to a such memorable web address as http://turp.github.io/jayturpin.com, I wanted to be able to use my own domain. Luckily, Github makes it easy.

First, create a file called CNAME (I assume spelling and capitalization is important) and place it in the root of your repository. Add a single line to that file with the name of your domain, in my case

jay.turpin.com

Once that is done, visit your domain registrar (I use Namecheap.com and point your domain name to [username].github.io.:

Namecheap

It may take a few minutes to propagate, so don’t freak out if it doesn’t work right away.

I also added a subdomain called feeds to redirect to my Feedburner site to allow me to track the three family members that will eventually subscribe to my blog.

Creating Posts

All blog posts are stored in the _posts folder. I created a folder for each year, but that is optional. If you want to work on posts and not make them public yet, store them in a folder called _drafts. You can see how them look by running Jekyll with the draft option

jekyll serve --drafts

Conclusion

And that’s it! If you want a different theme, there are dozens available at jekyllthemes.org that you can use for your site.

personal comments edit

My name is Jay Turpin. I’m a big dog owner, beer brewer, father of two and husband of one for over two decades. I have been developing software since 1993, and am passionate about new technologies and practices.

As a software developer currently working at Intel Corporation, I am an outspoken proponent of agile practices and have been employed them on over a half dozen teams since 2001.

Over the years, I have taught numerous agile classes, given presentations and coached teams on how to take the first step in their journey towards becoming agile.

I love coding. My day-to-day work is primarily focused on Typescript and Angular on the front-end, C# and SQL Server on the backend. I love Ruby and have used it for build scripts for years.