My .vimrc

Vim session

I’ve had a few requests for my Vim settings recently. I might as well share it in a blog post. So here’s my .vimrc.

Why is the iPhone a big deal?

Oh hellooo there

I know this. Put an iPhone into my hands, and I want to build software for it. There is just something about this device that compels me. I want to write something for it, even if I end up being the only user of my creation.

I never have this reaction when I interact with Windows Mobile & co. I wouldn’t even bother downloading the SDK unless I’m working for a shop that builds applications for one of these platforms.

So I do download the iPhone SDK and I check it out. And I go wow, I can do all this with minimal fuss? This thing makes me look good! But wait it gets better. They give me an app store that allows me to reach millions of customers. Sign me up!

And ladies and gentlemen, this is why the iPhone is a big deal. There are thousands and thousands of developers out there who are thinking the exact same thing.

Topre Realforce 86U

Topre Realforce 86 Keyboard

I’ve had the Topre Realforce 86U tenkeyless (no numeric keypad) board for several months now. It is my all time favorite when it comes to keyboards. It’s got a superlative key feel and a fantastic build quality. Plus it comes with a red esc key. That has to count for something ;)

The tactile feedback; the soft, rhythmic thock thock of the keys on the way back up; the sheer poetry of cutting code in Vim while I’m in the zone. That’s the drug I live on. The creative high that I keep chasing. The reason why I program.

New Vim colour scheme – vylight

If you like this colour scheme, check out vydark, the dark background version.

I have recently started playing with Objective-C and Cocoa. One of the first things that I did was to tell Xcode to use MacVim as my default code editor. In the past, I have mostly been using Vim colour schemes with dark backgrounds.

However, I now wanted a colour scheme with a light background. Something that would fit in well within the Xcode environment and OS X in general. It had to be subtle and easy on the eyes. I looked around, and couldn’t find one that I liked. So I made my own. I’m calling it vylight.

Here’s a screenshot showing syntax highlighting for Objective-C. Search strings are highlighted in light yellow. Selected text is in light blue to fit in with aqua. TODOs and FIXMEs are highlighted in light green in comments.

Text highlighting in vylight

This is what omni completion looks like:

Text highlighting in vylight

Syntax highlighting in PHP:

Text highlighting in vylight

And JavaScript:

Text highlighting in vylight

Installing vylight

  1. Download the latest version of vylight.vim from vim.org
  2. Copy the file to your ~/.vim/colors/ directory
  3. In Vim, do :colorscheme vylight

That iPhone thingy

So I got an iPhone 3G last Friday. Initial thoughts:

  1. The screen is absolutely gorgeous.
  2. The Exchange integration works as advertised. I’m now getting my work emails / calendar events pushed to my phone. The challenge now is not to become a slave of my email.
  3. You quickly take the GPS functionality for granted. Got a meeting at a client’s site? Search for the address, tap “get directions” and “from current location”.
  4. SMS listed by conversation. The way it should be.
  5. It doesn’t take very long to get used to the on screen keyboard.
  6. It does not take very long to fill up the iPhone with 8GB of content. Go for the 16GB model.
  7. Polish through and through. This stuff is years ahead of the Symbian/UIQ stack that came with my previous smartphone.
  8. Twitterrific gets my vote for the best app so far in the app store. I just need something like Adium for the phone and I’ll be set.
  9. The remote app gets my vote for the second best application in the app store.
  10. Playing with this device makes me want to build software for it.

Apple make gorgeous hardware, but their main strength is that they understand software, and how to build great systems (the plumbing) and applications (user-facing). They see themselves as a software company that happens to build hardware too. Contrast with HTC who make very good smartphones, but who ultimately rely on Microsoft and the WinMo stack.

The importance of iTunes cannot be underestimated. No one had an answer to it in the PMP market. Now mobile phone manufacturers may find that building a better phone than the iPhone is not enough. Building a better OS than the iPhone OS may not be enough either. On the other side of the equation lies iTunes, which is more than just a syncing app. iTunes is about content distribution (music, movies, TV shows, audio books, applications, and whatever else Apple decides to get into really).

And how about MobileMe? Can you see another phone manufacturer getting into… web 2.0?

So it’s about:

  1. The hardware
  2. The software
  3. The content
  4. The services

No one else is offering a stack like this.

PHP is not a framework

This post started as a comment on Kay’s blog post about Akash Mehta’s post titled “Last we checked, PHP IS a framework”. But my comment veered off-topic. So here we are. Feel free to recurse back and read what they had to say on the subject.

I would not call PHP a framework. I tend to think of it as a language that has a useful set of built in functions that are geared for the web. Some of these functions have poorly chosen names and inconsistently ordered parameters, but that’s another rant for another day.

I think of these functions as a standard library. Frameworks tend to encourage specific patterns. PHP and its built in functions do not have an opinion on patterns. Thus, I make the distinction between a library and a framework. Even PEAR is considered to be a library by most people. So it is a stretch trying to call PHP a framework.

PHP is popular because it has a low barrier to entry. It is easy to get started with, it’s free, it runs on many platforms, and is readily available through most hosting companies. This means that it attracts a lot hobbyists and dabblers. I’ve seen my share of horrible, horrible PHP code. But nothing in the language prevents you from writing good, maintainable code.

Ultimately, the big guys like Yahoo! probably picked not just PHP, but the LAMP stack as a whole. It is a proven, fast, scalable stack. Importantly, it is also one that does not have a major stakeholder like Microsoft (.Net), Adobe (ColdFusion, Flash) or Sun (Java). With the recent talk of Microsoft acquiring Yahoo!, can you imagine the leverage that Microsoft might have had if Yahoo! had built its business on top of Microsoft technology?

When assessing PHP, it is often the sum that is the LAMP stack that wins out. Not the PHP part by itself.

.screenrc

What you do when you’ve been slack and haven’t posted for months? You think of something interesting to say. What do you do when your mind goes blank? You post a screen shot or a dot file. As a bonus, here’s both:

Screen shot of my xterm session in OS X:

And here’s my .screenrc file:

activity "activity: window ~%"
vbell_msg "bell: window ~%"
vbellwait 2
allpartial off
autodetach on

chdir
defscrollback 500
startup_message off
sessionname shane
altscreen on
bindkey -k kD stuff \177
shell -$SHELL

# Status and caption at the bottom of the terminal
hardstatus on
hardstatus alwayslastline
hardstatus string "%= %3n %t%? [ %h ]%? %="
caption string '%{= kW}%-Lw%{= kG}%50> %n%f* %t%{= kW}%+Lw%< %{= kG}%-=%D %d %M %Y  %c:%s%{-}'
caption always

# Window numbering starts at 1
bind c screen 1
bind 0 select 10
screen 1

Rediscovering Mylène Farmer

I first discovered Mylène Farmer in 1996, when I was still in high school. I remember watching a French charity event on television in which she performed the song Rêver (to dream) live. I was mesmerised by her beauty and her voice, by the emotion she displayed in the performance (she cried).

So here we are, ten years later. These days we tend to take search engines and video sharing sites for granted. Ten years ago I wished that I’d taped the show so I could experience it again.

I give you Rêver, by Mylène Farmer, in Les Enfants de la Guerre (TF1). The date is 27 November 1996.

Related links:

Two New Moodle Versions in One Day

Moodle 1.7 Beta

Martin branched Moodle 1.7 from CVS HEAD today and announced the release of Moodle 1.7 Beta. This is a beta release, and is not recommended for production sites. The release notes has a list of the headline features for this new version:

  • Roles
    Permissions based on fine-grained capabilities allow all kinds of roles to be created and assigned in all contexts around Moodle. This creates a great deal more flexibility in the permissions that you can grant to people.
  • XML database schema
    Added support for MS-SQL and Oracle with more databases to come. Developers now have just one XML file to edit when changing the database structure, and there is even a very funky editor for this file built into Moodle
  • New Admin interface
    Completely new admin interface, with accessible design and cool features to make access to settings fast and easy.
  • AJAX Course editing
    The Topics and Weekly course formats now feature AJAX editing which means you can drag drop blocks, activities and sections (weeks/topics) and it all happens instantly. No more page reloading!
  • Unit testing framework
    Making it easier for developers to write test code, which should ultimately lead to a more reliable Moodle.

Give it a spin, throw upgrades and course backups at it, and report any issues on our new bug tracker, my home for the the next few weeks!

Moodle 1.6.3

A new minor version of the current stable branch has also been cut. Moodle 1.6.3 is mainly a bug fix release. A list of improvements can be found in the 1.6.3 release notes.

As usual, you can grab the files from download.moodle.com.

New Look, Same Great Taste

FreeBSD Logo

I have migrated this blog over to the new VPS. This site is now powered by FreeBSD 6.1.

I’ve also finally upgraded to WordPress 2.0 and while I was at it, I decided it was time to get rid of the default theme. I worked on some design concepts for the new look, but in the end I decided to keep things simple and lightweight. The current theme is a modified version of K2 Beta Two by Michael Heilemann & Chris J Davis.

I have also done some reorganisation. The preferred address for the blog is now http://blog.node.mu. I know, I know, good URLs don’t change. I’ve made sure that all the old permalinks still work as before. I am just doing this now so that I can switch things around at some time in the distant future.

Expect some changes in the coming weeks. I’m not done yet.