In C#, we have implicit and explicit conversions. In both cases the idea is that we, the readers of the code, are not surprised by any conversions that happen. That’s why we can freely intermix int
s with float
s in a floating point calculation and everything turns out just fine. The int
s are implicitly converted to float
s (there’s no data loss) and the calculation comes out right. However, when there’s a possibility of some kind of data loss (say, converting a ulong
to a long
variable) you have to explicitly state the conversion in order to say “yep, I know what I’m doing; move along, nothing to see here.” Of course, the explicit conversion does come with an implied contract – that you have, you know, actually determined that the possible loss of data is benign – but otherwise just have at it. […]
I was having a chat with a friend recently about the blog post I published on January 1, the traditional day for writing down on a napkin your resolutions for the coming year. He was saying that it didn’t sound like a bunch of resolutions of the form “I will do this new thing” or “I will change this existing behavior”. It read as more wishy-washy than that. […]
READ MOREI am slowly making my way through the Tintin comic books in the original French, just so I can keep my hand in. I’ve now got to number 7, L’île Noire, or as they say in English, The Black Island. […]
READ MOREThe suggestion came from the top: “how about an article on HD video, HD TVs and all that?” When you get those kinds of suggestions, you don’t raise trivial issues like the fact you don’t even have a TV, let alone an HD TV. You File New in Word and get to work. […]
READ MOREOK, I was nuts. If it ain’t broke, don’t fix it, right? But what the heck, it’s part of the technology stack I’m supposed to know and use and promote, and furthermore I have a text editor and know how to use it. […]
READ MOREJust some warning that tomorrow, Wednesday 18 January from 8am to 8pm EST, this blog will be going on strike to protest SOPA/PIPA. The protest encompasses sites such as Wikipedia, BoingBoing, and even Google will have some kind of protest statement on their home page. […]
READ MORELast September, we stayed in Richmond, North Yorkshire, for a few days in order to go visit the graves of my parents – it had been the first opportunity for us to see the gravestones and to pay our respects. As is normal the day we arrive in England, Donna was really tired (it’s an effect of the travel medication she takes), and so I left her napping and went on a little walk around Richmond, a town that, although I knew superficially around the market place and the Castle, was not one I’d explored in any great depth. […]
READ MOREAfter the longest time dithering around, finally someone at the Beeb got round to publishing the complete set of this remarkable TV series from the mid-80s onto DVD. I bought it pretty much as soon as it appeared on amazon.co.uk. […]
READ MORE(For background, please check out parts 1, 2, and 3 before reading this post.) […]
READ MOREOK, kids, gather round old Gramps as he shows off the first calculator he ever owned. He got it as a present for passing his O-levels. (Actually, even if I’d had the calculator prior to taking my O-levels, I wouldn’t have been allowed to use it for the exams. Unlike math tests today, It was slide rules only in those days.) Are you gathered round? Here it is, the Litton Royal Digital 5-T from 1973. […]
READ MORE