Friday, March 31, 2006

Down with protected class variables?

I'm not sure.

Kasia writes in her blog entry:

If a variable is not final then it should be private. If you need to make it accessible to another class and there is no accessor then you're probably not doing something right.

While true, that making fields/attributes publicly available via an interface of sorts (not "Interface in the sense of an abstract class, but just in the sense of certain known methods), and not directly from a "friend" class/function or a derived sub-class.

But, unless the compiler is doing some inlining for you, then the performance hit on making those extra accessor calls, and the extra layer of indirection seems prohibative.

But, then perhaps I'm forgetting that computers are constantly evolving and these kind of pre-conceived bottlenecks aren't actually anything to worry about.

Monday, March 27, 2006

Programming languages and their relationship styles

http://maradydd.livejournal.com/293666.html

I particularly like the comment on C:

I don't think C gets enough credit. Sure, C doesn't love you. C isn't about love--C is about thrills. C hangs around in the bad part of town. C knows all the gang signs. C has a motorcycle, and wears the leathers everywhere, and never wears a helmet, because that would mess up C's punked-out hair. C likes to give cops the finger and grin and speed away. Mention that you'd like something, and C will pretend to ignore you; the next day, C will bring you one, no questions asked, and toss it to you with a you-know-you-want-me smirk that makes your heart race. Where did C get it? "It fell off a truck," C says, putting away the boltcutters. You start to feel like C doesn't know the meaning of "private" or "protected": what C wants, C takes. This excites you. C knows how to get you anything but safety. C will give you anything but commitment

In the end, you'll leave C, not because you want something better, but because you can't handle the intensity. C says "I'm gonna live fast, die young, and leave a good-looking corpse," but you know that C can never die, not so long as C is still the fastest thing on the road.

I love this:
"You start to feel like C doesn't know the meaning of "private" or "protected": what C wants, C takes. This excites you. C knows how to get you anything but safety."


I love it!

It's very much worth the read.

Friday, March 24, 2006

C++ Exceptions: Continuance

In designing a language that supports exception handling, one must consider the aspect of continuance: where does execution resume after the exception has been raised?

I recently came upon an online conversation of Bjarne Stroustrup, in which he discusses why resumption directly after the statement that raised the exception wasn't implemented.

Basically, someone resuming from an exception handler can never be sure that the code after the point of throw was written to deal with the excecution just continuing as if nothing had happened. An exception handler cannot know how much context to "get right" before resuming. To get such code right, the writer of the throw and the writer of the catch need intimate knowledge of each others code and context. This creates a complicated mutual dependency that wherever it has been allowed has led to serious maintenance problems.
This is probably of very little interest to many people, but I find it rather facinating to see why certain decisions were made.

Wednesday, March 22, 2006

The Art of UNIX Programming

The current quote above ("When in doubt, use brute force") was retreived from the following book:
The Art of UNIX Programming
It's an interesting read (and free too!). It isn't a technical manual on how to write applications for the UNIX environment, but rather a philosphical approach for programming according to the (so called) UNIX philosophy.

The 17 rules are good rules to follow iregardless of the platform/language/environment that you work with. Also, the Interface Pattern page has a lot of insight on how to organise your tools. Make a number of small, flexible tools that can be used in conjunction to accomplish a number of tasks, instead of making a monolithic utility that tries to do everything itself.

I could go on & on, but instead you should go and check out the book for yourself. (Even if you're not a UNIX person)

Gak!

Over the weekend, Fred Fin and I made Gak. It was our first time, and everyone had a lot of (messy) fun. Fin really got into it and required a little more cleaning off than the rest of us.






Tuesday, March 14, 2006

Software Eng.: FIT & JUnit

Check out this article on IBM regarding a unit testing framework that enables business people to develop test cases using tools like excel.

SlickRun deserves its name

Thanks to my friend Mirek, I've installed SlickRun on both my home & work Windows workstations.

It's quite neat -- after setting up some "magic words" for my most frequently used applications & websites, I rarely use the start button anymore.

Very neat.

Sunday, March 12, 2006

Back in the hospital

Today Fin started outputing more than usual. Katharine picked up some paedialites at the pharmacy & began replacing Fin's food with the paedialites 1:1.

At three-ish, I left work early to pick Katharine & the girls up and together we headed to Emergency at SickKids. She's been put on IV fluids & taken off of foods to give her stomach a rest while her virus runs its course.

It's 2am, and Winnifred & I just recently arrived at home -- unfortunately Katharine and Findley are still in observation until around 3 when paediatrics will finish their rounds and admin Findley into a room.

While we were waiting in Emergency, Winnifred and I were looking at a poster of cats when we heard:
"What, are, you, doing, here?"
We turned around to see Findley's surgeon, Dr. Annie Fecteau, who was on call that evening. She looked a little horrified to see us standing there, so I brought her up to speed on Findley's condition.

The thing about Findley & Dr. Fecteau is that as soon as Dr. Fecteau first operated on Findley, she, Dr. Fecteau became Findley's primary physician. Findley still has a Paediatrician, a GI team, a Nutruitionist, a Geneticist, a General Practitioner, and a few other teams that I'm forgetting at the moment. But, even if Findley develops a cold, Dr. Fecteau is her primary physician.

Imagine that, having a transplant surgeon being the first person you see as soon as you get sick.

Hopefully this stay at the hospital won't last more than five days or so. It will be interesting to find out what a stay in Paediatrics will be like. Most of our experience is on the surgical ward.



That said, here are a few comparison pictures of Fin in August, and her in January:

Monday, March 06, 2006

Spring Break

Over spring break Katharine, Winnifred, Findley and I packed up the car and headed north the Mattawa to visit Katharine's grand father before driving west to Sudbury for two nights.

I hadn't been to Sudbury in about 14 years, so the visit experience was completely new to me. We all got a kick out of Science North, and seeing the Big Nickel was fun. But I think that the biggest hit of all was the swimming pool at the hotel. I didn't know it was so easy to impress a three year old.



After two nights in Sudbury, we got back into the car and headed south to Katharine's family farm for a stay at the cabin. The snow was about 2-3 feet deep, so we had to park the car at the house and walk all of our stuff back to the cabin. It was nice and insular; Having a wood burning stove was super cozy.

Unfortunately the girls were asleep at the time, but at about 5:30 - 6:00am when I was up putting more wood on the fire I saw some wild turkeys and a deer out of the window. My camera was burried deep in the bag so I wasn't able to snap any shots for Winnifred. Although later on, she and I treked through the snow looking at all of the animal tracks.

Most people don't head to Central/Northern Ontario on their Spring Break (in February), but it was quite fun.