Tag Archives: life hacks

Blogging every day ≤ Coding every day

11 Nov

My life is pretty darned busy right now. Transitioning to a new job, travel for work, helping @dccp with her travel arrangements for her academic conferences, my own iOS projects, and my blog. Since the time I have available to work on my own coding experiments is limited to evenings and weekends. I’ve been recently attempting to focus on just one or two projects at a time, since for a while there I was coming up with at least 3 new prototypes per week.  Focusing on myDrumPad has really made it easy for me to give it the extra polish and attention it needs to take it to the next level. However, since I started participating in NaBloPoMo, the National Blog Posting Month, this has been consuming a great deal of my free time.

I enjoy writing about what it is I’m experimenting with, things I’ve learned in my iOS development, as well as other random tidbits that most people likely won’t care about. But writing about those activities have begun to overshadow the activities themselves. I don’t understand how prolific bloggers can balance their online writing, their businesses, as well as maintaining a happy family balance – perhaps they don’t?

I’m going to try to see NaBloPoMo through to the end, but what this is showing me is that either I put way too much effort into my blogging, or perhaps I don’t have as much free time as I formerly thought? Maybe it’s the fact that I got more done on the SkyTrain than I previously thought, and commuting in the car these past two weeks have taken more time of my day, but the progress on myDrumPad isn’t what I’d like to see.

How do other bloggers out there balance their blogging activities with their actual lives? Especially technical bloggers that write about iOS app development, web development, databases or scalability?

Revenue Canada wants me to buy an iMac 27″

10 Nov

For as long as I’ve been a developer, there was only ever once when I had a machine that I felt was an adequate development workstation. That was around 2001 when I had a dual-proc 667MHz P3 768MB RAM and three 17″ CRT monitors. This baby put out enough heat that my home-office didn’t need a heater on during the rainy Seattle winters; in fact, it was so warm in there that I’d wear shorts, a tee-shirt, and left the window wide open.

Since that time though, my computer has typically been limited to a laptop, my biggest since that dual-proc furnace being a 17″ Powerbook G4. Being a developer, there are three priorities that stand out above all others: screen real-estate, memory and CPU speed. Due to my history of being a web developer, only the first item on that list was a big priority. Since becoming an iOS developer, where your productivity is directly related to how fast you can compile your app, and how fast your performance profiling tools can run, I’ve encountered the other barriers developers face.

In the past though, I’ve largely been a cheap developer, opting to get by with what I have, or doing whatever I can to improve my productivity in other areas. However, for the first time since that space-heater with a RAID array, I have an opportunity to get the workstation I’ve been dreaming of.

Since I run my own personal business on the side, I can take advantage of tax deductions that normally wouldn’t be available to me. Computer purchases, like other capital expenditures, can be tax deductible, so the money I would have to pay the Government in the form of taxes, can be deducted from what I owe them. Normally only a certain percentage of that purchase price can be written off per year, in a process called amortization, so it’s effects are only moderately felt.

In Canada, as part of their economic stimulus package they put together to boost small business spending, they instituted a limited-time Capital Cost Allowance for 100% tax deductions on computer hardware and software purchases made between January 27th 2009 and February 1st 2011.

Think of it this way: assume I had a decent year of app sales on the iTunes App Store, and because of my extra income, let’s say I owe the Government $10,000 in taxes. Normally my only recourse is to dig up $10k (which, since I’m a good little business owner, has been sitting in a savings account all year long) and hand it over to Revenue Canada.

But because of this stimulus package, I have an option. I can instead buy $4,000 worth of computer hardware necessary to effectively run my business, and then only give $6,000 to the Government. No need to spread that deduction out over several years, no need to have the accounting hassle of carrying that equipment value over year after year. I see, I buy, I save.

There are limitations of course. Just as with other business deductions, you can’t cheat and take advantage of the system for your own profit. At home I use the equipment in support of my iOS development, web development, and any testing I need to do.

So what do I get for my last year?

This is the last year you can take advantage of this deduction, which really is a shame. But now that my side work is taking me to more and more demanding areas, such as Core Audio, OpenGL, and a little bit of video work, I feel that now is the time to invest in that dream machine I’ve always wanted and needed.

The question is, what’ll it be? Do I add on a cinema display to my laptop? Do I get a fully pimped-out quad-core iMac 27″? Or do I splurge and get both?  Based on my preliminary estimates for how much I’ll be owing in taxes, here’s my shopping list:

I’m probably going to wait until mid-December, or perhaps in January when I get back from my various weeks of travel.  What are your thoughts?  And if you’re a Canadian iOS business owner, what are you going to do to take advantage of the capital cost allowance?

Harder, Better, Faster, Stronger

25 Nov

On the train ride to work today I was listening to “Daft Punk” on my iPhone while reading my blogs, my usual morning activity. And as my mind wandered, the song “Harder, Better, Faster, Stronger” came on; it’s one of my favourites, as I’m an avid electronic music fan. But since I was reading Ajaxian and several other software industry business blogs at the time, the song seemed strangely appropriate. Everyone is trying to find ways of working harder, developing better software, releasing to market faster, and having a much stronger market position (honestly, this is what was running through my head). This made me think more about what I do to fulfill those 4 business goals, so well voiced by Daft Punk.

“Work it harder”

Personally, I like having a life. I have a wife, hobbies, Open Source projects I like to contribute to. And of course I have my day job where I do more than I’m asked to do, always trying to come up with creative side projects to help make more sales, improve the product, or visualize our usage data in a way to help us build a better product.

So given the cliché that we all have 24 hours in a day, and you have sleep, meals, and commute time involved, how do you optimize your daily work habits to maximize that time?

The way we do this at work is through Extreme Programming or Agile Software Development, both are complementary techniques to eliminate waste from the traditional development cycle. Planning documents, requirements analysis, task assignment and many other wasteful planning processes are typically eliminated.

Coming up with a comprehensive specification before the project is even started is dreadfully wasteful. They typically become a hindrance because no developer can possibly foresee what problems they’ll encounter part-way through. These development practices allow a team as a whole to be flexible, to adapt to changes mid-way through the development cycle, and develop the important bits first. If you haven’t heard about or tried Extreme Programming, I highly recommend you go read up on it. Extreme Programming Explained is a great introduction for people used to more conventional development practices.

The important thing I’ve found is that these practices can even be adapted to single-person teams. You have to alter a few things in order to get it to work for a solo team, but adhering to the principles of “Build the simplest thing that works end-to-end first, then refactor later” is perhaps the most important practice I can suggest. For myself, it’s hard to get lost in developing “Teh Bestest Softwares Evar!” Sometimes you have to take a step back, and question yourself as to what is truly important to your project? Go build that, and don’t waste your time with unnecessary frills.

“Make it better”

Cutting out what isn’t necessary, or building the simplest possible thing doesn’t mean eliminating best practices. Quite the contrary, Extreme Programming pushes very heavily on test-driven development. The ultimate goal is to write your tests before you write a single piece of code. It doesn’t have to be a difficult test, but when you first run it, the test should fail. Once you get a failing test, you write the corresponding code for your project to make the test pass. Then you move on to the next task, rinse and repeat. One of the books on our bookshelf here at work is Test Driven Development, and it’s a great book on learning how using tests to drive your development can really help. I actually need to re-read it again, since my test-writing skills are getting a bit rusty.

By stepping through your project one bit at a time, writing tests as you go, you ensure that any regression in your code is caught by your test coverage. If you’re developing applications that a user will interact with, either through a GUI or a web interface, then automated tests are needed to be able to programatically exercise your interface.

We use Selenium within a series of Windows VMWare instances. Our test runner machine spawns VM instances on our VMWare server, as well as installs fresh copies of our software on our test servers. It then runs our tests using a test harness I developed called Test::A8N to be able to execute our tests, remote-controlling the browsers from within Windows.

Along with all these tests, you need visibility into how your tests are performing. There’s no point in writing all those tests, if you never run them. So we have a nightly process that runs all of our tests in parallel across several servers (so that they can complete in a single night), and then renders an HTML “Dashboard” showing which tests passed and failed, summed up as Red, Yellow or Green. A wide-screen LCD display is easily visible by the entire team, and shows us at a glance just how we’re doing. If you see large patches of red, then you know you’ve got some bug fixing to get to today.

There are other philosophies behind both Extreme and Agile programming, but I won’t get into them here. I highly suggest you read one of these books, as they’re really eye-opening into how you can develop better software without the traditional pain and bureaucracy found in more traditional methods.

“Do it faster”

With all this attention to detail and automated tests, it’s important that your development is still faster than the traditional ways of writing code. Sometimes you have to throw out what isn’t working, and this includes your preciously-written code. If something that served your purposes a year, 6 months, or even 2 weeks ago isn’t serving you anymore, then it’s time for it to go!

Refactoring is the process of taking something that worked before, and altering or culling what doesn’t fit anymore, and writing fresh code to replace it. Many times this means throwing entire chunks of code away. It’s important to not be married to your software. It’s just work, you’ve got plenty more where that came from. Just write what is needed, and nothing more. Don’t over-engineer, since that future “Maybe” feature you’re coding for most likely won’t be needed or used anyway.

Case in point: here at work, a former employee had written a UI framework that all our UI pages were built upon. It handled navigation, Ajax code execution, and so forth. It served its purposes very well at its time, but as features were added it became more and more brittle. Finally, shortly before I was hired, they added localization support, and it broke the camel’s back. Developing new pages was tedious, time consuming, and was littered with unused features that no one knew how or even if they worked.

After a short time of dealing with this, I cut it all out and replaced it with something smaller, lighter, and custom-fit to what it was we needed to do. It cleaned up our URIs so they were easy to understand, sped up development significantly, and gave us a stable platform to continue our subsequent refactoring on top of. All of this, and we eliminated approximately 3,000 lines of code. We’ve settled on the MooTools JavaScript framework for our code, and extend it liberally to build our client-side Ajax UI.

The framework is still holding up a year later, though I know it will have to go through some growing pains later. It’s currently Apache2/mod_perl based, and we’ll eventually be ripping this out and replacing it with a lighter FastCGI wrapper. But the important thing to take from this is that we weren’t so tied to our code that we weren’t afraid to throw it away when it started to smell.

“Makes us stronger”

The end result of all of this is to improve everyone’s lives. The developers have more fun at work, the project gets completed faster, more value is delivered to the customer in a timely fashion, the shareholders make more money, and the business improves.

Therefore I like to find areas in which I can help the company. Partly because there are many more interesting problems than just what I work with in my day job. So I write tools to help the salespeople sell more software. I write tools to help the product managers identify what our customers need and use. I’m currently working with our documentation team to find new ways to represent our documentation to make it more visible to our customers when they need help.

Ultimately, if you think outside the box and thing about your project from your customer’s perspective, it opens up a much bigger world for you to find your niche. Forget about what your job title is or what you’re being tasked to do. What problems do your customers have? If you had to use the software you’re developing on a day-to-day basis, would you enjoy yourself? Or would you pick up the phone and try to find a new vendor?

There’s a great rant over on Seth Godin’s blog titled “Just doing my job.” Don’t hide behind your job title as an excuse to justify your company’s actions, and don’t use it as an excuse to be lazy. Expand your skills, help your customers solve real problems, and don’t write bad software.

“More then ever after, our work is never over”

Most importantly than anything, never blindly accept that what you’re doing now is the best there can be. Newer technologies are developed, better strategies for developing or planning software can be invented, and people become complacent. Always read, always learn. Attend conferences, teach others what you know so you can understand your craft better.

So it’s very fitting that the last phrase in Daft Punk’s “Harder, Better, Faster, Stronger” is this: “Our work is never over”.