Damian Sowers

I'm lead developer at Optek and founder of Mycelial and Briarpatch. I live in South Lake Tahoe, California.

Retriever: a new bootstrap theme with a very small footprint

I’m pleased to release my new bootstrap theme, Retriever. You can check out the demo here. You can download it on Github for free. Open sourced under the apache license. 

image

Write like a programmer

Hemingway was a great writer. He wrote simple, clear sentences with all fluff removed. He wrote like a programmer.

Use these simple rules to write your next story or blog post. The quality of your writing will improve. 

1. A paragraph should accomplish only one thing. One major piece of information should be the outcome. If two things are returned to the reader, factor out the second into its own subsequent paragraph. 

2. Cut out grandiose language. If a concept can be described with simple words, use them. Most writing is ego driven. Your message is damaged if you add unnecessary complexity. 

3. Decouple your paragraphs as much as possible from each other (A method which takes one argument is superior to one that takes two). A decoupled paragraph can be moved around and reworked. 

4. Refactor. Cut every extraneous word. A fifty-word paragraph is better than a sixty-word paragraph. If one word can be used in place of two, use it. 

Bonus tip: Write your post in a text-editor. It will get you into the coding mindset of being terse and meaningful.

Should absolute beginners to Rails start with TDD?

Ruby on Rails is an amazing framework but there is a lot to digest in the beginning.

It’s my belief that a newcomer will easily get bogged down if test driven development is thrown into the mix too soon. 

Here’s some advice to those who are just starting out: In the beginning, just work on completing a few functional projects so you don’t get burnt out. Add TDD when your spirit can handle another wrench. It’s better to hobble in a race and make it to the finish line than to not make it at all.

How to create web apps as a one-man army

Building and launching a new app is f’n hard. It’s even harder when you have no one to share the work with. 

I’ve put together a list of hacks that can help you pull this herculean task off. These ideas are all about taking advantage of existing resources to maximize your time and payoff. (note: these ideas are mainly for Rails developers)

  • Use scalable cloud architecture that requires little setup time for your servers. Heroku will save you countless hours and can scale to meet your needs when you reach the first page of Hacker News.
  • Load test your app before you launch with blitz.io. You will be able to fine tune exactly how many dynos you need to spin up when the traffic starts flowing. Heroku has a gem add-on to make this easy. The free version is more than enough to get a good idea.
  • Install Chartbeat to see exactly how many concurrent users are on your site at one time. This will give you a real-time look at what your server requirements should be. It also shows social media mentions in real-time so you can see the viral effects of your launch. If you reach over 200 concurrents, you’re having a really good day!
  • Setup automated database backups with the PG Backups Gem. Set it to the auto, one-month retention plan. This will take a load off your shoulders by handling your db backups for you. Be sure to test a db restore operation before going live.
  • Never design from scratch! Always start out with a pre-designed theme from themeforest or a bootstrap theme. Then you can customize it to meet your needs. Designing something from scratch will waste all of your time, and if you are a better programmer than a designer (like me), it will likely look like hell too. 
  • Don’t build a custom blog. Your programming time should be spent on your app, not your blog. There are tons of great blogging platforms out there. This blog, for example is built on tumblr. Your blogging time needs to be spent on creating great content, not on your css. 
  • Handle your in-app user uploads with the Fog gem and the Carrierwave gem. Setup an Amazon S3 bucket to connect to and save money on storage costs. 
  • Buy a subscription to Railscasts. The amount of knowledge in these videos is mind boggling. If you are wondering how you are going to implement some new feature in your app, there is probably a video which can help you out. 
  • Route your in-app email through an email analytics service like Sendgrid. This will allow you to see what percentage of people are reading your emails, etc… Metrics are everything for a startup. You can also improve user retention with a service like UserFox. This service will manage the automated email flow for you. 
  • Let New Relic handle your server monitoring. You will glean useful insights like which database queries are the slowest. There is a heroku add-on gem which makes installing this really easy. 

Paginating active record queries

A common problem I run into is how to go about paginating active record queries which are inside of a loop. 

Rails gems like will_paginate require a single query to work properly. What if you you need to build up an array with individual queries instead? 

Below is useful little snippet I wrote to tackle this common issue: 

Coders and Prospectors

The future is impossibly hard to predict. However, if I were to make an educated guess on its direction I would put my money into the advancements of fields that are comparable to gold mining.

Let me expound. Gold mining requires only a few things for success: A shovel, keen eyes, and the will to subject yourself to solitude and wilderness for long periods of time. This, in itself, sets it up for a revolution because the barriers to entry are so low and the potential rewards are high. Consequently, gold mining did have a revolution – a revolution which led to the settlement and development of the entire west coast.

If one looks at modern day analogs to the gold mining revolution, it’s easy to see that web development has the most similarities. To make a web app, all you need is a computer, some open source tools, and the will to subject yourself to isolation for long periods of time. The potential reward–scaling your app to billions of people–is even greater than finding that truck-sized gold nugget.

I have a hard time pinning down any other modern equivalents to gold mining and I think this is why progress has been extremely slow on a number of fronts. When I was a kid I imagined we would have human colonies on Mars by 2011, free energy, and cures for just about every biochemical malady. But these fields are crippled by the fact that they are guarded by committees. You need large government approval to setup a mission to mars, and massive venture capital to navigate the lengthy journey for a new chemotherapy cocktail. Committees have the propensity to destroy innovation and progress. After all, “a committee is an organism with ten or so legs but no brain.”

I would love to see more ventures that attempt to circumnavigate the traditional routes in these committee-guarded fields, and bring them back into the garage. I think this is the only way to see real progress. We need to make the medical industry accessible to solo prospectors. We need to find ways to remove the committees from the process of energy creation and space exploration and put the development in the hands of the coders and prospectors.

Have any ideas?

R-Strategy

Define Globals

K-Strategy: Investing large amounts of energy and time into few offspring, a trait which is predominant in stable and predictable environments.

R-Strategy: Investing very little energy into each offspring, focusing instead on creating as many progeny as possible. R-Strategy thrives in unstable environments.

Kill The Baby

Like many other programmers out there, I started out as a K-Strategist and I failed. I invested all of my time and energy into one giant unproven idea over the course of eight months – A web app with a zoomable user interface as the main idea. The idea seemed extremely promising to me, but ideas always seem brilliant to their creators. Looking back now, if I had spent that time building 20 small apps (versus 1 big one), there’s a good chance that at least one of them would be paying out right now.

The problem with this web app was the idea wasn’t scalable. I built it with Silverlight (I will never use a proprietary Microsoft language again) and the bandwidth requirements were immense. I had a hard time recognizing these downfalls, though, because I was too busy basking in the glow of my beautiful idea.

But I learned from this costly mistake and I now approach every idea with a new perspective, which I call R-Strategy. The premise is simple: I try to create as many small web projects as possible, spreading out my eggs in a dozen different swamps. When I say small, I mean that every project has to be completed in the span of a weekend. This time restriction is extremely helpful when it comes to actually finishing projects. After all, we all know the feeling of abandoning the old app for the latest and greatest new idea that pops into our minds. Once the honeymoon period is over, it’s really easy to lose motivation.

Not only is this strategy really good for productivity, but I also believe it is the most successful approach in the volatile internet era. Just look at the track records lately for all of the lean startups that released something basic after just a couple of days of coding. There are so many open source frameworks available nowadays, it has never been easier to release a functional app with two days worth of work.

R vs. K

Why am I comparing the business strategies of 21st century programmers to animal reproductive habits? Well, unfortunately, we all have the tendency to let our biological reproductive instincts govern the way we nourish and raise our ideas. We treat our ideas like babies, even calling them our “brain-children,” and this is a fundamental flaw for programmers and anyone else who is looking to achieve rapid innovation. Once an idea has genetic roots it is extremely hard to kill or innovate. Nobody likes killing babies.

This is why every web developer needs to become an R-Strategist. If you are still living in the K-Strategy sphere, you might as well be buying lottery tickets instead. Putting all of your time and energy into one idea, one baby, without first testing out its fitness levels in the current niche is equivalent to gambling in the horse races. There will be the occasional gambler who wins, and the general population will think that winning in this fashion is quite common because a big commotion is made when somebody does hit the pay dirt, but overall the mammalian approach to web startups is a huge mistake.

Moreover, R-Strategy needs to be embraced by programmers for another major reason: the animal kingdom has selected R-Strategy as the most successful reproductive approach for creatures living in a highly unstable environment. 3.5 billion years of selection, to be precise. R-Strategy thrives when the environment is likely to change before an adaption can take hold and provide a competitive advantage for the organism. Does this environment sound familiar yet? No environment is more hostile and volatile than the internet startup sphere. Memes come and go, bubbles expand and pop, and the capricious whims of users change on a monthly basis. In March, all of the mindless drones might be drooling over Farmville, and in April they will be crying out for Angry Birds to regurgitate dead mice into their agape, salivating mouths. In other words, there is no room for a K-Strategist in a world where the rules change completely in a couple of months. The only way to survive and flourish in this kind of hostile environment is to do as the fish do: lay as many eggs as possible.

So, are you still a K-Strategist?