Archive for the 'Development' Category


My Vim Setup

I’ve been using Vim as my main editor for well over two years now. After having used many editors in the past (from full blown IDEs like Eclipse and NetBeans, to simpler editors like TextMate), I’ve found my perfect match. It’s ubiquity and openness are winners (I’d be disheartened right now if I was using abandonware like TextMate) and the modal editing is exactly right for how I work (I wish every text area had modal editing!)

How have I tailored my Vim setup?
  • The biggest factor has been changing to use Tim Pope’s Pathogen.vim plugin recently. It allows you to keep your plugins separate in their own directories, which of course makes upgrading and managing them far, far easier.
  • I also rely on VimWiki. It gives me a personal wiki (I store the actual files on DropBox) which I can access almost anywhere (and importantly, cross platform), but get to edit with all of the benefits of Vim. Prior to VimWiki I had unhappily bounced around between Evernote, Yojimbo, WikidPad (years ago), VoodooPad and a bunch of other solutions.  VimWiki is the best of the lot so far, though WikidPad was popular with me a few years ago.
  • Probably the most used plugin would be NERDtree, a file browser. Far better than any other option out there.
  • Other plugins I have, in order of most to least used: NERDcommenter, BufExplorer, Snipmate, VCSCommand, Ragtag, rails.vim and surround.vim
  • I’ve changed my leader key to “,” as I find it a little less of a stretch.
  • I use the Railscasts theme, and use 256 colors.
  • I use ack as my search command
  • I occassionally use the Fuzzy Finder Textmate plugin.
  • I admit to having a bunch of stuff in my .vimrc that I’ve forgotten about. Looks like useful stuff though, so I can’t bring myself to remove them!

My .vimrc is attached.

InezGarcia.com

Finally, my clever wife’s portfolio site is live. I started building this years ago, but didn’t have time to complete, so with some help from Damien at Melion Design and Deena, it finally got finished.

Check it out: http://www.inezgarcia.com

It currently uses Ruby on Rails 2.3.5, jQuery and Paperclip for attachments. It’ll probably be the first Rails app I upgrade to Rails 3.0 too, as it’s such a small app it should be the ideal candidate.

Starting SICP

After many web and in-person recommendations, I can’t ignore the gold standard of programming texts, Structure and Interpretation of Computer Programs, any longer, and I’ve started to work through the book. (It’s actually been on my shelf for a few months now, but Masters studies have kept me away from it.) It’ll probably take me a very long time to finish this thing — I want to do it properly, and I’ll have to get back to the Masters in six weeks.

Anyway, nothing revolutionary so far, aside from general LISP syntax, but I’m only forty pages in. I do appreciate the obvious thought that has gone into structuring the exercises, and it’s where I think the bulk of my learning will be achieved.

I hope to post explanations of some of the ideas here, mostly to solidify my own understanding.  Here’s to the journey!

Vim Snipmate Cheat Sheet

I’ve never really used snippets much, but I’m going to try and start. To that end, I created a Vim Snipmate cheatsheet for my main snippet needs (HTML, ERB, Ruby, Rails, Rspec.)

This is based on two plugins for Vim: Snipmate and Snipmate-Snippets (from Scrooloose).

Get it here: snipmate-snippets vim cheatsheet

No photo, but it’s up on the wall just to the left of my current setup.

Components in Rails

I gave a talk at the RORO meeting in Sydney on Tuesday night (Feb 9th, 2010) covering the ideas of desktop development that have been used in web development, and how and why we might think of using components with Rails. In particular, I focused on two Rails based frameworks — Cells and Apotomo.

My slides (built for use with Scott Chacon’s neat Showoff framework) are on GitHub: Beyond Actions – Components in Rails slides.

My Programming Journey

Somewhat inspired by an old Jim Weirich post — yes, I’ve been meaning to do this for a while — here is a little history about my journey with computers and programming.

My dad worked with computers from before I was born, and we had home computers for as long as I can remember (at one time we had 12!) I’ll have to ask, but I imagine we had one from at least as early as 1982 (when I was 3 years old,) though there was no way on Earth I would even be allowed NEAR the computer at that stage.

No, my programming introduction began later. I’m not sure where it came from (possibly dad, perhaps the library,) but the classic series of books from Usborne on learning Basic, specifically aimed at kids, was pivotal for me. These books were mostly about programming games at various levels, but they introduced me to a wonderful world where the computer did what you asked. Soon I was also cruising Byte magazine for listings, really anywhere I could find more code. Everything I was doing at this stage was Basic, and while Dad had many other books, such as Peter Norton’s “Programmer’s Guide to the IBM PC”, these were largely impenetrable to me. It helped that one of my best friends in primary school was also way into computers. We swapped code, chatted on BBSes, and learnt a lot in the process (he now works for Pixar.) I loved coding, and created a lot of different programs, including a fairly rustic but workable text editor, a mouse based graphic program and a personal banking application. In fact, I’m convinced the banking application played a big part in winning scholarships to a couple of Sydney private schools.

Other random memories:

  • writing a column for the local paper about BBSes, winning an insane database package in the process. I believe it was called “Magic”, and boy was it a nightmare.
  • creating a programming language (in Basic.) I knew nothing about lexers and parsers, but the general structure was there. It couldn’t do much, but it worked.

During my teenage years I didn’t do a whole lot of programming. I was into the tracker music scene (though not particularly talented), and just general teenage stuff: sports, music etc, but I did build a robot controlled by my own code for a year 10 science project. The school computer teacher grilled me because he didn’t think I’d written the code myself, but after I proved I knew it inside out, he asked me to join the “programming team” for a statewide competition. Who even knew we had a programming team? I looked at the sort of things they had to solve, and they were so trivial and boring that I never joined up.

I still used BBSes a lot (I was a particular fan of Active BBS, and my friend Andre’s Mindflux BBS, both in Sydney), but when the internet first hit the mainstream I switched from BBS to internet and barely looked back. I built my first webpage in 1995. When I think back to the head start I had in that area, I really should rule the internet now!

I’d always had a general idea I wanted to be in business — for some strange reason I found accounting books fascinating — so when it came time to go to university, I decided on a Bachelor of Sciene in Information Systems, a combination of computers and business. I enjoyed this and did reasonably well — well enough that the computer people thought I was good at business and the business people thought I was good at computers. I took my first full time job as a consultant straight after uni, and was thrust into the world of corporate Java work. Despite my degree, I really had no idea what I was doing for a year or two, and it wasn’t till my second job that my learning accelerated. Now I can’t get enough of it, I devour every book in sight, and am constantly trying to plug any holes in my technical knowledge (though I wouldn’t swap the business and management training for anything.)

What a trip!

My Tools of the Trade

Inspired by MIke Gunderloy’s “Tools of the Trade” post:

Having just upgraded the hard drive in my laptop, and taken the chance to do a fresh OS install, I’ve had the opportunity to review almost all my tools. Here is how I get it done:

Hardware

  • MacBook 13″ 2008 unibody, 4gb, 500gb 7200rpm drive – I use this all day, every day, and I *LOVE* it, easily the best computer I’ve owned. So physically solid, and OS X is the most humane operating system I’ve encountered, (but not perfect, oh no.) I’ve just upgraded to the 7200rpm drive, which seems noticeably snappier — although it could be the fresh OS install as well. Incidentally, I could only get a 500gb drive! I really only need a 250gb, but they’re just not available. Anyway, I’m hoping I’ll be able to get a 250gb solid state drive for under $500 in the next twelve months.
  • Standard Microsoft Mouse – Does the job. I’ve seen the Kensington Expert Mouse trackball mentioned twice in the last 24 hours, so I’m taking that as a sign, and will probably try one out soon.
  • Backup drives — one at home, one at an off-site location. Rotated every couple of weeks. Backups using SuperDuper! nightly. Basically following JWZ’s advice

Software

  • MacVim – I never really gelled with TextMate. Vim feels like home, even though I only really started using it in anger mid 2008.
  • Eclipse – Mostly I hate Eclipse. For the benefits (code navigation and refactoring), the hassles just seem to much. Don’t get me wrong, I know my way around it, and I’m efficient at using it, but there’s too much lost time as well. An IDE is essential for Java work.
  • Pixelmator – Pretty easy to use, though I don’t push it much.
  • Namely – I used to use Quicksilver, but it seemed like overkill, and wouldn’t pick up new applications quickly enough (probably configurable, but it should just work.) Namely JUST launches apps, and does it quickly.
  • Evernote – Unbelievably, you can’t seem to link between notes, or make a note hierarchy. I don’t like Evernote all that much, but there’s an iPhone app, and the sync seems reasonable. I wish there was a better option.
  • 1Password – It works, but they’ve really messed up the 1Password 3 / Snow Leopard issue.
  • Zotero – Crucial tool for organising my academic readings. The magic is it takes citations straight from Google Scholar, and handles different formats for material seamlessly. Combined with Skim (see below) it feels like a differentiator compared to my classmates’ systems (Endnote, for instance, which just feels prehistoric.)
  • Skim – Beats Preview for annotating PDFs. Works brilliantly in tandem with Zotero.
  • SuperDuper! – Schedulable backups.
  • Things – There are a million organisation apps and systems out there, and I’ve tried a few, and this one seems to do enough to stick. Probably the fact that there is an iPhone app means something to me, even though the sync system is annoying.
  • VMWare Fusion – Parallels was my virtual machine of choice with my first Mac, but VMWare Fusion just seems faster and more stable. Looking forward to the 3.0 release at the end of the month.
  • Balsamiq – This is a great way to create mock ups of user interfaces. The best part is that they’re a little rough, so clients don’t get too attached. Kills Visio.
  • SizeUp – A nice way to tile windows in OS X. It’s no Awesome (a Linux tiling window manager,) but it does the job.
  • SelfControl – Because sometimes/often I can’t stop the distractions from, well, distracting me.
  • OpenOffice – Works great for me, although we have Excel spreadsheets for reference data that have macros, and OpenOffice doesn’t help here.
  • Fluid – Mainly I use this for a dedicated JIRA browser.
  • Firefox – Wins for its supreme web development tools, like Firebug.
  • iTerm – I’d use Terminal, but it doesn’t do 256 colours without a lot of hackery.
  • Adium – I don’t really like chat all that much, but this works.
  • Colloquy – Man, I really suck at IRC. I fire this up about once a month.
  • iTunes – I fought iTunes for so long. Songbird had my vote, but when I got an iPhone, it had to be iTunes.
  • VLC – Plays media! Works!
  • Unison – A great way to keep my music library in sync over two machines.

Incidentals

  • iPhone – Best phone ever. Man, when I think back to that stupid Blackberry that I dealt with for a year, I get all angry.
  • Mac Mini – Serves media around the house, and light browsing.
  • Dell 24″ LCD – This was great when I was doing a lot of work from home, but its just the Mac Mini screen now. It rotates to portrait orientation, which is great for coding.
  • MacBook Pro 15″ 2006, 2gb, 80gb – This was my first full time Mac, a nice computer. It doesn’t compare to the new one though. It is my wife’s computer now.

Wish List

  • Fancy keyboard – Kinesis, Das Keyboard? I don’t know, but it feels like I should have a swish keyboard.
  • Trackball mouse – As above, I think I’ll try a Kensington Expert Mouse this week.

Objective C vs Ruby

I was asked yesterday for advice on the best language between Objective C and Ruby to learn for someone new to programming, who is hoping to be employed working with that language in the near future (an important point).  Here’s my response:

These are two ‘hot’ areas generating a lot of buzz here and abroad.

For the Australian market, I’d recommend Ruby because its best use case is developing websites in Ruby on Rails and there is plenty of demand for websites at all levels, from small sites to large.  Plus working with the web will teach a set of skills that is transferable to other programming languages — such as using HTTP correctly and the ubiquitous HTML.  Ruby is syntactically reasonably simple, and makes a great language for learning the princuples of programming.

Objective C on the other hand has two main use cases currently: desktop software and iPhone applications.  Experienced developers can make serious money in these areas, but it is far more random, and not an area where you can build a career, particularly in Australia where the demand is minimal.  Objective C is could be interesting as a second or third language, but I’d advise against starting with it.

Too Many Options

A couple of posts ago, I mentioned my concern that Merb could add too much flexibility to the Rails world, and that the abundance of options would increase the barriers to entry for new Rails programmers.  Having watched the Rails/Merb 3.0 commits so far, it seems that the aim right now is to fix things rather than add things, a good approach since it should be transparent for new and old Rails developers alike.

Anyway, Josh Susser thinks that we may be facing the issue of too many options and too much to learn already, and he could be right.

I have enough experience that I don’t have to spend much time pondering. But for someone new to Rails this all must seem pretty intimidating.

While I was thinking of framework options, the fact of the matter is that there are already a multitude of options for approaching almost any aspect of a web app in the Rails world now.  Java hit this state many years ago — Bruce Tate, a leading light in the Java world who moved to Ruby on Rails, had this to say:

Even if you do choose a popular stack such as Spring, your developers must learn potentially dozens of libraries that are specific to a given project. In this case, Java’s core strength, a plethora of libraries, works against it. In contrast, most Ruby developers know Rails.

It’s this last sentence that is under threat.  In a year or two, Rails development may be just as fractured as Java.

Now options are not a bad thing per se, but many options that are essentially the same add nothing to the game.  I’m thinking in particular here of testing, mocking, and fixture replacement solutions, of which there are bucketloads in Ruby right now.  As a group we’d probably be better off just letting one of them win and moving on with our lives.  For instance, it seems that by-and-large we will all be settling on Passenger as the main deployment platform for the time-being.  This is a good thing, and lets us speak in a common deployment language, and allows us to worry about other parts of the tricky business of web development.

Working with common options doesn’t stop new approaches and frameworks from emerging, but they will need to prove to be sufficiently better to make it worthwhile to move, which is a good thing.

All this is to say: it will be very interesting to follow the progress of the Ruby and Rails communities over the next couple of years.  With no dominant vendor (such as Sun with Java), organic growth is driven by community needs, but it would be good to see the philosophy of “convention over configuration” rule in most cases.

Vim

Jamis Buck’s influence on Ruby and Rails development cannot be overestimated, so I was excited this morning to read that he has switched back from Textmate to Vim.  I made a similar switch about six weeks ago, though unlike Jamis I don’t have a long history with Vim (some casual use over ssh connections, essentially), so there’s been a lot of learning for me.  But too many things annoyed me about Textmate to overlook.  For instance, no window splitting!  In 2008!

I’ve been an editor floosy over the last couple of years though — for Ruby work I’ve had love affairs with Eclipse, Netbeans, Textmate and now Vim, but Vim looks like it’ll be the one to stick — so much power and configurability, and all straight from the keyboard.

Next, to try out Jamis’s fuzzy finder extension, and NERD tree (a project drawer mentioned in the comments of his blog post).

Next Page »