It's a shame that the noble word 'pedestrian' has come to be used in a pejorative sense. 'Terribly pedestrian' is how we dismiss a piece of creative work if we want to convey the idea that it is humdrum, ordinary, unspectacular. It's as if the humble ramble has become tedious and boring in comparison with flashier, faster modes of transport like trains, planes and automobiles. But in the pedestrian, the wanderer, the rambler, the flâneur can be found the soul of the idler. The pedestrian is the highest and most mighty of beings; walking for pleasure, observing but not interfering, happy in the company of his own mind.

Most of those, however, who stride along the streets of our big cities are not enjoying their stroll. They are merely using their legs to get from A to B. There is no component of fun in their walk; it simply has to be done. Their walking has a purpose in mind: to move from the underground station to the office, from bus stop to factory, sandwich shop to bank. The journey itself is unimportant, a waste of time. The goal is the important thing. Caught up in this sort of walking, we find it hard to abandon ourselves to the moment. We pace with purpose, head down, staring at the pavement. Through our mind runs a stream of anxieties: things to do, things not done, commitments broken. If anyone saw us they would get the vibe: busy, important, things to do, places to go.

I find it terribly easy to slip into this sort of forlorn pacing, which is the norm in cities. Walking for pleasure tends to be something we reserve for weekends and holidays. However, with a little effort of will it is not so hard to get into a reflective walking-mindset even amid the bustle and turmoil of the working day.

The greatest example of the attitude I am describing is the French flâneur. Flâneur literally means stroller or idler, and, in the nineteenth century, came to describe an elegant kind of gentlemanly moocher, who ambled purposelessly through the Parisian arcades, watching, waiting, hanging around. His hero was Baudelaire, as an anti-bourgeois who had somehow freed himself from wage slavery and was at liberty to wander the streets with no particular place to go.

The twentieth-century philosopher and radical political thinker Walter Benjamin was particularly captivated by the idea of the flâneur. He produced a giant piece of work called the Arcades, which is a compendium of thousands of short reflections and aphorisms, some his own, some quoted from others. It is a classic piece of flânerie; the reader can easily picture Benjamin, notebook in one hand, pipe in the other, taking notes on his observations, ready to type them out when back at home. It is in this work, for example, that Benjamin imparts the following gem.

"In 1839 it was considered elegant to take a tortoise out walking. This gives us an idea of the tempo of the flânerie in the arcades."

Like idleness itself, there is a paradoxical purpose to flânerie: slow walking may seem like a waste of time to your man of business, but to the creative spirit it is a fertile activity, for it is when walking that the flâneur thinks and generates ideas. Benjamin gives many examples of these. No less a figure than Beethoven, Benjamin tells us, via a quote from dictionary-writer Pierre Larousse, wrote music in his head while out and about: "In the first years of this century, a man was seen walking each and every day - regardless of the weather, be it sunshine or snow - around the ramparts of the city of Vienna. This man was Beethoven, who, in the midst of his wanderings, would work out his magnificent symphonies in his head before putting them down on paper. For him, the world no longer existed; in vain would people greet him respectfully as he passed. He saw nothing; his mind was elsewhere."

Victor Hugo was another great wanderer: "The morning, for him, was consecrated to sedentary labours, the afternoon to labours of wandering. He adored the upper levels of omnibuses - those 'travelling balconies' as he called them - from which he could study at his leisure the various aspects of the gigantic city. He claimed that the deafening brouhaha of Paris produced in him the same effect as the sea," wrote his biographer Edouard Drumont in 1900.

We can all probably think of our own examples. I have just thought of the great do-nothing Jim Morrison, who loved to listen to the cars going by his window in LA. Of course, there's John Lennon, who loved to watch the wheels go round and round when living in New York in the 1970s. And I understand that the film-maker Russ Meyer, auteur of such greats as Supervixens! and Beyond the Valley of the Ultra-Vixens, works out his scripts and plots on a two-hour post-lunch walk.

City wandering was not just a nineteenth-century pursuit: the visionary poet of the city William Blake often walked through pre-industrial London as a boy. His biographer Peter Ackroyd reports that he experienced spectacular visions on these rambles: he saw a tree filled with angels at Peckham Rye; the prophet Ezekiel under a tree in the fields; and angels among the hay-makers. Reporting such apparitions to his parents would earn him a sound hiding for being a liar. Blake demonstrated, in Jerusalem, that the city can be as stimulating as the countryside as a feeder of the imagination:

The fields from Islington to Marybone,

To Primrose Hill and Saint John's Wood,

Were builded over with pillars of gold;

And there Jerusalem's pillars stood.

There are one or two others raising the standard of the moocher. The cantankerous British journalist Jonathan Meades sees himself as a modern flâneur. "Our cities are full of people hurrying," he complained recently in an article in the London Times. "Their narrow pavements are not made for promenades at snail's pace; they are for getting from A to B rather than civic recreation. Walking for its own sake may be further discouraged by the climate and, equally, by the work 'ethic'. This week I put in several hours' sterling loitering interspersed with energy-saving bouts of farniente supinity. Observant sloth is its own reward. Just hanging around and seeing what happens … Time, in the form of a few minutes spent lounging about doing nothing in particular, is … a healer."

In Mediterranean countries, of course, there is none of the anti-snailery Meades describes. In Italy, there is the custom of the passeggiata, the stroll. Indeed, one of the first things that strikes the visitor to Italy is the slow pace of walking. On Sunday mornings, after Mass, you will see whole families, arm in arm, walking at a tortoise's pace down the cobbled streets, talking about food, wine, family and philosophy.

"The passeggiata is also taken before dinner," said my Italian friend Cristina when I asked her to describe the custom. "There are set routes, usually going up and down il corso, the high street, in the village or town. It's when the whole village comes together. For young people it's the equivalent of going to the pub; it's when you see your friends and meet guys."

In London in the 1970s, it was the punks who briefly re-invented the promenade or passeggiata. They would spend the whole day walking up and down the King's Road, sitting on benches, looking in shop windows, hanging out, displaying their eccentric clothes. The punks were the last flâneurs.

And by conspicuously wandering in this way, for its own sake, without purpose, you become a figure of suspicion in fast-moving cities like London. "Move on, move on," police- men will say to loiterers. In the accusation 'loitering with intent' is captured the authorities' inherent distrust of a loafer; I mean, how could they possibly know that the loiterer has some evil intent in mind? Are they mind-readers? It is assumed that someone who is doing nothing is necessarily planning mischief, when in fact what could be more harmless than going for a walk?

But the act of ambling is an act of revolt. It is a statement against bourgeois values, against goal-centred living, busy-ness, bustle, toil and trouble. For the creative spirit, the act of walking harmonises work and play. For Benjamin, "the idleness of the flâneur is a demonstration against the division of labour."

Walking well is a mental state as much as a physical one. How to walk? One of Benjamin's quotes in Arcades stresses the importance of keeping your eyes open. "To walk out of your front door as if you've just arrived from a foreign country; to discover the world in which you already live; to begin the day as if you've just gotten off the boat from Singapore and have never seen your own doormat or the people on the landing … it is this that reveals the humanity before you, unknown until now."

The great period for flânerie in London was of course the eighteenth century. It was then that the whole notion of the gentlemanly observer was at its zenith. Indeed, just look at the titles of the magazines and newspapers that sprang up in that literary century: the Spectator, the Observer, the Tatler, the Wanderer, the Rambler, the Adventurer. The art of wandering the city and reporting with a wry journalistic detachment, in the manner of Addison and Steele, and Johnson and others, was born in these years. The eighteenth-century city wanderer was more worldly and less depressed than his Parisian counterpart a century later, but perhaps that's because society had not yet been ravaged by the Industrial Revolution. There are a number of wannabe Dr Johnsons contributing to papers like the Spectator today, but the tone is hard to get right; recently, perhaps only the late Soho sloucher Jeffrey Bernard's 'Low Life' column came near to genuine flânerie. He somehow achieved a sort of world-weary insouciance that led to observations - on the death of cosiness, the wit of market traders, the futility of 'self-help' - that others would be too busy to make.

In the late eighteenth and early nineteenth centuries, the era of romantic poetry, countryside walking became the thing. The nature poets Wordsworth and Coleridge were great walkers. They ambled all over the coast of North Devon and Somerset in the years immediately following the French Revolution, and later wandered in the Lake District. Walking for them was a crucial part of the creative act; it was when they thought, dreamed and also gathered images. Rural rambles were central to their new poetic philosophy, expounded in Lyrical Ballads, of getting back to nature and simplicity. Says Coleridge in his Biographia Literaria: "My walks were almost daily on top Quantock, and among its sloping combes. With my pencil and memorandum book in my hand, I was making studies, as the artists call them, and often moulding my thoughts into verse, with the objects and imagery immediately before my senses."

Indeed, it was on a walk along the north Devon coast, just a few miles from where I sit at this moment, that Coleridge stopped off at the now famous Ash Farm, took opium and conceived and possibly wrote 'Kubla Khan'.

In rather the same way as urban wanderings can be seen as seditious, these poets' rambles were viewed with suspicion by the authorities of the time, who assumed that the pair, who were known for their radical views, were up to no good - were, indeed, 'loitering with intent'. A spy sent by the Home Office to monitor their activities saw the two poets taking notes on the riverbank and assumed that they were plotting to bring firearms from Bristol for a planned insurrection. The government agent, whom Coleridge nicknamed 'Spy Nozy' in Biographia Literaria, described the pair as "a mischievous gang of disaffected Englishmen" and a "sett of violent Democrats".

No chapter on walking could be complete without a nod to the private detective, who started to appear in the nineteenth century. He is an attractive character precisely because he is essentially an idler, as Benjamin wrote in Arcades: "Performed in the figure of the flâneur is that of the detective. The flâneur required a social legitimation of his habitus. It suited him very well to see the indolence presented as a plausible front, behind which, in reality, hides the riveted attention of an observer who will not let the unsuspecting malefactor out of his sight."

The truth of Benjamin's observation is embodied in that great literary loafer Sherlock Holmes, who, we conjecture, became a detective because he loved to loaf in his fictional world; to watch, to think, to walk. Like the poet, the detective does his work by walking and by sitting. He is not a victim of society; instead he watches it, he stands outside it, he enjoys it, he smiles at its foibles. And thus it is that Holmes can allow himself what seems to us, time-starved as we are, the enormous luxury of long city walks; in 'The Resident Patient', he says to Watson: "What do you say to a ramble through London?" And off they go for a three-hour walk. Three hours! When was the last time you wandered round the city for three hours in congenial company, or alone? No time! Too busy! Things to do! o

An extract from How To Be Idle (Hamish Hamilton, 2004).

Tom Hodgkinson is Editor of The Idler.