moria.org.uk

Sat, 11 Nov 2006

Perl Best Practices

I read this a few weeks ago, and I think it is one of the most useful programming books that I have read in a while. Whereas most programming books are about how to get stuff done, this book is definitely about how to write code that someone else will be able to maintain afterwards. Perl has a reputation of being a fairly compact, fast-to-code language — and the resulting code looking like line noise and being opaque to the next person to look at it. So perhaps perl needs a book like this more than most.

I like how Conway is not afraid to give normative advice. He advocates, rather than defends, a fixed set of standards for things like commenting, indentation, variable naming conventions etc; he gets the balance right between justifying his opinion in favour of certain conventions, and not turning the book into a rehash of what can be endless debates between programmers about the relative merits of, for example, tabs and spaces. Better still, he comes down against the TMTOWTDI principle which seems to run through so much of perl's design and use: he simply dismisses all sorts of syntax features — like unless, and postfix modifiers — pointing out that they add nothing to the expressive power of the language, and do add keyword clutter and increase the risk of maintenance errors and oversights.

The book draws attention to lots of language features and important modules that make code easier and clearer. The Scalar::Util and List::MoreUtils modules, in particular, were a real find for me; many of the modules now standard in perl 5.8 I had not seen written up before, so this was particularly useful.

I couldn't agree with his chapter on regular expressions, though. This part of the book seems to be based on the assumption that regular expressions are hard, nobody understands them at sight, and so they should always be expanded out and commented in verbose and explicit ways. But why should we do this for regexes, but not for algebra? We don't expect people to write out algebraic expressions over multiple lines with extensive embedded comments, the + and - of maths speak for themselves without comments. I see regexes as being a similar compact language for text manipulation, and see no reason to treat them as obscure.

[16:53] | [/books] | #

Tue, 21 Feb 2006

The Two Income Trap

Now this is a good little book about practical economics. It basically discusses the application of the two-engine paradox (the paradox that a aeroplane which has 2 engines, and needs both to fly, is twice as likely to suffer a disasterous engine failure as a plane with one engine) to family budgetting: families which, a generation ago, had only one income, now have two: but, far from making them more ecomonically independent, this has greatly reduced their margin of safety.

The book is entirely about the situation in America, so it's conclusions would undoubtedly be very different for Europe. America is a strange place; what is the point in living in a country with such strong economic growth if none of the benefits go to the average man on the street (inflation-adjusted median wages in America have been virtually static for 33 years).

This book is basically about the US housing boom, and how — far from being underpinned by rising wealth and genuine supply shortages as the UK boom is — this is mainly an artificial situation created by dual incomes and school admissions zoning. The book is clearly advocating a single point of view, and goes out of its way to try and absolve the public of any blame for overspending at all; it's very partisan. But it makes it's case well, the statistics are good, and there are very few books that try to investigate long-term family economic trends in this way.

[17:12] | [/books] | #

Sun, 29 Jan 2006

The Millionaire Next Door

I finished reading this a week or two ago, and I find that I keep looking back at it and reading over sections of it again. This is the kind of book that I can't resist: statistics from detailed research, used to give background to a meaningful discussion of the economic and social problems being discussed. And the data is well supported by quotes from and interviews with the wealthy people discussed — the phrase "Big hat no cattle" is certainly worth remembering :-).

The big idea of the book, really, is the fundamental division that it makes between the affluent (those who earn, and spend, a lot), and the wealthy — who don't necessarily have a very high income, but consistently spend less than they earn. This is a division that is simply not present in most people's ideas about money, and the boring reality of wealth given by this book is certainly one that gets no attention in films or TV. The clear evidence that most wealthy people are self-made is also something that goes against conventional wisdom.

There are many examples of both wealthy and could-be-but-not-wealthy people discussed, and these are really the core of the book, lifting it from being just analysis to a good read. The examples come across as very contrived, due in part to the choice of fake names to anonymise examples (e.g. Dr North and Dr South to be opposites). But they work when you get into the detail, as the portraits given are very thorough and convincing. The discussion group near the end, where one high-earning-but-not-wealthy businessman was accidentally included in a group of wealthy businessmen being questioned for the research, was (as the authors noted) a real piece of good luck, as the resulting discussion shows very clearly how people can make a real mess of their financial planning.

The breakdowns of spending by profession are particularly interesting. The idea that doctors often earn a lot but aren't wealthy, because they tend to work long hours and rely on the advice of others on money matters; whereas auctioneers are professionally involved with money all the time, so are much more sensible with their own. And the idea that lawyers are often not wealthy, because it is a required part of their image to keep up with the expensive suits and cars of their wealthier clients.

I have seen this book recommended for people with money problems. I suspect it is a good wake up call for overspending professionals, but not much use to those with income problems, as this is taken for granted.

[14:18] | [/books] | #

Sun, 20 Mar 2005

Cheap Computer Books

I was reading through some of the blogs off of newsdot, and came across mewse talking about the lure of cheap computer books. I know this feeling too well — in the center of Bristol there are a couple of bookshops that are often selling computer books cheap, and I always end up browsing through them all. It's worth it sometimes, though: I got a copy of Python Essential Reference for £8 last year (RRP £25).

The best deal I ever got was when they were clearing a lot of Java books. I got Just Java 1.2 for £8. Genuine official Sun Java books for under a tenner!

Worst purchase: well, apart from all the ones I haven't even got around to reading, there was Web Application Development with PHP4. Admittedly it's not the author's fault that PHP is utter rubbish, but the book basically spends its whole time telling you how to avoid making all the mistakes that PHP makes it so easy to make.

[12:16] | [/books] | #

Tue, 08 Feb 2005

Reminiscences of a Stock Operator

I just finished reading this, and I can understand why it is a classic book. It's a great story of the ebb and flow of fortune, in both senses of the word. The story is apparently very true to life of real stock market behavior, albeit regulation is better these days.

I particularly liked the comment by the expert investor who is the subject of the book, talking about the strange asymmetry in the law when it comes to positive and negative remarks. You can be sued for libel or defamation for making a baseless negative remark that harms someone; but you can make any kind of positive remark about a share, a company, a product, and there's little that can be done about it. Obviously the trade descriptions act and no doubt similar stock legistlation is around these days, but fundamentally there is not that much that can be done to prevent people making upbeat claims about things.

The book if full of clever stories illustrating how blindly most people invest — in fact, how they are even more eager to follow tips when they are anonymous and baseless. Give people a detailed reason why soemthing will happen, and their eyes glaze over; give them a "hot tip", and they get excited. There's a great story in there about an investor following a tip without knowing where it comes from; when he later finds out that the tip came from his father-in-law, he says "Why on Earth didn't you say it was him?" — an anonymous tip was thought better than a tip from someone he actually knew, when clearly the reverse should be true in all circumstances.

I would recommend this book as the perfect cure for anyone foolish enough to believe they can beat the stock market, or any game that they know less about than the experts and insiders. But as Lefèvre says himself in the book, people reading it were only encouraged to invest all the more, because they, like everyone else, believed they would be the one person smart enough to beat the system. People are fools, and never change.

[21:09] | [/books] | #

Sat, 29 Jan 2005

Influence - Science and Practice

This book, by Robert Cialdini, is the best thing I have read in ages. Fascinating insights into the irrational responses that people have that cause their judgement to be unreasonably swayed. The chapters on consistency and authority are very good, and the book is full of well-cited academic research, statistics and real-life examples.

The best part of the book, however, is the chapter on Social Proof, and this is outstanding. I have never read an account better, more compelling or as thoroughly explained as this into the way people react in a herd mentality, and the ways in which it causes silly responses in a whole range of situations.

The book also has some great newspaper cuttings, photographs and a great selection of newspaper and magazine cartoons, which keep it from becoming heavy reading.

[11:34] | [/books] | #

Colin Phipps.
Archives
January 2007
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
Web Sites
zsync
PrBoom
About Kye
Credits
Blosxom
Powered by
Blogs that link here
[Valid Atom]