Rick van den Bosch - Blog

... on software development, architecture and more

March 2007 - Posts

Why would you?
Last week I ran into a variable called @continue in the sourcecode of a project I'm reviewing. At first I had to think a bit before I knew what the @ was for. Of course I knew it's an escape character when used in front of a string value. But when used in front of a variable name? In that case, it is an escape character also, but this time for the name of your variable. This way you can use a reserved word as a variable name.

Why would you do this? What's so important about that exact name of the variable that it is not possible to think of a slightly different name which is not a reserved word? In this particular case, the boolean was used to indicate if the method it was declared in should continue parsing the next value in a foreach loop. I would call the variable 'continueParsing' or 'continueLooping' or something like that*. Those more clearly state the purpose of the variable, and don't make you escape your variable name. Furthermore it doesn't baffle 75% of the developers maintaining or reviewing your code because they don't know why the variable starts with an @.

Maybe I'm missing something. Maybe there are certain situations where this an absolute must. I can't think of one right now though.... can you?


* By the way, the best way would probably be to use a break statement, but that's not the reason I'm posting this for. ;)
Quickie

It's been a while since I blogged, because...
- I started a new (exciting but busy) project building a technical framework (and 'proving' a reference architecture along the way).
- it looks like I might become a published writer when I hand in my article for the Dutch .Net magazine anywhere in the next couple of weeks.
- we had lot's of meetings @ LogicaCMG lately, like the yearmeeting, an architect meeting, a funmeeting (bowling can be cool!), and so on.
- I'm planning on doing more along the way of competence development for my team, so I have to do some research and come up with a plan on how to do so.
- I was part of the orgnisation for the reunion of the musical I played in. We're having it this saturday.
- our house still needs some 'home improvement' and I'm the guy to do it (preferably not 'Tim Taylor' style).
- I haven't even had time to use my Xbox 360 the past couple of weeks!

I'll be coming up with some more posts in the near future, so stay tuned..... or bear with me ;)