Fork me on GitHub

Security of ignorance

Over the past year and change, I have been asked frequently “how did you hook up with those guys.” Typically, the conversation becomes less about “those guys” and more about the scenario that made a 7-year code monkey, husband, and father of two choose to jump out of the comfort of corporate life. (long intro & links to series articles)

Ignorance is Bliss Road
Photo by parl

In college, I would add bells and whistles to my coding assignments. As any computer science degree-holder knows, most college projects are not incredibly applicable to the Real World ™. But I like to think I was adding features to make the software work as a user expected it to work. I was learning unassigned lessons about user interface. I think the word for this is “passion” - I really loved programming during college.

Shortly after entering the corporate world, I quit my experimentation. There was no encouragement from within; no extra time offered for experimentation and growth. There was little tolerance for false starts and giving things a try. Strict up front planning was rampant. Annual education allotments were 24 hours, but I learned that gaming the system was preferred. Education options provided were a mix of Microsoft Word for Business, pursuing insurance and financial services designations, and a little morsel of technical stuff thrown in. All technical options were job-applicable to a fault. Again, experimentation was discouraged and deemed of very low value.

This is not to say I was forced into my ambivalence. New to the world of employment, I was easily swayed from the path I was on. Somehow I forgot what I loved about programming in order to “learn the ropes.” It was my responsibility to remain engaged in my career, and I failed for a long time to own up to that responsibility.

Over time I no longer even knew what technologies I could explore if I wanted to explore. Programming became a job in the sense that collecting money at a parking ramp or pounding nails is a job. I would leave work at work, which is something I encourage. But eventually I found leaving the tools for work at work was leading to a hole in my career. Something I was formerly so passionate about was becoming a negative, job-is-a-job part of my life.

Programming is a field where passion translates to practice and practice translates into success. One passionate at building eventually needs to stop pounding nails in order to progress in his career. In programming, you can have a very rewarding, and growing, career while writing code the whole time. In that sense, programming is more analogous to artistic and sports fields. It has been theorized that it takes 10 years just to get started in programming. The easy choice is to save tech learning for work hours. It’s an unfortunate decision because if one’s job does not provide enough time for practice, one misses the opportunity for success and fulfillment.

I entered this field precisely because of the changes inherent in the industry, an industry that grows and evolves somehow faster than I ever could. The rewarding choice was to embrace constant learning and position myself to benefit from it.

Security of loyalty

Over the past year and change, I have been asked frequently “how did you hook up with those guys.” Typically, the conversation becomes less about “those guys” and more about the scenario that made a 7-year code monkey, husband, and father of two choose to jump out of the comfort of corporate life. (long intro & links to series articles)

Ethics and Morals: Timeless and Universal?
Photo by maistora

Loyalty is a tricky word. While it can mean intellectually binding oneself to a course of action, I believe it is most typically used in its emotional context. Loyalty implies a faith or devotion to a cause. I believe loyalty is one of the most dangerous impediments to a successful and rewarding career.

Consider loyalty to a corporation. Feeling loyal to your place of work sounds like a wonderful state of being. The idea only becomes absurd when restating as having faith in an individual corporation. Faith is a serious thing and it should be applied only after thoughtful consideration. A company hiring you or providing cursory training should in no way require you to tie your wagon to them for the distant future. Their decisions were not emotional, but rather calculated and intentional.

Successful relationships with companies are built on a foundation of trust and respect. If a company treats you with trust and respect, it’s pretty easy to get along with them, giving them trust and respect in return. You may have disagreements, but when trust and respect are involved it is much easier to be objective about such things. If a company refuses to treat you with trust and respect, but rather depends on instilling a sense of loyalty in you, well, your internal alarms should go off.

As a young employee, I experienced a corporate culture whose goal was to tie my job situation as their employee to my career. Early on, meetings with my supervisor discussed my future goals. Would I like to be a team lead, project manager or supervisor? These are long-term goals equated with long-term employment.

Likewise the career advisors at college pushed the job-as-a-career ideal. Professors had little opinion, since most spent little time in the private sector. “Career counselors” had plenty to say about which companies were good. Generally this meant if a company consistently hired students from the school and participated in campus outreach, the company was good. Little consideration was given to whether a company could help me reach my career goals. I have since learned that it is very important to understand one’s personal career goals as early in the game as possible.

My job was something my employer cared greatly about. Their goal was to keep me slightly more motivated than disgruntled. The corporate phrase for this process is “career management.” Career management is the process of selling you on the idea that your job with the company is your career. I believe this is most prevalent at companies who hire heavily from the pool of new college graduates.

Unfortunately for the employees of the world, “career management”" is not particularly beneficial to their careers. A career is something only the employee, and those who depend on her, truly care about. While some employers may have altruistic motives, most corporations have very little flexibility to align individual employee’s career goals with their career management track.

It is difficult for a young person to understand the difference between taking responsibility for his career and investing himself in corporate career management. To the employee it appears the company has invested countless hours trying to progress his career. The employee feels it would be unethical to ignore this contribution to his betterment. He owes it to the company to stick around for n years and put in his time. It is the comfortable choice.

Divorce yourself from the fallacy of equating corporate and personal career management. A career is the individual’s responsibility alone. If it is heading in the wrong direction, only the individual can redirect his career. If you are not being appropriately challenged in a job, it is time to look elsewhere.

Rails date calculations could stand some timezone love

New Rails handles a lot of timezone stuff for you. Set the appropriate time zone for the request and get an object from the DB, it’s created_at date will be translated from UTC to the request’s time zone.

Rails doesn’t do anything with the Ruby enhancements that create time objects from dates. Like:

Date.today.end_of_day

That’ll be in the server’s time zone. Ick.

I needed to find the beginning of a day as related to the request’s timezone. I moved the fix into some date extensions:

class ::Date
  def beginning_of_day_in_zone
    Time.zone.parse(self.to_s)
  end
  alias_method :at_beginning_of_day_in_zone, :beginning_of_day_in_zone
  alias_method :midnight_in_zone, :beginning_of_day_in_zone
  alias_method :at_midnight_in_zone, :beginning_of_day_in_zone

  def end_of_day_in_zone
    Time.zone.parse((self+1).to_s) - 1
  end
end

So now we have:

> Time.zone = "Auckland"
=> "Auckland"

Date.today.beginning_of_day => Tue Dec 09 00:00:00 -0600 2008 Date.today.beginning_of_day_in_zone => Tue, 09 Dec 2008 00:00:00 NZDT +13:00

Realistically, I think Rails could be improved in this area. Or maybe I’m missing out on a better way to take a date object and make it zone-aware for generating related times. I spent more than an hour reading through the Rails date and time extensions and realized I need to keep my timezone pain relegated to the work week. For the time being, the above is a nice crutch for my current needs.

Thawing the brain

This post originally published at the Iridesco Watercooler.

“Maximizing Developer Value” was the unfortunate subtitle of Code Freeze 2009, held yesterday at the University of Minnesota. The most interesting theme was more approachable: brain hacking. Some highlights:

  • Your left brain is loud and obnoxious. It’s always chatting.
  • Your right brain has things to say, and considering it’s the creative lobe, it benefits you to find a way to listen.
  • Mindless sequential tasks (shower, toys/puzzles, lawn mowing) can distract your left brain, allowing your right brain to speak to you.
  • You may find success assigning yourself right brain tasks before entering the shower or falling asleep.
  • Right brain thoughts are fleeting – have a way to capture these thoughts as immediately as possible.
  • Music occupies your right brain, so prune your “creativity” playlist appropriately. Music may be a hurdle you never knew you were putting in front of your creativity. Often noise is the best solution to block out the aural distractions.
  • Verbalization, even to inanimate objects, often engages the brain in different and useful ways. Sufficient sleep and moderate exercise are easily the best ways to maximize your brain’s efficiency.

Kicking off a new year makes it easy for me to live in “try new things” territory. I took a shower without NPR playing on the shower radio and suddenly I came up with the perfect idea for my first RUM presentation. I may also make lawn mowing a podcast-free zone, assuming summer/global warming ever returns. Music will be an ambiance for email checking. And I may have to invest in a sock monkey to talk to since I’m 1200 miles from the nearest work conversation.

Suggested reading: Brain Rules, The Productive Programmer, Pragmatic Thinking & Learning.

(Panel: Luke Francl, Nate Schutta, and Neal Ford.)

Hardware and software

John Nunemaker at RailsTips recently asked the Tubes what hardware and software was being used to complete work. Here’s my rundown.

Hardware

My workspace
(annotated version)

My deck is a MacBook 2.4 GHz Core 2 Duo with 4GB RAM. I’ve been using an Apple Wireless keyboard for a while. I loved typing on my Microsoft Ergo 4000 board, but it’s so damn wide. My shoulder thanks me for the Wireless even while my wrists are slapping me.

I also have an auxiliary computer, a Mac Mini. It serves a slave purpose most of they day, playing music from iTunes and providing API docs on the second monitor. It has saved my bacon as an emergency work machine in the past. Behind the BenQ 24″ monitor sits a 250GB Western Digital Passport drive for backup. More about that later.

Shure E2c headphones provide complete aural privacy when needed. However I have grown tired of these as in-ear headphones bother me rather quickly. Even though the Shures provide about 9 different pieces of in-ear hardware, none of them quite work for me. I’ll probably move on to an over-ear solution soon.

Software

Let me get the basics out of the way. TextMate, iTerm, Safari for speed, FireFox for developing, Skitch, CocoaMySQL (which has apparently disappeared), and Quicksilver.

Time tracking is Harvest country. Actually, I interact with my time almost exclusively through Co-op’s integration with Harvest. I do visit Harvest for reporting and such.

For email, I pretty much use Gmail with Mailplane exclusively.

I don’t have a lot of calendaring needs, so I mostly use Google Calendar (watch out, still in beta). At some point I set up an unholy sync to iCal so I get PING reminders every so often. But honestly, I don’t trust the sync at all. If I ever have greater need for strict calendaring I’ll get it all figured out. (My personal email is also sort of on Gmail, though I don’t have Apps for [My] Domain set up or anything. Just an auto-forward.)

I work on a completely distributed team, yet I hardly never use the phone, audio chat, or video chat. On occasion I’ll use Google Chat to have a quick conversation with my team. For the most part, Co-op and email keep us connected. Oh, and we’re using an internal app to deal with our tickets and plans. Not sure if I’d call it a project management app, though. Project management is a bit too highfalutin for us. :)

I’m pretty sure Things is my thing for personal task management. Will have to decide within a few days.

Big point. Get a backup system. A bootable backup is preferred if you depend on working hours to make money (i.e. you’re not salaried). I have partitioned my Western Digital 250GB Passport such that it can hold to entire bootable mirrors of my MacBook. I then use SuperDuper! on a schedule to create a mirror on alternating partitions each day (except Sunday). In the end, this gives me two days worth of bootable partitions at any one time. I have used this to work for a week on my Mac Mini (booted from the Western Digital drive as if my MacBook) while my MacBook was in the shop. Saved my bacon, I say!

Wait, now that isn’t so much a backup system as a recovery system. I also send all of my important files, as well as every family photo, nightly to Amazon S3 via Jungle Disk. I can’t recommend it enough.

Some other apps I find myself using throughout the day: RapidoWrite, Twitter, Twitterific on the iPhone, Google Reader (for personal feeds), Fluid (for app instances of Twitter, Google Reader and Co-op), NetNewsWire (for work feeds), growl, jing (for quick videos to share with the team), Flickr (for quick photo shares), SmugMug (to share photos with my family), Don’t Break the Chain (to keep me exercising, reading, writing, and sleeping), VueScan, PDFMergeX (for reassembling scanned documents), FuzzyClock (who needs to know the exact time?), SpiritedAway (auto-hide unused apps), iPhoney, NeoOffice, Pixelmator, Fusion, github, and gitx. When I need to take a note, I do it in text files which I can search with Spotlight. To ease the sorting pain, I use some Automator scripts.

Hopefully this quick rundown has given you some ideas for things you can improve in your work environment. Keep in mind, home office workers, watch out for bling creep. If you have an idea where I can improve, please do share!

Educating software developers

knuth
Photo by bitmask

My brother recently shared with me an interview with C++ designer Bjarne Stroutstrup, speaking about educating software developers. Stroustrup recently entered the world of teaching after decades as a Bell Labs researcher. As you can imagine, Stroustrup had lots of good things to say.

The highlights for me tended to relate to my own career trajectory, as well as places where I see a reflection of my deficiencies. Stroustrup’s thoughts on the dissatisfaction corporations have with the current crop of computer science students:

Robert Dewar made an essential point. The companies are complaining because they are hurting. They can’t produce quality products as cheaply, as reliably, and as quickly as they would like. They correctly see a shortage of good developers as a part of the problem. What they generally don’t see is that inserting a good developer into a culture designed to constrain semi-skilled programmers from doing harm is pointless because the rules/culture will constrain the new developer from doing anything significantly new and better.

Lowest-common-denominator developer management is both lazy and antithetical to creativity. I’ve experienced this, as I’m sure most reading this have. Providing a hospitable environment for quality developers would lead to less cost for greater productivity, as a result of having fewer, better developers.

On a vital missing piece in most CS programs:

The aim is to instill a degree of professionalism; to get to the point where the students can write software suitable for the use by others than themselves.

This one, simple concept was missing from my CS education. Other than the occasional pair project, there was never any real consideration for maintainability and readability of code.

On what high school education is best to prepare the future developer:

What should high schools do to prepare students for university-level software development? When I entered a Math course as a 1st year student, the department head said something like this in his welcoming lecture: “I don’t care if you know math – we’ll teach you that from scratch – but I hope you know how to work hard and to read & write English, because you’ll need that to keep up.” I think he had an important point: current freshmen appear to have been spoon fed and many find it hard to adjust to independent work and to shake the impression that you work only to improve your grades.

With only anecdotal evidence, I can’t imagine the latest crop of high school students experiencing a renaissance of advanced communication skills. At the very best, I’d guess they are at the same, deficient level as I was exciting high school. While I won’t go so far as to suggest all high school students should complete speech and/or debate coursework, it’s pretty clear to me that any college-bound kids should be sent down that route. And this is coming from someone who works in an environment that uses 99.9% written communication.

On teaching the art of programming, as opposed to the craft:

I think aesthetics can be taught to many. Mostly it is a case of repeatedly showing students good examples and explaining why those examples are good. This takes time, years. I would like for programmers to present portfolios of their work, much in the way artist (including architects) have to. I don’t think everyone is cut out to be a programmer, just as not everybody is cut out to be a musician. Thus, we should not claim that program aesthetics is teachable to everybody. Drawing from the experience of crafts and arts, we should consider instituting a system of apprenticeships.

It will be interesting to see if all of this CS “apprenticeship” discussion coming from the thought leaders in our industry ever comes to fruition in the next decade. I personally find the concept to be intriguiing and I’d love to see a more in-depth description on how such a program would be built.

Stroustrup also talks about the much maligned “Java universities” and how their high-level teaching method is spitting out subpar developers. This is where I wince a bit. While my education was definitely skewed to the low-level, I have not even skimmed an entire data structures and algorithms book since graduation. Bad developer!

What do you take away from Stroustrup’s interview? Does it cause a lot of self-inspection, or do you think more about the changing CS education landscape?

Announcing time warp ruby gem

When writing tests, it is often desirable to bend time to test limits and edges of the day. It is especially useful to warp time to test results across the timezones of the world. Manipulating time is also useful to assure a day of the week, month or year every time the test runs.

Some may say “Why not just mock Time#now?” I see the point, but I find mocking around with baseline Ruby classes to be asking for trouble. Eventually unusual behavior will rear its head and a day will be lost debugging tests - the most excruciating debugging one can be subjected to.

For all of your time manipulation needs, give time warp a try in gem or plugin form.

Filter unwanted tweets from your Twitter stream

Ever find yourself annoyed by frequent talk of elections, memes and kitty-cats on Twitter? I have created a user script to apply to your Twitter Fluid instance or Firefox Greasemonkey install to enable regex whitelists and blacklists for filtering out tweets in your Twitter stream.

With this script installed, you will see whitelist and blacklist entry fields at the bottom of your sidebar:

The filter only applies to twitter.com/home* URL’s, so you will always see the entirety of a user’s tweets when visiting her homepage or browsing elsewhere within Twitter. As long as cookies are retained, the filter will remember your selections. Change your selection and hit enter or click away from the field to see immediate updates to your Tweet filtering.

Go ahead and install it.

25+ celebrity Twitter users and their follow costs

Mashable recently published a list of celebrities using Twitter. Before you go out and start following your favorite Stargate Atlantis star, it’s best you take a look at his follow cost.

Actors

Musicians

Politicians

Techies

Writers

The follow cost team

Fading flash message

Rails apps love flash messages. Little notes providing information, confirmation or warnings to the user. Typically implemented in a partial like so:

<% if flash[:warning] -%>
   <div id=‘warning’><%= flash[:warning] -%></div>
<% end -%>
<% if flash[:notice] -%>
  <div id=‘notice’><%= flash[:notice] -%></div>
<% end -%>

There are many cases where the message does not need to stick around for long. Consider a page with lots of AJAX interactions. Perhaps the user sends a message, which causes a page reload with a flash confirmation note (e.g. “You’re message was sent.”). After this the user will remain on the page for a relatively long time, maybe inline editing some properties or settings with AJAX tools.

It sure would be nice if that flash message would fade into the sunset after a few seconds and give back its valuable real estate, yes? Especially without forcing every flash message to disappear like Bobby Fischer.

Ask and receive, my friends. Introducing the fading_flash_message method, to be added to your nearest ApplicationController:

def fading_flash_message(text, seconds=3)
  text +
    <<-EOJS
      <script type=‘text/javascript’>
        Event.observe(window, ‘load’,function() {
          setTimeout(function() {
            message_id = $(‘notice’) ? ‘notice’ : ‘warning’;
            new Effect.Fade(message_id);
          }, #{seconds*1000});
        }, false);
      </script>
    EOJS
end

Setting a fading flash message in your controller is simple:

flash[:notice] = fading_flash_message("Thank you for your message.", 5)

This is change we can believe in, my friends.