magpiebrain

Sam Newman's site, a Consultant at ThoughtWorks

Posts by samnewman

The Overall Aim

Eat lunch.

My aim

Eat Cake.

The scenario

Ten programmers in the centre of London.

The result

No clear vision, everyone wanting to achieve the aim of eating lunch in a different way. Group fragments – some go for bagels, others opt for fish and chips. Lunch takes 30 minutes more than it should, and I don’t get any cake.

The moral

Stuff working as a team, go eat alone…

Whilst leaving a comment over at “Jon Hicks”:http://www.hicksdesign.co.uk/ site, I noticed his excellent live preview for comments. As you type it displays how your comment will look, all in real time. I would love to do something similar for this site, however Jon uses HTML for comments so lets the browser do the parsing – I’ve decided to use textile which means I’d have to do the parsing myself in Javascript, which doesn’t sound too easy…

“Bloglines”:http://www.bloglines.com/about/news continues to add enhancements to their excellent free online feed aggregator service, and further improvements are being added by others – “Chad Everett”:http://www.cxliv.org/jayseae/2004/05/10/extending_mozilla.html has developed a very nice plugin for Mozilla and Firebird which embeds the bloglines notifier in the browser’s status bar, and also adds a right-click context menu which allows quick subscription to pages you are currently viewing (I assume this will require embedded RDF in the page in question to support auto-discovery, unless it searches bloglines itself). All of this could be done by downloading the notifier separately and using a bookmarklet, but Chad’s work provides a nicer package with a decent interface, and the fact that it will work on any platform capable of running a recent Mozilla build probably makes these features available to more people than ever.

One of the few benefits of a long commute, is the fact that I’m not doing it alone. The time afford to me each morning on the train to and from work also provides and opportunity for discussion on all kinds of topics, ranging from the poor state of journalism in the daily free newspaper the Metro, to some more esoteric issues at least tentatively connected with work. One discussion which fell between these two concerned the notion of naming – be it the naming of classes, methods or packages.

One of my colleagues asserts that naming is actually one of the hardest things he has to do as part of his day-to-day development. I agree tentatively with that statement – however the problem is not a lack of vocabulary, more that when naming is a problem we often just don’t understand what we are trying to name. The more we mentally consider the code to be an amorphous blob, the more naming becomes difficult. Once our understanding of the code coalesces into something more concrete, naming often becomes trivial.
Continue reading…

Now that this site properly “validates (W3C Markup Validatior – validation results)”:http://validator.w3.org/check?verbose=1&uri=http%3A//www.magpiebrain.com/ as XHTML 1.0 Strict (with a little help from some PHP and the “W3C validator”:http://validator.w3.org/) I’m now starting to look at the markup itself. As you may know, the idea is that the XHTML should contain the semantic markup, and the CSS the presentation, which is a pattern I have used here. I have become concerned however about the quality of my markup. Lets look at a simple example. Currently, the links for each post are marked up like this (I’ve omitted @href@’s or the MT tags that generates this content):


May 4th in General | Permalink | Comments

Continue reading…

I’m slowly working my way down my website todo list, and today came to the topic of webpage compression. Webpage compression, when done right, is a robust solution to decreasing the size of your pages and hence speeding up page load times, all whilst coping with older browser types. Thanks go to posts at “Textism(Textism – Bigsmallbig – 21 November 02)”:http://www.textism.com/article/632/ and “Mark Pilgrim(Mark Pilgrim – A warning to others)”:http://diveintomark.org/archives/2002/11/21/a_warning_to_others for putting this on my radar in the first place.

The conventional approach to compressing your webpages is to use “mod_gzip”:http://sourceforge.net/projects/mod-gzip/. This module is run by Apache after all other modules have run – so it will work on dynamic content. Firstly, it determines if the client can understand gziped content – if it can it the webpage is compressed, otherwise the normal page is sent. This does require you have mod_gzip installed however and you have to associate the correct mine with the module. An excellent overview of mod_gzip can be found at “Web Compression(Compressing Web Output Using mod_gzip for Apache 1.3.x and 2.0.x)”:http://webcompression.org/gzip-compress.html, which is an excellent resource on the topic of website compression as a whole.
Continue reading…

Inspired by the rather enjoyable “meme(LaughingMeme – page 23, sentence 5: an autopsy)”:http://laughingmeme.org/archives/001960.html, I decided to integrate an ongoing series of Page 23 posts on my sidebar. To summarise the original aim of the meme, it has each participant write the fifth sentence on the 23rd page of the book they are currently reading. My slight subversion of the meme is to do the same for various books which I have read or am reading that I can recommend. The aim is to have a picture of the book, the sentence in question, and a link through to Amazon on my sidebar. I alsowant to vary the book displayed as often as possible. What I really want is a dynamic slideshow – which is what we are going to build now.
Continue reading…

I frequently pop down to the canteen to buy a sandwich. The early conversations with the person serving went a little like this:

==

Me
I’d like a sandwich please
Server
What would you like on it?
Me
Erm, Cheese and coleslaw please
Server
On what kind of bread?
Me
White sliced please

==
Continue reading…

Each language feature introduced that tries to enforce safety of some kind invariably introduces some reduction in the power of the language. Some of these tradeoffs’ seem acceptable. The Java security model is an example of a limiting factor in the deployment and execution of a Java application which makes perfect sense to me. Java also hides memory management and pointers from you, which for the majority of applications also makes sense, however sometimes you really want to get hold of the underlying memory model and do nasty things with pointers and that is why C and C++ are still used for writing OS API’s.

Other limitations just become more frustrating over time. Java’s strongly typed language provides a great deal of compile-time checking, at the cost of program flexibility – Python, Ruby et al provide a richer, dynamically typed language which gives the programmer much more power (And anyone saying “You get dynamic typing with Groovy” is going to get smote with the cluestick of death, +1.). At this point I’d like to borrow a phrase from Spiderman (uh oh – nerd alert!) “With power comes responsibility”. Such dynamic languages with their more flexible typing can also get you into a bit of a mess. These dynamic languages can be seen primarily as enabling languages – they make the assumption that developer actually know what they are doing. As a result, they will on occasion let them shoot yourself in the foot. C and C++ likewise let you shoot yourself in the foot – they also however let you shoot the guy next to you, blow your car up, drink your beer and steal your girlfriend, but that perhaps is a discussion for another day.
Continue reading…