C++0x -- draft standard

I have begun using the Java language at my place of work but the language I have done most of my professional work in is C++ (and as I sometimes remind a co-worker who projects a sense that Java is the answer, no matter the question is, "without C, there wouldn't be a good Java Virtual Machine") I have been watching the standards process with some interest and last week-end a new standard for C++ was accepted by the ISO committee over-seeing that project. It's too bad Alexandrescu's latest ideas on iterators probably didn't show up in time to affect the process.

Bjarne Stroustrup who first developed C++ and continues to be involved presents this FAQ, in case anyone is interested. I'll be reading it.

Being in the know...

Every now and then a story comes along that lets me know I'm listening to at least one or two of the right sources for stories. One of my regular reads is an e-column called "I, Cringely" (with obligatory Alan Parsons album cover misquotation: "And so the experiment failed because [high-tech] decided to make [Cringely] in its own image..." -- and wondering if the chap who wears the Cringely name is, in fact married to someone named "Susan Calvin"? -- but now I'm really showing my age and nerdiness).

Today was such a moment when I read Cringely's latest column: I told you so. When I first read (in his earlier column) the story mentioned today, it struck me as the most rational reason why Steve Allen left Microsoft when he did and ultimately in the way he did. And now we get the full-colour Paul Allen's-eye view of the scenario, almost as though he lifted that portion of the story from Cringely's column.

Cringely has had some other interesting things to say about the earthquake in Japan, the resulting tsunami and the downstream results. Add his RSS to your reader. You won't regret it.


Haiku #29

I wrote on a white board at work on Friday (reminiscing from The Princess Bride, this scene), "There will be ballots this spring!"

Someone scrawled, "but no bullets, folks. Let's keep things civilized." The resulting haiku needs no further introduction, offered with prayers for peace in all the places where there are more bullets (and sabotage of the reasonable aspirations of ordinary folks by entrenched structures that impoverish them) than ballots:

Transfers of power
no stormier than spring rains:
nearly as precious.

One more reason why I'm glad we're having another election

This probably hasn't gotten a lot of attention outside the Geek community but this slashdot story is one more reason why I'm glad the government fell. We don't need a DMCA in Canada, we pay levies on blank media but it's just not enough to pay for all those holidays various studio execs need to take, so American lobbyists are calling us a haven for piracy.

Hey, politicians: you want my vote? Pledge never to bring another DMCA clone into the Commons and I'll vote for you, despite my strong disillusionment with the lot of you.

"He who has a Tates' is lost..."

Anyone not heard of the "Tates' Compass"? You're guaranteed to get lost in the wilderness if your only source of direction is a "Tates' compass". "Why?" you ask. Because he who has a Tates' is lost! (hesitates? Act IV. S. 1, paraphrase)

The CBC has put up an interesting "political compass" which puts my views far, far away from all the parties in our election (and indeed reflects the results I got when I took a similar quiz at politicalcompass.org... hmm. I wonder if the CBC got permission to use the phrase?) but tells me that I am closest to one of them. I was surprised until I saw the relative distances they were speaking of: I was about 5% closer to one than the other but in both cases their views were quite wildly far away from my own.

Oh well. It was interesting to see their analysis of the parties along a familiar pair of axes, and the quiz was interesting as far as it goes. Canadian voter! Knock yourselves out! Take the poll and figure out where you would stand.


Vancouver Sun Headline -- Meh

This A.M.: "Battle for B.C. Tory quest for a majority could be determined here"

In a word: claptrap. Two more words: poppycock, horse-hockey.

So long as Québec belongs near-exclusively to the Liberals and the Bloc, B.C. is irrelevant and any rhetoric to the contrary is nonsense.

Any questions?

The Writ! The Writ! (Fourth Canadian election in seven years about to start)

It's a Spring (just don't tell Newfoundland) and that means it's time for an election!

The issues haven't changed much. It's being called "Historic!" because <gasp!> the government fell when the Prime Minister was found in Contempt of Parliament. But let the blood pressure drop: it was on a party line vote that wouldn't have seen the light of day under circumstances we usually call normal. Corruption there may have been, but it still doesn't come anywhere close to HRDC (look for the name "Pierre Pettigrew" in Jane Stewart's wikipedia article) or the Sponsorship Scandal.

One thing is certain: this election will not be decided in BC or Alberta, probably not even in Québec or the Maritimes. Nope, 905 will continue to dominate. We're sure to have another hung parliament with the Conservatives at the front, unless those Conservatives can capture the vote- and riding-rich outer Toronto area. I predict. I do not prefer. Here's my take on our leading politicians (in alphabetic order by surname).

Gilles Duceppe, Bloc Québecois: The senior of the current four leaders, he has run a well-informed and serious caucus. They have been notable to me in that when I have written e-mails to my MP, a cabinet minister, and the shadow ministers from the other three parties, the critics from the Bloc have sent me the most cogent, replies. My message to Québec (chanted): Nous avons besoin des vous; vous avez besoin des nous. So I oppose the ends for which the Bloc stand but with a shadow cabinet like that, I would be tempted to vote for them notwithstanding.

Stephen Harper, Conservative: After all this time, he's still a wonk. You have to admit that he has managed his minority parliaments very skillfully. But his facial expressions still look unnatural. One headline in the Vancouver Sun this week asked if he had maneuvered the opposition into calling this election for him: with popularity rising and not having to pay any price for foisting an election on people who don't want one this time, one could argue he has nothing to lose. For my part, though, he looks too much like Margaret Thatcher to suit me and I fear that Canada's enviable social safety net will only suffer more if he is granted a majority government. Campaign finances are also likely to become more American as a Conservative majority is likely to do away with proportional funding from taxes and may with the same stroke take spending limits off, too.

Michael Ignatieff, Liberal: He may have been born here but he has spent the bulk of his adult life in other countries, especially the USA. The Conservatives have driven this point home in repeated attack ads but it sticks because it's true. He has written to Americans as though he were a fellow American and then, after spending all but fragments of his childhood in Canada he returns and asks us to vote for him as our Prime Minister? If the were the US, his lack of residency would disqualify him from running for president. 'Nuff said.

Jack Layton, NDP: After all these years, he still feels like an over-achieving Toronto City Councilor. The NDP were on the ropes when he took over their leadership and he hasn't helped their fortunes much. In my view, he is too closely allied with big labour (which can be just as oppressive in its own way as big business) for me to view him as a fit guardian of my interests. Also, he hasn't a hope of gaining more then twice as many seats as he currently has -- which would still leave him in charge of a still-all-but-invisible rump.

Elizabeth May, Green: Desperately trying to get even one seat with a popular vote equivalent to the one that gives the Bloc 50 ridings in Québec, she's come out here to BC to try getting into parliament from one area the Greens might actually succeed from. I'm not in love with Green policies, either, but in my Sock-puppet-for-Conservative riding, I have voted for her party as an investment in a more diverse legislative future.

I am a disillusioned voter. I see confrontation and multiple dualisms ("my way good; their way bad") going on and all the while the legislators have forgotten that government should be there to protect the little guy from the big guy, first and foremost: from the large multinational company with enough money power to enrich or impoverish at will, without concern for the results, from the large labour union that has become more concerned with power than protecting the worker, despite their noble beginnings (if you've never belonged to a union as a Canadian worker, as I mostly have not, you owe it to yourself to visit the Crowsnest Pass area between Fernie and Lethbridge to see what it meant for the unions to look out for the workers' interests, for instance), from criminal gangs and other bullies, and even occasionally (but only occasionally) from ourselves.

But if we don't get involved, if we don't at least vote (with or without clothespin attached to our noses) we resign what little chances we have to affect our country as we might want to see. What policies would I like to vote for?

How about these for a start?
* more commitment to education
* more commitment to scientific research into a much wider array of energy alternatives (not just the current fads like wind and solar, how about a Canadian project investigating polywell fusion? or more support for Burnaby's General Fusion?)
* stronger commitment to the Canada Health Act -- and strengthening it into the future
* re-direct the Gas surtax back into Transportation infrastructure (especially mass transit) within the general area where it is collected
* stronger commitment to peacekeeping and independence from American agendas, including going back to a made-in-Canada refugee policy
* aggressive trade development with nations other than the US -- nothing against the US, but our trade surplus becomes a deficit when you remove our sales to the US and that makes us unacceptably vulnerable to every downturn they experience: This is nothing more than a sensible hedging strategy
* national security of supply -- if we are not self-sufficient on our own supplies for dailyl staple commodities, especially food, we may become vulnerable to nonlocal price shocks, and in any event, our resource-use footprint will be higher than necessary. Also, our resources should go first to supplying our own needs and foreign capital should not be permitted to have a controlling interest in any vital supply chain from our resources to our citizens: water, food, energy (all forms), telecommunications and so on

One party is beholden to big labour, others to big business and none will support this kind of hybrid platform. If they did, I could support them gladly. Until they do, I have no clear choice for any election.


Comments on Software Engineering Radio

It's been so long since I posted to this blog that it probably qualifies as a slum but I'm still here. It hasn't been personal tragedy that has kept me from writing here but a large dose of personal busyness. Some of that has settled down to a dull roar -- and I've arrived at a bit of a milestone that bears marking in some way -- and this way seemed the best choice -- so the time has come to dust this blog off and write something, in this case, something a bit more substantive than Yet Another Haiku.

About six months ago, a colleague introduced me to the podcast from Software Engineering Radio, specifically mentioning Scott Meyers' interview regarding C++0x. When I saw that it was Episode 159, I decided to go back and listen to the rest of them: my travel times can be long, auditory input is good in the context of multi-modal commuting and more training in any form is always a good thing.

So now I've listened to the first 50 -- nearly the first 70 by now, actually -- and it's time I should mention my impressions. Here they are:
  1. Given that the first episode is over five years old by now, these pod casts have aged quite well. The approach of sticking to just one topic for an hour-or-so or less allows for many things to be covered reasonably and well without becoming ponderous.
  2. And where a topic can't be exhaustively covered in that time frame, going back to it again and again also gives the opportunity to cover them well.
  3. Further, not necessarily going back to a large topic sequentially, again and again has kept the collection, so far, from being ponderous in that way either.
  4. I found the rationale for choosing to podcast in English despite the fact that the original podcasters are all German speakers amusing: especially the part where most Germans wouldn't understand them because of their strong regional accents. On the question of accents, I was occasionally tempted to write a note about pronunciations, of "meat-ah-model" for instance, but five years on, someone else seems to have put in a word or two and it's been metamodel, properly for some time. My condolences go out to any ESL speaker to get English pronunciation right the first time. It's crazy to keep so much of our linguistic history alive in our orthography, but I digress.
  5. Occasionally I have been put off (a very little) by blanket statements about how some thing is wonderful in Java, or Ruby, or with Spring or whatever whereas "you just can't do that in ..." C or especially C++. Particularly, when it comes to memory or object management (or indeed management of any kind of resource) stating that "it's just so hard in C++" again and again struck me as naïve about C++. Admittedly, it may be easier to do bad things in C++ (which has been my favourite language for about 10 years) but by the same token, it is often more possible and indeed cleaner to do the right thing in C++ than in Java, for instance. I have just begun using Java and I find the constant use of the acquire-try-doSomething-finally-release idiom really clunky. In C++ I would create an auto-release object around what I wanted to acquire and the destructor (whose invocation time is known precisely) would take care of releasing it at the point I would choose, without further ado. And Java is somehow better at that point? As for memory leaks, my impressions are that when Java programs leak, the leaks can be far harder to find than in otherwise well-written C++.
  6. This being put off has gone the other way as well: along with denouncing what I find useful, the podcasts have sometimes praised things which when I have met them seem wrong-headed. In the Java work I have begun to do, I have been exposed to Spring's dependency injection. After hearing it praised so highly in the podcasts, I was disappointed to see that it was essentially a way to acquire the use of something implicitly, without the costs of instantiation and management being exposed to me. It's all very well to say "@Component" or "@Autowired" about some piece and have it magically instantiate at the right time and the right place, but it strikes me as the kind of thing that would encourage sloppy practices rather than make good practices easier. But to each his own. With the way that Java mashes up the interface with the implementation in an individual class, I can see the benefit of pushing away these details. I've just seen so many people do all kinds of things without understanding their costs that I am not by default convinced that this is the right approach.
  7. At times, I have also been struck by the blind faith placed in garbage collectors (which have admittedly gotten a lot better since I saw someone showing off Smalltalk's wonders in the mid-80s) while conventional memory management, especially in C and C++ is maligned: inherently leaky etc. etc. Ten years ago, this would be a relative criticism that stuck but with good class library support (such as that in a modern version of Boost, for instance, with a good modern compiler) the explicit control given to these things through reference-counted pointers, auto pointers, strong and weak references etc. seems to me to be preferable by far to the periodic holiday that, for instance, my Java-based cellphone goes on at the mercy of its need to collect the garbage. Others may disagree, and indeed, I have said enough in the last three items to spark several religious wars. Don't get me wrong: I'm not saying that Java, Ruby or Spring are always "wrong" and C++ is always "right". I suppose I have fallen prey to the temptation to defend C++ to the death when hearing it falsely accused from other quarters. Add a grain of your favourite salt at this point and long live the free exchange of ideas!
  8. At the time it was posted, one podcast was described as an experiment in a hands-on how-to in using meta models in developing a simple Java component. Even on a bus, far from a keyboard, this sounded interesting and one of these days I'd still like to sit down and test drive what they were talking about while listening to it again.
  9. In the mean time, there have been many VERY profitable things to hear on the pod casts: discussions about various agile approaches to software development, basic topics (error handling) and more advanced ones (concurrency, ultra large scale systems), daily-use ideas (refactoring) and arcana (internals of GCC, C++0x and Corba -- all with people who actually knew what they were talking about!) as well as interviews with folks (whether as well known as Grady Booch, or not) whose ideas and/or tools we have been depending on for years: it's an impressive collection and has been profitable. I expect the rest of it will be as well.
I am very likely to continue listening to the podcasts because even where I disagree with the presenters, it's exposed me to ideas that I have not gotten from other directions. Some 18th or 19th century poetic piece said that "even fools have their story" and neither the SE-Radio team nor their guests are fools. I commend their work-product as an effective tool to continue enriching any professional software developer's toolbag, to continue exposing oneself to new ideas and not least to help realize that there are more ways of solving every day problems than the one vendor, system or language that one uses all the time.

Thanks, guys, ever so much, even as I finish with one more tiny critique: the ID tags of the MP3 files are occasionally very inconsistent, claiming, for instance to be by team@se-radio.bet or @se-radion.net but perhaps that, too, is something that has been taken care of in a more reliable way since the episodes I am currently listening to were put out four years or more ago.


Haiku #28

It's somewhat better
To be useful than happy
But only somewhat.