Just Say No: Archives

Five reasons why you should use SVN for one-man projects

Sam Phillips, December 30th, 2007 8:36 pm

Often, when people are talking about version control systems, such as Subversion, an oft-quoted reason for its usage is the advantages it brings to collaborative working. This is with good reason – the system was written with the “many developers working on the same project” situation in mind, and this is why locking and merging et al is so important.

But version control is just as useful for smaller and/or personal projects – and as I’ve come to realise over the past week while getting to write more code than usual, using it can bring some major advantages to developing the “other” projects.

  1. Firstly, the no-brainer. Using version control means that you can roll files back. Large projects are planned and ideas are specified, and version control is often used for bug squashing and correcting mistakes. I find that it is less frequently used to “turn back the clock” on major portions of code (because they were just going in the wrong direction) because this situation is largely eliminated by planning. When I’m working on smaller projects at home, I’m often making it up as I go. It’s a good and productive way to code when you just feel like writing something, and are on your own time. Being able to roll back whole portions of the project (especially in Rails, using migrations) is a great way to allow yourself to experiment, knowing that even if you make some dodgy code decisions, they can always be rolled back.
  2. No need to trust yourself. I have always had a pretty good memory, not only for trivia, music/lyrics and names/faces, but also for code-related events – I can often recall when changes were made, at whose request and by whose hands. I’m a pretty good resource in the office in that way – but I am also very wary of reliance on memory. My mantra is to never trust yourself, and to use external systems to remember things wherever possible – à la GTD. Committing changes to projects via version control and always making sure I leave a long and descriptive comment means that I don’t have to rely on my memory when I come back to the project – perhaps days or weeks later. This means that coding at home can be what it should be – relaxing.
  3. Practice makes perfect. Using version control comes naturally after a while, especially in languages that are well-suited to it, but it’s still a skill that you need to work at. I like learning how to use some of the more advanced features at home so that, again, I’m on my own time, breaking my own projects. Using version control at home means that I’m continually getting better at it, rather than considering it a burden to be left at the office.
  4. Anyone who says version control doesn’t make life easier isn’t doing it right. Once you’ve moved into version control for some projects, everything else you work on feels rustic and lame. Developing under version control creates what appears to be overhead in the form of commits and maintaining working copies, but this is easily offset by the security it provides. Often I code late into the night (when it’s not a school night!) and by three or four o’clock, I can never be sure that the code that’s coming out is good. Under version control, this doesn’t matter. Wake up in the morning and revert the crap files, and keep the good stuff that only twilight hour inspiration can bring.
  5. Optimism. Under version control, you are taking every project seriously – this is a good thing, and it’s optimistic because you are telling yourself this is an important undertaking that may yet be something big, or at least something that helps some people out in some small way. And let’s not forget that version control works best when a project is born into the environment, rather than transplanted in later. Believe your work will be great, get it into version control from the beginning and let that experimentation that’s only possible with personal projects run free!

For big projects, I consider not using version control to be nothing short of negligent, because mistakes cost jobs and mortgages. For small projects, it is a great bonus feature, and allows experimentation and messing around to be easily coerced into something usable and maintainable.

BBC iPlayer: the return of ‘beta’

Sam Phillips, December 1st, 2007 7:21 pm

Google and the like have lulled us into a false sense of security about the word ‘Beta’. It’s hardly worth listing examples so I’ll just remind you of one: Gmail is still in beta, three and a half years later. Everyone I know uses gmail. It’s like saying that television is still in beta.

But of course, ‘beta’ is very much part of Web 2.0 marketing and, on the other hand, pragmatism. Release early, learn quickly, and realise that users are – generally – the best judge of products. They’re certainly the best barometer of their success.

Unfortunately, when it comes to BBC iPlayer, beta means what it meant 10 years ago – ‘not finished. At all’. And to call it a public beta is ludicrous. You need support for an operating system other than XP? Go fish. How about you prefer not to use IE to access stuff? Go fish. How about you don’t really feel the love for Windows Media Player? Go fish. Or maybe you think that the days of broadcasting rights, where the money is in the advertising/product placement etc, rather than the content of the show, are over and that DRM is little more than a throwback to the now-antiquated idea that the money is in the copyright?

Yeh. Fishing time for you. ‘Public beta’ my foot.

I presume, although I cannot say as I have no information either way, that my biggest annoyance with iPlayer also stems from this ridiculous corporate obsession with DRM. This is when programmes, some weeks, are not available for no apparent reason. Pretty much all I want to watch is Later with Jools, Have I Got News For you, and Never Mind The Buzzcocks. Everything else is on at a convenient time so I watch them live. These three programmes, however, I had got into the habit of missing (even if I was around and near to a TV) on the basis that I could download them on iPlayer, as I had been doing for several weeks.

Therein lies the rub. These programmes and – judging from the message boards, others – are not always available. With no explanation, stuff just isn’t there. First I thought that maybe the search facility was broken, so I trawled through the annoying navigation to confirm that these shows were, indeed, not there.

No wonder iPlayer doesn’t allow you (as far as I can tell) to subscribe to a programme and have it download automatically every week. This would instantly break when, with no explanation, programmes disappeared.

Terrible iPlayer context menuSo please, dear BBC, ditch your obsession with DRM and please tell us why stuff is disappearing. This will mean that you can keep people happy and move onto non-Microsoft products. Oh and dear reader, take a look at a different view of this subject. Tell me that programmes dissapearing isn’t a consequence of DRM and its underlying reasoning, and I’ll blame something else – next in line on the blame train is the stupid iPlayer interface, and in particular the context menu. Seriously guys, that menu belongs on a serial generator. I half expect to have homemade metal thrashing out of my speakers every time I open it.

I eat Wheetos for breakfast. Firefox prefers to gorge on RAM, all day.

Sam Phillips, November 4th, 2007 11:35 pm

To me, Firefox is a pretty near perfect piece of software; in fact I only have 2 major gripes with it. Firstly, you can only ever open one session at a time. Sure you can open multiple instances, multiple tabs, whatever, but these instances will always share cookies, sessions and ghost stories. There’s no way, yet, of sorting this out, which makes development a pain. Want to be logged into the same website as two different users? Time to boot up Internet Explorer.

Gripe number 2 is Firefox’s memory usage. Firefox looks at your system’s memory like Ronnie Biggs looks at a bag of money, and after only a couple of hours, it’s not uncommon to find that everyone’s favourite browser is using over a 100 meg of memory. If you leave your pc on overnight, as I did last night to get some downloads finished, and happen to leave Firefox open, doing nothing, expect to find it using up to 300 meg in the morning. Frankly, it sucks, and I seem to spend my life opening and closing browser windows just to keep them functional.

To put this problem in context, I feel it should be pointed out that internet browsers are usually the most demanding software packages running on my PC. Google Desktop is mostly tame and under control nowadays. Explorer (as in the Windows kernel) uses less than half your average, brand new, browser instance. MSN Messenger uses only just less memory than the kernel (bloatware tastic), and as I ran the tests below, I had Excel open to collate the results. Even this hefty program was using less than my web browsers, by some margin. I say this to emphasise that my system is hardly under stress; yet still rendering web pages with Firefox seems to be problem.

I’m not convinced that upgrading to version 2.0.0.9 has helped matters either; memory usage now seems worse than ever. This morning I decided to run some tests, side by side with Internet Explorer 7 (version 7.0.5730.11), over what I considered to be a fair sample of sites. I visit them all regularly and have chosen them because of their different technologies and function. For each test, new instances of IE and FF were opened, the relevant page was accessed (including any logins) and then the counter was started. I recorded the memory usage (in KB) every 2 minutes for 10 minutes for both browsers. Here are the results:

BBC News

BBC News is my homepage, and was 10 years old this week. It features biased and smug news reporting, a penchant for spelling, grammatical and factual errors (especially at the weekend) and some really quite terrible JavaScript red box things in the middle. Once it is loaded (88 requests later), it makes no further http requests. This doesn’t stop Firefox from continuing to eat up memory, however:

Minutes 0 2 4 6 8 10
Firefox: 47,136 47,732 50,744 51,088 52,236 52,232
Internet Explorer: 44,092 43,992 43,996 43,976 43,976 43,976

Ouch. As you can see, Firefox’s memory usage over the course of the test increases by 5096KB. Internet Explorer, on the other hand, has a pretty stable consumption, and actually decreases over the time period. Bear in mind that once this page is loaded, there is nothing else to do. Exactly what does Firefox need another 5 meg of memory for, then?

Facebook Homepage

Weighing in at 105 requests for the initial load, the internal Facebook homepage (the one where you see people you barely know leaving 10 groups at at time and adverts for Experian’s credit reporting), is a beast – especially when you remember that it is little more than text that is displayed. No matter for Firefox, though – it will use memory whatever the situation:

Minutes 0 2 4 6 8 10
Firefox: 58,256 61,554 61,620 61,554 61,558 61,776
Internet Explorer: 60,524 60,300 60,292 60,276 60,276 60,252

Again, IE is stable. FF is poor. What’s more, during this test FF was also constantly using between 1 and 6% CPU – presumably because of the flash-based advert served on the left hand side. IE rendered a similar advert but used 0% CPU.

Gmail

I fully expected Gmail to really humiliate Firefox. It does almost 2 requests a minute; meaning that at minute zero it had completed 65 requests, and by minute 10 that number was 82. After examining the size of these requests, however, I could see that the files returned were often around the 26b mark. This is of course the server checking for new mail and sending back a ‘no new mail’ message (well, an empty JSON array or something similar). 2 requests a minute, for ten minutes, that return tiny files? That’s nothing that Firefox can’t handle, providing you can grease its palm with another 5 mb of memory:

Minutes 0 2 4 6 8 10
Firefox: 62,708 64,764 64,972 65,040 66,096 67,128
Internet Explorer: 61,372 61,400 61,416 61,352 61,588 61,628

It’s almost as if it doesn’t matter what website you look at; Firefox always wants more. IE is fine, and will sit there for days without bringing your system to a halt.

Martiny

I decided to take a different tack, and to try a much simpler site. Martiny is the homepage of Kristen Mason, someone I used to occasionally email and chat with on forums. Her site is sparse and, well, pretty random to someone who doesn’t know about, well, whatever it is she is talking about. With only one request to load the page, and with no images, CSS, JavaScript, our browsers had a pretty easy time of it:

Minutes 0 2 4 6 8 10
Firefox: 47,548 47,644 47,588 47,592 47,740 47,728
Internet Explorer: 42,528 42,336 42,336 42,796 42,796 42,796

Apparently both FF and IE needed an extra 200kb of memory to continue rendering this page for 10 minutes. Perhaps they were being cocky and booted up solitaire in the background for a quick game, thus using the remaining memory. Who knows.

Sam’s World Of No

It seemed only fair to test my own site as well. I’m a simple guy, I like simple pleasures and 20 requests is enough for my site to display a blog, some images I hacked together in not very many minutes, and to integrate with a couple of external services. Still, Firefox demands 400k to keep the lights on for 10 minutes.

Minutes 0 2 4 6 8 10
Firefox: 48,348 48,804 48,820 48,816 48,784 48,784
Internet Explorer: 44,004 43,728 43,728 43,704 43,704 43,656

Sucks to be me.

I am not saying that IE is better than FF. Patently, it isn’t. Even without firebug, which is the Firefox killer app, Mozilla’s browser is nicer, more user-friendly and generally easier to use than IE. I am prepared to give Firefox more memory as it is better and does more. What annoys me is the increasing memory usage, which isn’t immediately explainable. I’m not a win32 programmer, but if IE doesn’t need more memory, why does Firefox?

The only conclusions I can draw is that, for some reason, Firefox is using up memory. Over the next few days I will be attempting various suggested remedies (including disabling the Google Firefox Toolbar, ironically enough) and I’ll try to keep you posted. If anybody has any suggestions, please let me know.

(Writing this post took 30 minutes or so. Firefox is now using 117,060k of memory and about 5% CPU. Almost constantly. Ouch.)

(I’ve now proofed for 5 minutes. Firefox is now up to 134,024k.)

Subscribe to this blog's RSS feed

On Twitter:

  1. Loading...

Follow me >

Previously Rejected:

  1. Installing Bundler, Rails and MySQL on OS X Snow Leopard
  2. Playing nicely: Notes on installing RVM + Passenger
  3. November In Manchester: Twitter As A Reality Show
  4. November In Manchester: Joining those technical dots
  5. Introducing Ambitious Query Indexer – A new way to index your Rails app’s database
  6. Top 5 Least Favourite Spotify Adverts
  7. Forget the technology – is the very idea of Twitter scalable?
  8. Going back to paper as a task collection system
  9. Update Facebook status from Twitter
  10. Staying out of trouble…
  11. ALA’s 2008 Survey
  12. Ten products that Apple just rendered obsolete with iPhone 3G/2.0
  13. Professional Accreditation for Web Professionals (Or, a rant on the British Computer Society)
  14. If it’s that important… pick up the phone!
  15. Moving Google Mail, Calendar, Reader and Talk into Google Apps
  1. Bookmarks:

Valid XHTML 1.0 Transitional Valid CSS!