May 12, 2008

Computer Tomography - CT

I have been on CT few weeks ago. It was my first "experience" and and I was a bit exited about it. When I arrived to the hospital, to the CT station, I had to wait for about a half an hour to get my turn. The CT "machine" looked like a big circle (it was bigger then me I guess) and at the top it had a logo of Philips (let's make things better). Unfortunately I didn't take any picture of it :-(

Well, the CT itself took just about 2 or less minutes and I have got the results on CD. You may guess what was the first thing that I had done with that CD :-D I had my laptop with myself, so I woke it up (I don't remember when was the last time when I clicked on the Shutdown button in Windows as I always just put my laptop to Sleep or Hibernate mode) and checked what's on the CD. There was some application for viewing the results so I started it. And wu-ala, I was looking at my head from inside :)

My head from side.

My head in layers from front.

There were about 400 photos taken and the provided application can create nice animations of those photos. Unfortunately I don't have any screen recording application installed here on my laptop so I cannot show it to you :-(

Write Code: Mind Wide Open

I was talking with a friend of mine about some programming stuff. He has got a school assignment to develop a simple game in C#. Well, the first thing that students usually start with, is that they buy a book about C#. They read the book, and when the last page is over, they start with the development of their fabulous application. Now they know a lot of C# commands, structures, objects, we could maybe say that some of them are now even C# gurus (at least they know a bunch of commands). Now there is a problem. Many times I face people that even tho' they know HOW to write code, they do not know WHAT to write!

Many times they are missing the essential imagination of the application's building blocks, relations, dependencies, application flow, etc. My suggestion for this case is to grab a pencil and paper, forget everything you know about C#, open your mind and start drawing and designing your application.

You can start with the user interface. If you know that the game will be the minesweeper, draw a basic window, control objects, the minefield, etc. Then start with the application analysis. Within the analysis you have to understand what must your application exactly do. After finishing the analysis part, you should have an activity diagram, that will clearly display what actions may happen in you application and how to handle them. This part was the platform independent analysis. For this part it is not necessary to know anything about C#. As you will go deeper and deeper, your drawing will became more and more platform dependent, and for this game it should end up at the .net and C# platform.

So continue with deeper analysis and create the architecture of you application. Start thinking about building blocks of you application - basic classes, interfaces, methods, their relations, dependencies, etc. Draw everything to your paper and take notes. Supporting applications like MindManager or FreeMind may help you to collect your ideas and don't forget anything.

After having completed all these steps, remember all the things that you learned about programming in C#, take a look at your drawings and notes, and now you should know HOW and WHAT to write to your source code!


A successful analysis at the beginning is about complete understanding of the application and it ensures that at the end of your application development you should not end up in such a situation as it is displayed on this ^ picture :-)