git rebase –autosquash

When working in a feature branch, I make some changes to a file and then commit these changes. Later on, I make some additional changes to the same file on the same lines, and I want to squash these changes into the first commit touching the file.

To find out more, check out my Coderwall Pro tip: https://coderwall.com/p/hh-4ea

Cloudy, Cold and Hip – Two Weeks of Training in Portland

I’ve really enjoyed the last two weeks. My new employer, recently acquired Analog Analytics flew me out to Portland, Oregon for training. Portland is quite an amazing place. Skateboarders, cyclists, and runners abound, but with a laid back attitude. Its the greenest city I have ever visited. Stores seem to only dispense recyclable materials including paper bags, and foods in waxed cardboard containers. The entire city is very walkable without much danger of personal harm. The food was amazing, and the drinks even better. This city knows its coffees, teas, and beers. It has to be home to the most microbreweries of any city. Needless to say I have probably gained 5 pounds, and I am super caffeinated. Also, the proximity to all these hip restaurants is giving me second thoughts about living so far outside of the city limits. No lie, I even glanced at Portland housing prices.

It took me a few days to get oriented to the city and the work environment. The company runs out of the Ford Building, in the heart of quite a few cool restaurants and bars in the Southeast side of the city. In fact, it left me a little jealous considering the hotel is only surrounded by fast food joints.  I got a shiny new MacBook Pro (which I am currently battling to make it as “boring” as possible). I can’t talk too much about the work, but it does hit the sweet spot of what I was looking for – a small team feel with deep pockets, and a launch date.

Kristin and Morrigan joined me for the second week and did their own thing, and they had a blast. They visited OMSI, Powell Books, Finnegans, several parks, and malls, and some tasty food joints. I’m happy they got to experience some of what makes this city awesome.

I’m enjoying several aspects of the job in particular: A remote driven environment, and pair programming. Training isn’t the best test run of this environment, as I am in the office everyday for now. Once I am setup, I pick the hours. People hop online and offline, according to their time zones, availability, etc. Every piece of communication, and workflow is centered around remote teams.

Pair programming makes programming social. Despite the image that telling someone you are a programmer conjures, I really enjoy interacting with people. I remember teaming up with James, John and many others at Clayton State to tackle some large issues with our portal and other systems. Since Clayton State, I have worked on a couple teams, and it was almost always in isolation, save for 5-10 minute high level meetings. The best part is, its actually kind of fun.

Pair programming was a tough adjustment for me. I’m used to presenting a final product and defending its implementation. I have all the answers. I know what the talking points are up front, and I am comfortable because I am the authority on the subject. Pair programming is letting your guard down, and conceding as much as contributing. You are two people working on a problem together, with neither party starting off knowing the complete solution. The work is certainly slower than solo programming, as incorporating input, early refactoring, and general discussion takes up time. This team takes an interesting approach to combat some of the time drain; You can either pair program and merge directly, or work solo but your code requires a peer review before merging. The choice is yours. The solo programming option will probably act as a safety value for those days when I just want some time to myself. They also encourage “switching drivers” to vary the work. Interestingly, being the passenger requires more focus than driving, as you are trying to proactively find issues with the current approach.

I’m still struggling to embrace TDD. I don’t like the zealotry in the community when the topic comes up; presenting the only two options as either you test first, or you are just ignorant, undisciplined, or apathetic to the code you write. The truth is far from it. I figure things out by moving the pieces around – not by staring at it from a distance. That is not to say that there aren’t times when testing first is extremely useful, like when clarifying requirements. The test assertions (even with missing test bodies) is often enough to help solidify an attack plan. The amount of code coverage can be a hindrance though, as real world tests always end up being more tightly coupled than you ideally want them to be. If you make seemingly small code changes, you can end up with quite a bit of the test suite failing (all though with the same few errors repeating). If you mock and stub too much, you aren’t testing much that is useful. Even worse, the workflow doesn’t seem realistic: Write the tests, verify the tests fail, write the code, verify the tests pass. The reality seems to be write the tests (heavily guessing at the exact implementation), verify they fail, write the code, refactor almost all of your tests, and verify they pass. Given the choice, I think I’d still rather write code, then test the code to verify it does what I want in all scenarios. I’ve yet to meet a dyed-in-the-wool TDDer that sees any fault with this extra refactoring step. The subject of pre-written tests needing to be refactored seems to be glossed over. Maybe my opinion will be changed yet.

Things are looking awesome for this next step in my life! I’m keeping my fingers crossed for Railsconf tickets, since they are in my employer’s backyard. There are also a few missed restaurants I am meaning to visit next time I’m back up this way…

In order to make delicious food, you must eat delicious food

In order to make delicious food, you must eat delicious food. The quality of ingredients is important but you need to develop a palate capable of discerning good and bad. Without good taste, you can’t make good food. If your sense of taste is lower than that of the customers, how will you impress them?

Jiro in Jiro Dreams of Sushi

When I heard this quote, I immediately thought of software development. The best way to write good software is to look at the design principles of good software. You can’t work in isolation. That problem you have is the same problem that has been solved millions of times before by people that are better than you will ever be. Without good taste, you can’t make good food. This is why open source is so important. Look at the source code whenever you are curious how something works.

Trials and Tribulations of the D-Link DNS-320

A funny noise, is something you never want to hear coming out of your primary disk drive. If you are like me, you probably never think too much about backing up your important data before it becomes a looming emergency. I realized while listening to that noise, and watching the red HDD indicator light stay on constantly that I had some pretty important stuff on that drive. Wedding photos, baby photos, videos, documents and other things that you can’t just re-download. Why not have cloud backup? I’m a bit skeptical of entrusting others with my data. At the end of the day, a failure on their end may net you a refund, and you could even take them to court, but no matter what, you are never getting that content back. It was time to take matters into my own hands.

The Setup: I bought a two-bay D-Link DNS-320, and two Western Digital 2TB Red hard disk drives. The plan was to setup the disks in RAID 1, so the odds of a simultaneous failure were as statistically low as my finances would allow. I liked the D-Link 320 because it had compelling features, and a two drive system for a fraction of the cost of other names like Synology. I wanted CIFS and NFS sharing, and RAID 1. Everything else was a perk. Pleasantly enough the DNS-320 also comes with a UPnP server, and has some nice SMART monitoring options, which will send an email to me in the event that errors are detected. I would create one 2TB partition out of the disks, and share this over the network with restricted access. My wife and I would both be able to connect from our computers to back up any data we wanted.

Configuration: CIFS setup was a breeze, but NFS required a bit more poking around. This post is dedicated to overcoming some of the issues I had. Within the NAS web interface, partition your drives, and grab a cup of coffee. Straight forward stuff. I created a single partition labeled “Volume_1”. After this is complete, go to “Management” -> “Application Management” -> “NFS Service”, and check “Enable”, then click “Save Settings”.

Go into “Management” -> “Account Management” -> “Users / Groups” and create a user account if you have not already done so. Within “Account Management”, click on “Network Shares”, and click the “New” button. This will launch the wizard for setting up a share. Select the appropriate users, groups, settings, and on the “Step 2-1: Assign Privileges – Access Methods”, ensure that the “NFS” checkbox is checked.

Move along by clicking “Next” until you reach “Step 2-1-2: NFS Settings”. You will need to specify the Host IP address of the client that will be connecting to this share. This will white list the IP address supplied as a client location. I’m not positive what format you would use the denote multiple IP addresses, however, an asterisk character allows all hosts. I connect with multiple machines via NFS, so using a particular IP address is not sufficient. Despite being accessible to any IP address, the client will still need to authenticate using their credentials entered in “Step 1” and “Step 1-2”. I consider this good enough. Also, ensure the check the “Write” check box if you wish to be able to write files to this location.

Client Configuration: You will need to install the nfs package for your distribution of Linux. I am running Ubuntu 12.10, so the package is named “nfs-client”. Install it using “sudo apt-get install nfs-client”.

Now that you have the nfs-client package, you can use the “showmount” utility to list the shares on the NAS device: “showmount -e NAS_IP_ADDRESS” (e.g. showmount -e 192.168.1.1″). Depending on how you have the disks partitioned and shared in the NAS device, this path will differ.

Export list for 192.168.1.1:
/mnt/HD/HD_a2 *

This path should be consistent with the information in the “Network Shares Information” dialog. This can be accessed by clicking the magnifying glass icon underneath the NFS column in the “Network Shares” interface.

You can now mount your device using the “mount” command: “mount -t nfs NAS_IP_ADDRESS:/REAL_PATH /path/to/mount_point“. The NAS_IP_ADDRESS is the IP address of the NAS device. The REAL_PATH is the information obtained either via showmount, or the “Network Shares Information” dialog. The “/path/to/mount_point” is just an empty directory somewhere on your local machine.

You can also set this mounting option up to be persistent on reboots using the “/etc/fstab” file. Add a new line to this file, and format your entry similar to as follows:

# /etc/fstab: static file system information.
# ...
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# ...
192.168.1.1:/mnt/HD/HD_a2  /media/nas  nfs rw,hard,intr 0  0

The values used are identical to the values used in the mount command preceding this example. The options specify changes to the mount behavior. “rw” specifies “read/write” permissions. “hard” retries requests indefinitely. Coupled with “intr”, this allows requests to retry until the NFS server becomes unreachable, in which case the retries would stop. I would recommend these option when copying large amounts of data, or when on a wireless network as failed transmissions will be silently repeated without raising an exception on temporary timeouts, etc.

Note on Permissions: Initially when I copied my content over to the NAS, I did so via NFS, and I was not able to view the contents via CIFS (Windows sharing). The problem came down to permissions. The directories did not have a executable bit set for “other”, so permission was denied when a request was made to show the contents of a directory. This was difficult to locate as the UPnP server showed all my media without any permissions issues. A quick search of UNIX permissions revealed that the executable bit is necessary to list directory contents, and the NAS is accessing content created via NFS as “other” (neither user, nor group permissions apply). You can recursively grant the execution bit of any existing content by issuing the following command from the top directory: “chmod o+x -R /root_directory“, where “root_directory” is the folder you want to change. The “-R” flag will recursively apply this permission to all content within.

Lessons Learned: I have about 50GB of pictures and video, and another 20GB in purchased content. I underestimated how long this would take to transmit on a 802.11g connection. 54Mbps is just under 7MB/s. This means that a 50GB transfer would take over 2 hours to complete. And that is not counting temporary speed drops, hard drive access times, retries, etc. When working with large amounts of data, I recommend a 1Gbps Ethernet connection. I will probably be investing in a new router soon that can accommodate these higher speeds.

The D-Link DNS-320 is a solid first time NAS device for under $150. Other than a few gotchas when setting up the NAS (most self inflicted), this device is NFS friendly, and has made a fine edition to my hardware ecosystem.

Working for a Development Firm is Like Being a Rented Sports Car

As my last post alluded to, I am leaving my current development firm. The reason is primarily a boost in earning potential at another employer, but also a culture change. To explain the culture at a development firm I created this analogy:

Imagine you rent a Mustang, or a Corvette. (Of course you are gonna get the insurance!) What are you going to do with that car? Everything that you fucking can! You are gonna imprint the gas petal into the floorboard, and drive fast and wreckless. After all, you have to get every dime you can out of your rental before your time expires right?

Now imagine you own a Mustang, or a Corvette. Yeah, you would probably hot dog it, but it also your purchase, so if you wreck it, you are gonna be upset with yourself. In other words, you are going to maximize your purchase by caring for your vehicle, and obeying the speed limit (most of the time anyway).

I have just described the difference in my view of an internal development team, and an outsourced development team. Clients want to maximize that dollar when they outsource, which is done by getting the most work in the least amount of billable hours. They want the sports car rental. They aren’t going to set a moderate pace; they are going to speed! I’m not saying that all development firms, or all clients are like this (I’ve worked with great clients in the past). But I am saying there is a struggle between maximizing value and being realistic about what you promise.

How does a client pick your development firm? By your firm being the lowest bid. They understate the hours needed for the work. They over-promise features on an unrealistic deadline. When Company A quotes $100k under Company BCompany A gets the work. And the client isn’t going to be cool with missing deadlines, or cutting functionality. So now management is in a battle with the client who is pissed off because the original bid was unrealistic, and wants to rectify the problem. That shit rolls down hill to you – the developer.

And I can tell you, its not possible to write good code faster. Someone micro-managing me, asking me what I’m doing every five minutes isn’t making me any more productive.

There are lots of companies that push hard. You can make a good living working for these places as long as the compensation, or bonuses are commensurate with the work that you put in. But busting your ass all day, every day – every day feeling 10 hours long – every day being full of epic code pushes, and near impossible deadlines met in the 11th hour – that is a young man’s game. That is pretty appealing when you are 22, fresh out of college, and eager to prove yourself to the world. Stressing out at 4:50 on a Friday, trying to get something delivered while your wife and daughter patiently wait for you to get off work just isn’t worth it. I’d rather enjoy my time with them. I’m not mad about it – its just how the game is played.

Which is why this Sports Car is up for ownership. He is done with the rental game, being driven too hard, too long. He wants a nice garage somewhere, and a driver that just takes him out on Sundays for a trip around town. I want to spend time with my daughter while she is still young, instead of delivering some milestone that I wont remember in a month. If I wanted a stressful culture, I would have worked for a startup. Then at least I have some small chance of hitting it big when we get bought by Google.

Working From Home: Redux

In July I wrote about my experience of working from home after one month. Six months later, I’m still working from home, but more the wiser. I had a lot of fears, and uncertainty one month in, and despite the silver lining, I wondered how some of the long term attrition would affect me. Happy to say, six months later I’m alive and kicking, hoping to never set foot in an office again! Here are some thoughts looking back.

Isolation It was a fear that never manifested itself. A coworker of mine warned me that after several months of working from home, he was like a lost puppy when someone would walk through his front door. Hell, I’m a bit strange after staring at the computer screen for a few hours, let alone months of working from home. I attribute this mitigation to my wife and my daughter, and keeping an active social life. I always eat lunch with someone, and keep my weekends full to break up the weeks.

Work is a great place to meet new people, but its not the only place. I still meet friends through friends, and have family, etc. I find that not having a soul-sucking commute and eight hours a day at a desk has made me more social (or at least more energetic). At the end of the day, I want to go out and do things and hang out instead of come home and crash on the couch with some greasy snack food named “regret”. My biggest connection is now user groups in the area. Its educational, and fun.

Reduced Visibility Since you aren’t there, are you going to be passed over when it comes to opportunities, praise, feedback, inclusion in discussions, etc? The answer is YES. The bigger question is if you really want to be in all those silly meetings anyway. I’m guessing you wouldn’t choose to work remotely to place work more in the forefront of your life. After hearing the glorious silence, I find all of the managerial office discussions distracting and just want to know what the outcome is. Less is more.

While I have upheld my end of the remote work bargain, there is still a trust issue. it can be frustrating for your boss when you don’t immediately respond to communications because the fear is “Oh man, we cut this guy loose, and we will never hear from him again!”. We started a new project and I had to (and still at times) push back on the amount of micromanagement. I think there is still a failure to understand that if the agreement is to let me work remotely, then the implied statement is that I am disciplined enough to get my work done.

I think I will prefer ROWE. An employee should be able to work when they want, and how they want without conforming to office hours. The bottom line for a business is that I deliver, not that I put in exactly 40 hours. More on this in a moment.

Getting into a Rut It happens to everyone from time to time. Maybe even more so in the winter. Its cold outside, and the daylight hours are short. When you are working from home, the days start to blend together, and it becomes harder to remain motivated. Caffeine will only carry you so far…

The best thing I did for myself was joining a gym right up the street. I try to visit a few times a week. Its amazing how much stress, tension, and anger you can eliminate just from jogging in place for 30 minutes. I come back refreshed, focused, and energized. When I have several visits in a week, I begin to look forward to the next visit, an this helps me get through the day.

For God’s sake whatever you do, don’t setup for work within arms reach of the junk food in your kitchen!

Another drain is being constantly focused. When you need to be, this is a good thing, but the human mind can only concentrate for so long before fatigue becomes a factor. I read an interesting article called the 10x Developer in You where the author describes the Pomodore Technique. He suggests 25 minutes of concentration, and a 5 minute break. I have opted instead for 45 minutes of concentration, and a 15 minute break, since I often get into problems that extend beyond the 25 minute mark. I have found my productivity (and attention) back to where it was when I first started remote work.

ROWE

ROWE focuses on results, and not hours. Remote work is half of the dream realized, but you still have to conform to office hours. What is the point in working from home if you still have to act like you are sitting in an office?  I think the ideal job would allow remote work and practice ROWE.

For those of you that aren’t parents, a one year old’s sleep schedule is quite erratic, and my shifts don’t always line up with her awake times. I resent having to work while she is awake, only to get off five minutes after she has gone down for a long nap. My daughter goes to sleep around 7pm, and I would prefer work after she is asleep so I can spend more time with her during the day. ROWE accommodates this, whereas a traditional schedule does not.

Charlie Maffitt has some great advice on breaking old habits and adopting a ROWE work style: http://blog.bignerdranch.com/1183-old-habits-die-hard-adapting-to-rowe/

 Final Thoughts

You might be sick of hearing those lucky bastards say it, but this is a game changer. Light traffic is irritating to me now, and I don’t know how people deal with it both directions, 5 days a week. I have a lot more time for reading, playing, and relaxing.

My wife and I have plans for long term travel just around the corner. We underestimated the costs of moving, and the overhead of renting a place for an entire month on top of your current rent. Nevertheless, its still on the books, and later is better than never.

We are also looking to move further out of the city. Without worrying about the commute, you can move further out and maximize your purchasing power.

I think this is the next revolution for workers. This wasn’t possible before for the most part because the technology wasn’t ther, but many jobs today can be done as easily from home as from an office. The entire notion of putting on a silly suit, sitting in traffic an hour, and sitting in a stuffy cubical away from your family most of your life just strikes me as bizarre. The workers will start to demand it, and the employers will have to stop being so controlling about monitoring their staff. This is how you fix rush hour – not by adding mass transit and more lanes. This is how you lower gas prices – not with more fuel efficient vehicles. This is how you fix the depressed American worker – not with medication.

Food for thought!

 

 

 

Something Witty About Diamonds and Pressure

…in Italy for 30 years under the Borgias they had warfare, terror, murder, and bloodshed, but they produced Michelangelo, Leonardo da Vinci, and the Renaissance. In Switzerland they had brotherly love – they had 500 years of democracy and peace, and what did that produce? The cuckoo clock.

– The Third Man

Inspirational Lyrics

“That’s life, that’s what people say.
You’re riding high in April,
Shot down in May.
But I know I’m gonna change their tune,
When I’m right back on top in June.”

– Frank Sinatra from That’s Life

All I Want for Christmas…Is Nothing

I want to focus on what is important this time of year – family and giving. I’ve decided that I have everything that I need, but I would love to see some donations to non-profits to help the less fortunate. Please view my Donation Page to quickly and easily give to my favorites!

Happy Holidays everyone!