Tuesday, November 30, 2004

New language features

There's an overview of the new language features in VB.NET 2.0 on MSDN.

Looks very interesting. There are some really cool features in there, like:

  • XML Commenting
    I've already used his to a certain extent with the VBCommenter powertoy and find it quite cool. I find it really helpful. I'm a bit of an inconsistent commenter, and this adds a bit of structure and a bit of consistency to my commenting. And I'm a cheap toy whore. It's really handy to use it with NDoc for making nice MSDN-style documentation as well, though.

  • TryCast
    Not too much to say about this, apart from cool! What's that you say? No need to wrap all my casts into a try/catch block? No need to typecheck every object that gets passed into my methods? I'll have some of that!

  • Operator Overloading
    Ah yes. Operator overloading. Very handy. Eliminate whole swathes of code with a single operator. Sweet!
It's not all good, though. There are a couple of things in there that, certainly at the moment, I can see being really heavily abused.

Some of them include:
  • Partial Types
    What? Split the same class over several files? Although I can see some potential for this being quite useful, I also envisage people using it to implement some sort of weird file-based architecture to their code. Namespaces? We don't need no stinking namespaces! I have visions of something like this:
    File: SavingMethods.vb
    Partial Class Widget
    Public Sub SaveToDB(Thingy as IWidget)
    'Lots of DB Code here
    End Sub
    End Class

    Partial Class InheritedWidget
    Public Sub SaveAsXML(Thingy as IWidget)
    'Lots of XML Code here
    End Sub
    End Class

    Note to self: You've said it now. I can guarantee you'll catch yourself doing it at some point. Remember to slap yourself silly for it when you do!

  • Default Instances for forms
    Yes. Here's an idea. Let's try and make VB.NET just like VB6. Forms you don't have to instantiate? Yeah! I'm sure it fits in nicely with the rest of the entire sodding language. Do I want an exception to that rule? Of course I do! I want to have to instantiate every reference type except one. I'm sure I'll never trip myself up.(</sarcasm>)
OK, so I don't have to use any of the stuff I don't want to. If I want to put my classes all together, then I can (and probably will). If I want to skip the line "Dim theform as new Form1" then I will.

It's just some things that were occurring to me as I was reading about it. All in all, though, I'm really looking forward to getting to play with VB.NET 2.0, and VS 2005. Sad, I know.

Oh yeah, and another note to self: If you're going to have an image illustrating how XML Comments appear in intellisense, you'd better have an image that shows the comments being shown by intellisense.

Sorry about the length. It was just on my mind and wanted to get off.

Friday, November 26, 2004

Some things bother me...

And this is one of those things.

Do you ever see something, or read about something that for no apparent reason sticks in your mind and won'g go away? Well this is one of those things.

It all started many years ago, when I first saw the movie WarGames, with Matthew Broderick, Ally Sheedy and the guy from 9 to 5.

At one point, all the main protagonists are holed up in the top secret military bunker place, with Maurice out of Northern Exposure. As the tension mounts, and nobody's sure whether there really is a full scale nuclear bombardment headed into America, or whether it's just a figment of a big computer's imagination, they raise their military status thing from DefCon 3 to DefCon 2. Very Tense. Only one step away from all out global war. When the status changes, the bunker locks itself down. I'm assuming automatically. One of the big things that happens is that a huge (and I'm talking HUGE) big metal door (presumably proofed against every Bad Thing known to man) closes and locks. Hardcore. Nothing's geting in or out of that place until the door opens again.

Now, I'm assuming that they keep this door locked for the duration of the war, as well as until any fallout's cleared. In short, they could be there for some time.

Since this giant, heavy, computer-controlled very locked dor is the only way in or out of the bunker, I'm sure everyone who works there knows exactly how hard it's going to be to get out. They know that if they hear the Big Door close, it's time to call the wife and tell her that they might be a few years late for dinner (and I'm guessing let her know that if it all goes tits up, they loved her, and there were so many things they wanted to tell her, but there just wasn't enough time).

Now, as the door's closing, one guy runs in to catch it before it's locked altogether. He's quite a young guy, in a uniform, carrying a sheaf of papers. The thing that's beenbugging me for the past 11 years or so is:


That's it. I just wanna know what was so important that, in the event of a potential Buck Rogers-style nuclear holocaust, he had to run to catch the door before it closed for an indeterminate amount of time, sealing him off from his family and miscellaneous extra loved ones for the rest of their lives.

It's one of those insomnia inducing questions that rears its ugly head when I'm just about to nod off for the night and keeps me up until 3am when my body finally gives up pondering it.

My bet is that he's some sort of accountant. 'I don't care that there's nobody on the planet left to pay. You still have to sign off these invoices!' That sort of thing. I hope that in the event of a real war, his mother's last thoughts were 'Well at least Simon's been saved by doing his duty for his country.'

Either that, or it was some top-notch pr0n that he wanted to save from vaporization.

What do you reckon he needed to dive into the bunker for?

Thursday, November 25, 2004

Bandy Wagon

Bandwagons are great. When I grow up, I want o be on every bandwagon going. I want to:

  • Protest about things I know nothing about
  • Get morally outraged about things because the newspaper told me to
  • Subscribe to whatever wacko diet is current, because some D-list celeb says it helped him/her lose a few pounds
To this end, I've started already.

Joe Stagner's having trouble convincing his bosses that blogs actually get read by real people. Hop on the wagon. Give him a click. Everybody else is doing it. And that, as we all know, is good enough reason to do anything. Go now!

As a sidenote, if you don't (yet) know who Joe Stagner is, check out his episode of DotNetRocks. He's a sound Geezer.

Quick. Dirty. Stoopid.

But quite educational.

Can you even name 112 languages? I got as far as about 9.

Well, no matter whether you can or you can't, you too can learn how to say "Oh my god, there's an axe in my head!" in all 112 (YEs 112 count them!) languages, including Ancient Egyptian, Visigothic, or even (and this is realy wierd!) Welsh.

They're all here.

"Deus Meus! Securis in capite meo est." (Latin)

I also know another bit of Latin Let me know if the grammar's wrong...
"Semper in excreta summus. Solum profundun variat!"
- Always in the s**t. Only the depth changes!

Just wanted to share.

GUI History

There are precious few resources out there (it seems) for designing interfaces. My perennial favourite, the IArchitect Hall of Shame is out of date, although a lot of the principles underlying it still apply, as reflected at Pixelcentric's site, and UI Patterns and Techniques gives a good overview on common ways of interacting with users..

But for a bit of history, and to put where we are in terms of GUI's now into a bit of context, I've just found the GUIdebook which not only gives a good overview of what's about at the moment in terms of GUI's, but also a bit of an overview of where they've come from, and how they've developed over time.

I'll most likely be spending quite a bit of today (between my 'regular' work) reading up on that.

Just wanted to share.

Wednesday, November 24, 2004

Screaming Fan

At the time of writing this, my blog was the 4th site that comes out of google when you search for Geoff Maciolek.

Wonder where the line is between blog and fan-site...

Geoff still has great hair. People have even (apparently) commented that it's 'Arty'. Now whilst it's finely sculpted, and certainly beautiful, sadly my 'Hair as Art' biases run too deep to describe it as arty (i.e. covered in, smeared with, or containing art).

Not, as far as I'm concerned, arty, but Geoff's hair still rocks.

Tuesday, November 23, 2004

Cheap Toyness

The very observant of you will have noticed that I've got a picture of me on my blog's front page.

For those of you who read this through an aggregator, you might also notice that I've changed my RSS feed to RSS 2.0. Yes. I am a cheap whore who's easily impressed by cheap toys. If you haven't guessed already, the only reason I changed the RSS format was so that my picture appeared in RSSBandit.

If either of you want me to change it back, let me know. I only did it for some cheap toyage. I'm sorry.

Monday, November 22, 2004

Pointless, I know...

But one thing I've been wondering for ages is whether or not Nancy Davolio is or was actually a real person.

She must be one of the most famous people in the world.

Looks like I might have to change the title of my blog...

One of the comments on this post here caught my attention. It's by Daniel Moth who says:

"I understand what you are doing from a business perspective: Driving the professional community to C#; just come out and state it please so we can all stop talking and arguing about it."
. I had a couple of thoughts about it...
  1. Refactoring's not that hard to do, if you do it as you go along. Granted, it means that your initial rate of progress might be a little lower, and it certainly looks odd when you're putting quick prototypes together, but at the end of the day, it's not that arduous a task. That said...
  2. It is a bit of a bugger when the CSharpies get tools that VB people don't
  3. This prioritizing of features like 'My' and stuff like that does give the CSharpies more ammo to sling at VB types. Which is a shame.
  4. It's a relatively minor feature, if you ask me. If you can't change your variable names using search/replace then it's your own fault!*
Those were the first thoughts I had.

Why do I think I might change the name on my blog? Well. One of the things I was really impressed with about VS 2005 is that (as far as I know) VS Standard (i.e. Cheapskate) Edition supports multiple languages. So, when I eventually get it, I'm going to be able to start working with C# as well as VB. No doubt I'll always keep a preference, but hey, one of my favourite things about VB.NET was that it's all .NET. It's all just coding against the framework, and so any differences between one and the other are just syntax. And I can deal with syntax.

*Yes, yes, yes. I know refactoring isn't just about changing variable names, it's l about taking out regularly used bits of code and slinging them in their own methods (among other things...) Changing variable names was just the first thing that came to mind at the time.

Computer stores

It takes a lot to get me to go to computer stores. Usually, I only go in there if:

a) I'm desperate for something and can't wait for next day delivery
b) I know exactly what I'm after, know they've got it in stock, and am desperate to carry something home in a box
c) I'm buying something I'm not too sure about, so I can safely return it under their retail-model-based fairly lax returns policy

The running theme here is desperation. I normally avoid them like the plague.

Reading this article about what makes up the ideal computer store reminded me of a conversation I heard one in my local shop.

Customer: Can you tell me how many internal drive bays there are in this case?
Assistant: I'm sorry, I'm not allowed to advise on individual components
Customer: Well can I open up a box to look myself?
Assistant: I'm afraid we're not allowed to do that
Customer: Well can I take the back off the display model and have a look?
Assistant: I'm afraid we're not allowed to make any modifications to any of the individual components
Customer: I'm don't want to change it, I just want to have a look inside
Assistant: I'm afraid we're not allowed to do that
Customer: So how am I supposed to know what I'm buying
Assistant: You'll have to read the description on the packaging
Customer: But there is no packaging. It's a case. It comes in a cardboard box
Assistant: hmmmm.
Customer: Do you know how many internal drive bays it has.
Assistant: Yes.
Customer: Well can you tell me?
Assistant: I'm afraid I'm not allowed to advise on individual components

Now I'm not going to get into a argument about anything, except the policies surrounding this poor assistant. I really felt for him. He knew exactly what he was talking about. He knew the answer to the question. He wasn't allowed to tell the customer because that was the store's policy (it was a big chain one).

Now I know exactly why this is, and it sucks.

Basically, in order to avoid either:

a) Hiring and training staff so they know what they're on about; or
b) Getting shedloads of returns from disgruntled customers who have been wrongly advised by staff who didn't really know what they were on about

The store has a policy not to tell anyone anything, except what it says on the product description cards on the shelves. This way, they can hire anyone they want, regardless of skill, knowledge, or any of the things that make us who we are and unleash them on the unsuspecting computer-buying public.

It really does suck. But hey, I guess I don't have to talk to them.

Just wanted to share. I'm sure I'll write something worth reading shortly. Been studying quite a little bit about English Query. It looks really cool. I didn't even know it existed, either! What a stroke of genius.

Friday, November 19, 2004

Somebody must have changed their aggregator...

Just checked my RSS feed logs, and I think someone must have changed their aggregator of choice. Not just one person, but a few.

Normally, I run at about 11 subscribers (Yes, 11 whole people!!), but it's shot up today to 14. Either 3 people have shared me with their friends, or 3 people have changed aggregators.

If I have acquired some more people, then hi! If not, then let me know what you're using. If it's good enough for 25% of my readership to migrate, then it must be good!

Just wanted to share.

PS - One of these days (maybe even this evening), I'll write something a bit more substantial. I've had a million and one thoughts in my head all day today, and I gotta write about them! And I might even write something useful too, about SQL Server (OK, useful to me...).

Thursday, November 18, 2004

Truly Cool!

Scott Hanselman uses some truly cool widgetry on his site (here's the tip - roll over the book title links).

He got it from here.

I think this is actually quite cool. I think I shall have to use it more myself!

Long, but good, article

Just a quicky. More of a 'Note to Self'.

Just skimmed through this article on MSDN.

I think I need to read this a bit more deeply. Although I've used Web Services a few times for various things, I've never really seen a summary outlining how it's architected, and the thinking behind it. All the stuff I've seen in books and online tends to dive straight into a demo, and the focus has really been 'Hey. Web Services. They're easy really!'.

Whilst I found that helpful a little while ago, I don't so much now.

Tuesday, November 16, 2004

A Picture speaks a thousand words!

Apparently, there's been a survey in a number of countries around the world about how everyone perceives Britons.

Now the survey says nothing particularly new. We're reserved, polite, sometimes mistaken for cold and snobbish, but at the end of the day we're not a bad bunch. All this, of course, becomes null and void when sport and/or booze are involved. But we knew that already.

What caught my interest, however, was the pictures the beeb chose to accompany the article. They're all shots from hit BBC Comedy Little Britain.

Most amusing. Personally I though that said more about our sense of humour than any survey could have done!

Just wanted to share.

Monday, November 15, 2004

Cheap plug-a-tron

I've finally had a chance to download the first ever Mondays show from Carl & Rory.

This is my cheap plug for it.

It rules. Download it now.


More Mozilla

Okayt, so I've kinda go tused to Mozilla, and it's OK. That'a about it. It's OK. It does the job. It maintains the web-browsing status quo. Except for a couple of things.

The good bit
Tabbed browsing is a neat feature. Not as earth shattering as some people would have you beleive, but neat. Apart from anything else, it does give me an excuse to use my much neglected and seriously under-used middle mouse button.

The Bad Bit
I don't do a huge amount of browsing, but I know a fairly standard page o' HTML when I see it. There doesn't appear to be anything particularly hokey and weird about Rory's site, but I'm buggered if FireFox can render it right. I think it might have something to do with CSS, but I couldn't be sure (mostly because I'm too lazy to dig through and find out.

I have, however, just seen a very cool feature. One that I must admit to being very impressed with. It doesn't quite rock my world, but it certainly makes my CD player skip. FF color-codes the source when you hit 'View Page Source'. Now THAT I can get behind.

Just wanted to share.

Thursday, November 11, 2004

Blogging on Demand #4

This search recently piqued my interest. Not only is it something that's quite interesting, it's also something that, although I've used it a couple of times,I haven't really explored it very much.

"Me.ServiceProcessInstaller1.UserName" (via Google)

The ServiceProcessInstaller works in conjunction with the ServiceInstaller in providing information for, and interacting with Windows' own service installation utility, InstallUtil.exe, for (as the name suggests) installing a service.

These classes should be included whenever you have a service that you want installed (again, the name says it all, really...). Visual Studio and the .NET framework make building Windows Services very easy. Although I haven't got any experience of doing it in the past, I hear services were tricky, to say the least! All you need to do in Visual Studio to create a service is select Add-->Windows Service in the solution explorer. Very Easy . Unfortunately, by default, when you go to install your service using InstallUtil, the compiled executable doesn't have all the information that Windows needs to install it as a service.

The ServiceProcessInstaller is where you set things like the Account Type that the service is going to run under (Whether it's the System Account, User Account etc.). More often than not, you'll be setting the Account property of the ServiceProcessInstaller to ServiceAccount.LocalSystem. The reason for this is that more often than not, you'll be building an application that needs a high privilege to be able to do the things you want (if you've got a service that monitors a folder, for instance, you'll want to make sure your service has access to that folder.

Just a quick note on security (Feel free to skip this paragraph, I'm more thinking out loud than I speaking from actual experience). The best practice is to run your code with the least amount of privilege possible. If you've got a process that needs a certain resource, give it access to that resource AND NOTHING ELSE. You might want to do this by setting up a new user (Ever noticed the ASPNET User account that gets set up when you install the .NET framework?That's what this is). You can also do it by putting together a security policy and deploying it to your machines. This does, however, mean extra stuff that needs to be done at installation, and it can only be done from an account with admin rights on the machine. LocalSystem, while it doesn't really follow best practices, and it does leave your system open to buggering about (Not necessarily malicious buggering about, it could just as easily be just a bit of flaky code. We've all written some of that!), is at least the easiest option when it comes to deployment. I can see from my machine, for example, that all but 2 of the services running on my machine run under the LocalSystem account.

If you do choose to run your services under a User account, the ServiceProcessInstaller is where you might want to specify your username and password. You don't have to put it there, but you may like to. If you don't specify it in there, you will be prompted for it when you go to install each service. I guess the most common need for that would be in a corporate environment where you have a user account set up on all your machines for running a particular service, and don't want to share those credentials with your users.

That's about it for the ServiceProcessInstaller class.

One of the things the ServiceProcessInstaller class does, though, is work with the ServiceInstalller class to get them... Well... Installed. Since you can have an exe that contains a number of services, you need a separate ServiceInstaller for each service within it. The serviceInstaller is where you can specify things like the name that's displayed in the Service Manager console, the Start behavior and things like that. The key properties of note are:

StartType - This can be one of 3 values 'Automatic', 'Manual', and 'Disabled'. You're not likely to use disabled much (I can't think of a situation that would warrant it, anyway...). Automatic means the service will be started up when Windows is fired up. Manual means it won't be started up when the OS starts up, but you can still start it manually either via the Service Manager, or by using a ServiceController in code.
Disabled, as the name suggests, means you can't start it, no matter what. See what I mean about using it when you write a service?

ServiceName - This is, as the name suggests, the name of your service. This needs to be the same name as the ServiceName specified in your code.

DisplayName - This is the friendly, fluffy name you want to appear in the Service Manager. For example, the ASP.NET State Server is actually called 'asp_state'. 'ASP.NET State Server' is it's DisplayName. You don't have to have friendly names, either. SQL Server's service is called 'MSSQLSERVER' (Imaginative, eh?) and it's DisplayName is also 'MSSQLSERVER'.

The ServiceInstaller supports transactions too. It's clever like that. If something goes wrong as it installs a service, it rolls back the whole installation and leaves your computer as if it had never even heard of your service.

By and large, I haven't played about too much in the code behind these classes. Visual Studio has quite a handy little tool that automatically creates ServiceProcessInstallers and ServiceInstaller for you. If you open your service in the designer, and select the service on the design surface, there'll be a handy little linkbutton there that says something along the lines of 'Create an Installer'. Click it, and you'll see your ServiceProcessInstaller and ServiceInstaller magically appear in the designer. You can just go through and change the properties you want to change and Bob's yer uncle. You'll have to go through and do this for each service you've written, but the widget is big enough and clever enough to produce one ServiceProcessInstaller for the executable, and a ServiceController for each service. Clever, eh?

There are a whole host of other things that you can do with ServiceProcessInstaller and ServiceInstallers. These are just the main bits I've used.

It's worth noting, however, that all your service's properties can be changed through the service manager as well. You want to go in and run your service under a User account, no problem, just open up the Service Manager console, and change away. These 2 classes only do their work at the point of installing your service.

If I've missed anything major, let me know. If there's anything wrong, then let me know. Hey, if you know something you didn't know before you read it, then still let me know. Some of this stuff I already knew when I set out, and some of it I learnt on the way whilst writing this post. So it's done it's job, I guess.

Man I wish I lived in the USA

Carl Franklin's posted some pictues on his blog of the DotNetRocks party in Vegas last Friday. It looks really cool.

In the same vein as Phil Weber I think I'm going to have to start a Geoff Maciolek fanclub. Well, not so much a fanclub, more of a one-man web stalking prescence. Or maybe just a bit of a blogliment*.

Man, that Geoff Maciolek really has some fine fine hair, and some fantstic beardage to go with it.

* I just made up that word, 'Blogliment'. It means 'Blogatory Compliment'. I like it. I think I'm going to have to use it more often.

Just wanted to share.

First days with Firefox

Although it's desperately dull, I'm going to add a couple of posts about the funny things I find as I start using Firefox. This isn't meant to be any kind of review, but more of an aide memoir to myself, just in case anyone asks, or anything particularly interesting crops up. Feel free to tune out now.

Firstly, I realised just how little I use a web browser in isolation. Normally I browse the web using the built-in browser in some other application (e.g. Visual Studio, RSS Bandit etc.). The only exceptions are when websites are tryng to do something unsupported or disabled by the integrated browser.

As a result, my initial reaction so far is 'And...?'. I haven't been able to do anything I couldn't do before. I haven't noticed being any more private, or secure. There are a couple of odd behaviours I've noticed - all the text on Neopoleon.com
disappears periodically, and I have to scroll up or down to make it reappear. But apart from that, it's just more of the same, only with more public shouting.

Call me an MS fascist, or call me small minded and stubborn, but y'know, I really can't see what all the fuss is about. Maybe I'm just too much of a grumpy old man.

I've just re-read this post, and man is it dull! Sorry about that.

Just wanted to share.

Wednesday, November 10, 2004

Firefox 1.0 is out.

For the one person on the planet who doesn't know, the much vaunted Firefox 1.0 is out now.

I'll download it and give it a go, I'm sure, but I daresay I'll keep using IE for now.

To quote from the Firefox website:
Why Use Firefox?

Popup Blocking - erm... Well... I've got that already. It works fine...

Privacy and Security - I think most people would agree that Privacy and Security are as much a user's responsibility as they are the software's. I've heard it said (many times!) tat no system can be made completely secure and still usable. SecretGeek has a very nice guide to defensive programming, and making your applications secure. There is also the rather woolly issue of what constitutes privacy. Security's pretty (or at least compared to privacy, anyway!) clearcut. But Privacy? Just look at the 2 main names for internet usage monitoring software. I say SpyWare, you say AdWare. Malicious? Who knows. Easily avoidable? For sure. Killable? Definitely.

Smarter Search - "Google Search is built right into the toolbar". As it is on my machine. The Google toolbar's not that difficult to install!

Live Bookmarks - From what I can gather, this is marketing speak for 'Integrated RSS Aggregator'. Okay, fair enough. If I want to go through my RSS feeds I have to go to the hassle of opening up RSS Bandit (What a drag!). I'll reserve judgment until I play with it.

Hassle-free Downloading - And how much hassle is IE? You've got a bit of a dilemma here when you're putting together a browser, I guess. Do you download a whole bunch of stuff automatically, and face the security consequences, or do you ask for confirmation at every step? Who knows?

S, M, L or XL—It's Your Choice - Yes, it's customizable. My only concern is how that customization fits in with its security and privacy model. Does that mean I can build a plugin that pings my server with the header information of every webrequest made from the browser? Woohoo! Wrap it around a pretty theme, and I've got my piece of SpyWare (or AdWare, depending on who you are) built into the very browse itself! Great! Also means there's more stuff that needs re-installing next time I repave.

Setup's a Snap - Okay, I guess this has just been put in there to attract people who are convinced that software installation is something only to be done by techheads (and there are a lot of them out there)

A Developer's Best Friend - Eh? I have a best friend. I don't want another!

And last but not least, the one thing that I've heard so much about. The one thing that I think has had more coverage than anything else. The one thing that is meant to be the IE killer. Ladies and Gentlemen, put your hands together and give it up for the one, the only...

Tabbed Browsing - Woo Hoo. Tabbed Browsing. Well if that hasn't solved all my problems. Tabbed browsing. I can have an entire group of windows open with only one taskbar item. I can flip between one and the other. Great. Come on. It's tabbed browsing. Much as I like the tabbed interface s la Visual Studio, I don't think it's really so hot as to make it the one selling point for a browser. Is that what we've been reduced to? Getting all frothy about the mouth over tabs.

As I said before, I haven't used it yet myself. I daresay I'll write another post in a few days saying 'Hey, Firefox is da bomb. I don't know how I lived without it!' We'll have to wait and see.

Don't flame me for writing so much about something I haven't used (yet). This is just my take on the marketing spin, and the 'Firefox is gonna kill IE' vibe I've been getting from the news.

At the end of the day, it's still just a web browser.

Just wanted to share. I've seen noting but Firefox Firefox Firefox for the past 2 days...

Tuesday, November 09, 2004

I think I finally get it.

I think I might have had a bit of a revelation yesterday on the way home from work.

Walking along, rain blowing in my face, bit of Metallica on my MP3 player (And yes, Metallica, I did pay for it!), deciding whether to get the carbonara sauce out of the freezer or get the chicken out for tea, and suddenly I saw a light. I don't know if it's the light, but it was certainly bright! This, by the way, has nothing to do with inheritance. Luckily, being cold, damp. tired, hungry and annoyed (the tube was delayed as well!) is not an analogy for inheritance.

I think I finally get it.

I was thinking about a general object 'Item' that you might get in a shop or catalogue. Now up until now, I would have put together a big old class that encommpassed all my functionality, including ordering, (Item.AddToOrder()), Catalogue information (Item.Image) and so on.

In the past, I would have done one of two things:

1) Had a great big IItem interface, and had to implement a whole shedload of dummy methods to make it compile

2) Implement a few extra classes, for orders and so on which contain within them a property 'BaseItem' which returns an item

1's a bit clumsy, and means writing a whole load of unneccesary code.

2 is a little better, but still means writing a whole load of extra code. I mean, to get to it, you're looking at a minimun 3 extra keystrokes to get to a property of the BaseItem ('B', then tab to autocomplete it, then a '.'). Not ideal.

Inheritance is the key. I can create an 'Item' class, implement methods and properteis for the bits that are universal and then create inherited CatalogItem classes, OrderItem classes and so on that expand on that.

Now this isn't anything new or revolutionary. I've just re-read this post and thought to myself 'Yeah. I already knew that. What's the big deal?'

The big deal is this: Although I knew it already. I could probably have even explained it to someone else at a push, and I certainly know what people are on about when they talk about it, I didn't really get it.

Does this happen to anyone else? I mean I've used inheritance in the past, I've expanded or customised frmaework classes to make it work exactly how I want it, I've even fixed bugs shortcomings in my own code using inheritance.

Only now, though, do I think I actually really get it. I might even go as far as to say I understand it.

Just wanted to share.

Thursday, November 04, 2004

That eery feeling...

Did you ever get that eery when you're not sure whether you're looking at a spoof site or not? I remember a couple of years ago, many people got that feeling with www.manmeat.com (I'd link to it, but the site was taken down after too many people got that feeling...).

I got that today reading this company's dress code.

I don't know whether to take it seriously or not. Thw whole site gives the same impression.

It's either an unfeasibly good, creme de la creme company, (for which nobody can work at all. No. Never!) or someone's having a laugh. I still can't work it out.

If you've got any ideas, then let me know. I'm flummoxed.

Just wanted to share my flummoxed-ness.

Ignoring my own advice...

Back in this post, the first rule (more of a guideline than a rule) I made up (from experience, I hasten to add!) was "Know that you know nothing". I've been surprised this week at how right I was. And not just for .NET, but for everything.

I've recently started reading Robert Vieira's excellent Professional SQL Server 2000 Programming, and my, is it good.

I thought I knew a little bit about SQL Server. Although coming from an Access background, I'd read a bit about good database design, I've heard a few people talk about SQL server (mainly on DNR) and can hold my own in a conversation about it. Although I knew there was plenty I didn't know, I thought I knew a few of the fundamentals. Scratch that. I thought I knew enough of the slightly higher level stuff that the fundamentals would slot into place fairly simply. I now know different.

I've just spent an hour on the tube reading all about Indexes. It's only about chapter 4, and a pitifully short way into the book. And my goodness, there's a lot in there to learn. That's good, since I quite like learning new stuff. But it has highlighted just how little I know about what goes on under the hood. I knew, for example, that clustered indexes are good in some situations and bad in others. I knew as well that sometimes table indexes are a bit superfluous and can actually impede the efficiency of your database. At a push, I might even have been able to drag out of my addled brain which situations were right for which. However, after reading this one chapter, I realize that I knew nothing. I kind of knew the 'what', just not the 'why'. Granted, to get to the 'why', there are a whole load of complicated hoops you've got to jump through. The 'why' takes up a whole lotta reading, but still, it reminded me just how little I really know.

I heard someone say once 'The more I know, the more I know I don't know'. Nary a truer word spoken.

On the upside, though, I do sort of know a bit about the 'why' of indexing tables, and even with this little bit of understanding it's sparked off a few questions in my mind about other things I'd like to find out about. Which is good (especially if you're me.)

Note to self: If you're going to offer advice, don't forget to follow it yourself!

Just wanted to share.

Tuesday, November 02, 2004

New Toys! NEW TOYS!!

Well, after my birthday, I've got myself a couple of new toys to be playing with.

SQL Server Developer Edition. SQL Server's one of those biiig gaps in my skills. Although I've read quite a lot (and even used quite a bit) about database design, normalisation, stored procedures security and stuff, it's always been using Access to put together DB's on MSDE. I never even SAW query analyser until just a couple of months ago.

But that's been cured now. I've got a proper DBMS now, so that's alright.

Microsoft Flight Simulator 2004. Now this has got me all excited. This has got me out of bed early. This is a sexy mother of a game. It's really boring at times - Watching the AutoPilot steer you from Plymouth (my home town) to Exeter (where the ladies of Plymouth go for a day shopping) isn't really that exciting. But I'm stil getting over the novelty of being able to take off from Plymouth Airport, fly over the Tamar river, buzz the very same bridge that my dad goes over to get to work every day and land in a town I once sang in (they have a cathedral there, and I sang in it once.). It's got some really cool real world maps and stuff, and it covers THE ENTIRE WORLD! I'm quite impressed, anyway.

Oh yeah, and I got some SQL Server books as well. I'm currently reading Professional SQL Server Programming. It's quite good.

Expect some posts in the future about SQL and MSFS (apart from the usual .NET ramblings, rants and misc. stuff).

Although they won't be particularly frequent - for some reason, I seem to have been really really busy for the past few weeks. I'm hoping it doesn't last!