Use your widget sidebars in the admin Design tab to change this little blurb here. Add the text widget to the Blurb Sidebar!

Ruby-debug is awesome and always TDDin is dumb

Filed under: Software | 1 Comment »

http://gilesbowkett.blogspot.com/2007/10/debugger-support-considered-harmful.html

I really like Giles and his blog, but I disagree on this point.  I also get what he’s saying.  When your doing TDD, it’s a lot easier to find the point of failure because you are coding incrementally.  Red, Green, Refactor.  If you hit an error in the “refactor” point then it’s easy to see where because you just made a tiny change.

However, I don’t always TDD. I don’t agree with the idea that every code needs a test that goes along with it. At a certain point you have to decide which tests are worth your time and which aren’t. Also, most people agree that 100% test coverage is a waste of time which backs me up. With a lot of code, you would have to write 10x as much code in tests to cover all the possible different permutations of the code you just wrote.

So there you go: you don’t have tests for everything. So when you have a bug you are trying to fix, how do you narrow down what’s causing it? At that point, you have 2 choices. Logger statements, or ruby-debug. And I find ruby-debug to be a much quicker and more interesting to way to see what’s going on with the code than using puts statements. There are times when puts statements are faster…but usually not.

That said, I agree with the general idea that we should test first and debug later.


Does hating tools make sense?

Filed under: Software | No Comments »

Rails developers are a funny lot.
A lot of us would be seriously pissed if we had to use anything but Ruby and maybe Rails, and we would often be pissed if we were forced not to use Macs.

Why is this?

Because bad tools cause frustration.  If you are regularly frustrated by something, you start to think of it as annoying.  If you find a better way to solve a problem, you start to think of the old solution as pointless and dumb.   If you’re forced to still use that old solution, you move up into another layer: hate.   We all know that Java solutions are much more frustrating then Rails solution.s  As a result, we hate java.

We hate not using the best tool for the job

OSX is great because its based on unix i.e. command line, but it also has a bunch of great graphic tools that are very modern.   Linux doesn’t have a bunch of great GUI software on there, and Windows has shitty command line capabilities.


Programmers who claim to be business savvy are snake oil salesman

Filed under: Software | 3 Comments »

As soon as a “programmer” comes to me and claims to be `business savvy` I immediately get a little suspicious.   It’s very similar to someone naming themselves as  `social media expert`.   It’s just bullshit.  Often time the first thing I think is “shit, is this guy going to put his code where his mouth is?”

For a lot of the social media stuff and the business stuff, it’s very domain-specific.   This is why startups that hire a large amount of executive types are dumb and will often fail – they all have to “shake things up” and don’t actually add that much to the bottom line.  Plus, business isn’t enough of a definitive skillset to be very transferrable between different types of careers and organizations.  This is why Business majors do so badly on post-graduate testing.

The larger problem with this whole I’m a business man and programmer is that it’s meaningless.   In reality, I think most smart people, and especially engineers, are capable of making smart day to day  business decisions when properly informed.  It’s just that good engineers don’t have the time.

Now if you have an engineering background and you have run a few startups and enjoy being a CEO-type and want to continue doing that, good for you. I love working for engineer CEOs.

But if you are an engineer who just wants to claim he is business savvy for whatever reason, do us all a favor and just concentrate on being a good engineer and use your common sense for everything else.  There’s more than enough ways your organization can likely use your intelligence and dedication to improve it’s engineering to where all our companies can actually execute business goals better and faster.   In a lot of cases, there are business people who have been hired to do the real business roles – managment, corporate negotiation, and market analysis.

That said there is one type of engineer who relates to this conversion – the CTO in a heavily technically aligned organization.  I’m thinking of the great Eric Reis in an organization where the focus is on the technology to be so agile that the “problem finding” part of the organization can rapidly change directions based on results from engineering i.e. split testing and whatnot.   That’s the kind of business-minded programmer I like to see – one who wants to engineerisize business instead of businessize engineering.

In the end, just

Put your code where you mouth is.

And you’ll be just fine


Programming faster with the help of technology

Filed under: Software | No Comments »

I think it’s funny that programmers, being as tool-fanatical as they are (see my earlier posts on Textmate), often times we really only have one awesome must-have tool – our text editor of choice.  Maybe this is why GNU Emacs has grown to be so much like an operating system – we’re so obsessed with our text editors, that we feel the need to roll everything into them instead of just using something else.

But tools to accomplish programming are great.  Text editors, different types of unix tools to do different things like connect to databases (psql) and mess with files (autojump).  Search (ack).

But how many tools do we have that actually make us faster programmers?  Not many.   Maybe none at all.  Here’s a short list.

RescueTime – analyze how you are spending time and then later optimize. I haven’t used this yet.

Pomorodo Technique and Timer software – this is pretty sweet.

To-Do Lists like Emacs Org and collaboration ones like Trac, Basecamp. I think it’s funny there hasn’t become a defacto to-do list standard for programmers yet.

Blockers like Leechblock and Concentrate

I use all of this in conjunction (except RescueTime) to try to make me more productive.  However, two of them should really be integrated.  Namely, the Pomodoro Technique and the to-do list.

Here’s what I’d like to see – an application that does the following.

  1. Presents you with a list of (programming) tasks and their percentage done, the estimated hours remaining, and the option to start.
  2. Clicking start with then start a 25 minute timer for the pomodoro technique and ding when it’s done.
  3. Later you can view reports on what you did today and how long it took you off estimate.

Later you could add features like

  • Subtasks with projects as the parent
  • Planning todays tasks given available pomodoros
  • Per project notes
  • More advanced reporting
  • Desktop front ends for the timer

I think what this would allow you to do would be more accurate track what you’re spending your time doing so that you can learn how to be more efficient.

Update

I found an app that does basically what I wanted


Favourite Iphone Apps

Filed under: Software | No Comments »

Yelp – find restraunts on the go

Tweetie/Twitter – no explanation necessary

Waze – free turn by turn gps

Kindle – buy amazon ebooks and sync with with your ipad, kindle, or mac/pc

TWIT – streams new episodes of macbreak weekly and This Week in Tech

DailyBurn – find new workouts and do them on your phone

C25K – a running plan


Managing config files in Version Control – an idea for a gem

Filed under: Software | No Comments »

http://stackoverflow.com/questions/1449836/how-to-manage-rails-database-yml

First, move database.yml to a template file.

If you’re on Git:

git mv config/database.yml config/database.yml.example
git commit -m "moved database.yml to an example file"

Or, if you’re on Subversion:

svn move config/database.yml config/database.yml.example
svn ci -m "moved database.yml to an example file"

Second, ignore the .yml version.

If you’re on Git:

cat > .gitignore
config/database.yml

git add .gitignore
git commit -m "ignored database.yml"

If you’re on Subversion:

svn propset svn:ignore config "database.yml"

Third, install Where’s your database.yml, dude?:

script/plugin install git://github.com/technicalpickles/wheres-your-database-yml-dude

That plugin alerts developers before any Rake tasks are run if they haven’t created their own local version of config/database.yml.

Fourth, set up a Capistrano deploy task:

# in RAILS_ROOT/config/deploy.rb:
after 'deploy:update_code', 'deploy:symlink_db'

namespace :deploy do
  desc "Symlinks the database.yml"
  task :symlink_db, :roles => :app do
    run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
  end
end

Fifth, upload the server’s version of database.yml:

scp config/database.yml my_server.com:/path_to_rails_app/shared/config/database.yml

I found this while researching random stuff about config files.  Let’s ignore how long it is and focus on the long term maintenance hassles.

First off, you have to make every change in at least two files.

Secondly, if you have more than 2 environments this system falls down.

Thirdly, if you have multiple developers with their own database.yml files this option sucks because they won’t get changes on git pull or svn up.

Fourthy,   if you want to run QA in production mode or development mode, it’s not gonna work.

A better solution

I’ll look into creating a gem that does this at some point, but this is how I envision it.

Files

database.yml.master

database.yml.qa

database.yml.production

database.yml.slave

When Rails goes to read out of database.yml, it will first read database.yml.master, then overrwrite any settings in there with database.yml.slave.   Capistrano will sym-link database.yml.save on deploy to the appropriate environment.  This way, when you make a change, it should be tracked in svn but your .slave file can have it’s own specific overrides.


Release with bugs

Filed under: Software | No Comments »

Bugs are inevitable.

You can have a QA team and rely on them, to find all the bugs – but there are going to be bugs in there, QA or not.

I think what’s way more valuable is having a lean enough team to respond to bugs quickly and having code reviews to prevent seriously malicious code to get in (i.e. stuff that’s really going to mess up your database).

I am, however, curious about the recent WordPress.com issue that led to an hour or so downtime of a lot of famous blogs, including you-know-who famous tech blogger (left out so they don’t get more press).  I’m just wondering what sort of code caused the messing up of the config files and how that got through their automated testing.


Side Projects: One Pomodoro a day.

Filed under: Software | No Comments »

I’ve been thinking a lot about finding time for side projects.

Finding time to build stuff in your free time is hard and you need to balance it against other stuff – for me, a 27 year old post grad, that includes balancing it against several things, in order of priority

  • My girlfriend and my family
  • My friends
  • My job
  • My own need to relax and watch Lost.

where's the self actualization?

Where does the self actualization happen?  Is coding a means to an end, or an end in itself?  Well one way I like to figure stuff out like this is to look at the people I admire and see what it is that I admire about them.  So let’s look at some present and past day coders that I admire and what to be like.

1st up  – Jeff Atwood & Joel Spolsky

DHH & Jason Fried

It’s not good enough to

It’s not enough just to be a good programmer.  You need to make useful stuff and work for yourself these days to really be the bomb.   What can you get done in 25 minutes a day?


Takeaways from “Mindless Eating”

Filed under: Software | No Comments »

Follow the 80 20 rule – eat until you are 80% full.   The japanese do this.

It’s easier to change your environment than it is to develop self control.

We make about 200 food decisions a day.

We’re bad at estimating how much we eat when we eat in higher quantities.

If you eat a lot, eat with friends.  If you tend to eat a little, eat alone.


Nightstands with built-in outlets (it’s the little things that count)

Filed under: Software | No Comments »

At railsconf this week I was staying at a hotel, and immediatley I’m looking for a place to charge my iPad, iPhone, and Macbook at night. This is no easy task.  On the second or third night I’m turning on the light on my nightstand lamp only to see that there are two outlets built in!

You know what sucks? I spent 10 minutes looking for a decent looking lamp like this for home – we’re always plugging in laptops to watch Hulu in the bed, as well as dealing with iPads, kindles, iphones and cell phones – normally we are dealing with plugging into the badly placed wall outlets, which suck.

This would be a prettier and easier solution… if there were decent ones online.

So if you find any, leave a comment.