October 24, 2003

Windows: Same Old Shit

Today my work computer crashed. Badly.

The only thing I did was that I rebooted. The previous day I had installed over 2 GBs worth of programs. Really, there were only two (plus one application I was developing): Visual Studio .NET (1.4 GB) and IIS (around 1 GB). Really, nothing should be that big. They must be one hell of programs since they take that much space. Had I installed help files, that had taken yet 1.9 GB more. Ridiculous. But that's another story.

I needed to install the programs to write my very first C# application. That turned out to be a multi-threaded Windows service requiring UI and communicating to some activeX controls. C# is merely a rip-off of Java, but that's another story as well. Anyway, I was immediately familiar with C# and Visual Studio that I had never before really used. I have to say that C#'s threading model is interesting, clever even. Someone could argue that it's not necessarily too object-oriented, but as pragmatist, I realize that treating a function directly as a thread-able object be is a much simpler than extending Java's Thread class.

I had also installed one security patch, but hadn't rebooted till today. I had started getting some weird security errors even though my C# service application I was developing had been working well before, so I rebooted. After the computer restarted I never got to the login screen any more. Mouse was working but CTRAL-ALT-DEL didn't respond at all. Safe mode or rolling back to "last known good configuration" didn't help. So, I thought, it has something to do with the services I had installed. Well, how do you stop the rogue services? No easy way of course.

I run the recovery console and stopped all the services I knew were new. Didn't help at all. What do you do then? The same thing you've always done in the past 15 years Windows has existed. Re-install the operating system. At least there's a recovery installation in XP, so you can keep all your settings. The first time after the first reboot during the installation, I got a funny (or not so funny) error message (don't remember exactly what it was, I'll find out) and a blue screen of death with a message saying that the computer has been stopped to prevent damage to my computer. Whatever that could be, I think the damage had already been done.

Well. I knew the hard disk hadn't been damaged (since I had run chkdsk from the recovery console), so I just tried again. Lo and Behold, it worked this time. Since it takes a while for to complete the installation and it was Friday, pretty late, I just left home and crossed my fingers that the installation would go fine. Probably everything's going to work fine tomorrow morning. Or not.

It's just impossible for me to understand why is it that it seems that you still need to re-install your Windows OS regularly once or twice a year. While I admit that NT/2000/XP have been a lot more stable than Windows 3.x/95/98/Me ever were it is just outrageous that the only answer, when a bit bigger problem in Windows happens, is to re-install the whole operating system again.

I'm not blaming Microsoft for writing bad code or requiring them to make sure that something like this doesn't ever happen. Having been in the business for years, I've accepted the sad truth that typically software just is buggy. (But I refuse to believe that you couldn't write bug free code.) But what I don't get and approve is that there's neither a good way to tell what actually went wrong nor a simpler way of fixing something than re-installing your operating system. Where's my 4GB Opteron Linux workstation? Linux distros have been getting a lot better in the past few years, but I remember the days when your graphical desktop kept crashing and you needed to search for new patches and modify your configuration files daily to get your software running, but the good thing with Linux is that at least it's possible to locate the problem, tweak it and get it working.

Btw, while we are at it, let me tell you about the last time I got a new computer. I had a lot of files in my old computer so I wanted migrate the data to the new computer. I used disk cloning software to make an exact image of the hard disk on the new one. Booted the new computer, and of course it crashed with a blue screen. After a couple of unsuccessful recovery installation tries, I ended up cloning the disk, doing a new install without formatting the new drive, then copying the old registry files (except the system registry file) over to the new drive. That way I managed to keep all the old system and application settings, and user configurations. I only manually needed to re-install some service settings. And does Microsoft tell you that you can do this? Of course not. For some reason they want the users to have the nice memories and read zillion times the great ads shown during the installation process telling you how productive you will be with the new system and how many cool things you can do.

Posted by thoughts at 11:31 PM | Comments (1) | TrackBack

October 10, 2003

Blog Spam

Just checked my Thoughts and noticed that I had got very first comments for my blog entries. Curious, I clicked on the entry to read them. I had got blog spam! I thought it was hilarious. Ok, this is a boring technology blog, so maybe I could spice it up with some girl pictures. But come on, spamming other people's blogs - can you go any lower than that? Did you really think that this site will generate so massive amounts of nerd traffic to your little xxx site that it's really worth it?

While laughing at first, I started thinking. Because there are only few different blogging tools, it wouldn't be that hard to make a spam spider that would add comments to all open entries it finds and post links to whatever site you wish. How do you block blog spam? Will Movable type need to start adding spam filters to their tool? Will this become another bitter, eternal fight with spammers and users, with black lists, law suits etc? The only difference here compared to email spamming is that I know where the spam comes from. It's pretty hard to spoof your IP. Of course, spammers could start using public computer in libraries and wherever to run their evil spiders to avoid being blocked. But still. Do spammers really think this is a good way of getting more visitors to their sites?

I haven't allowed the use of html in comments and now I have a good reason why not. The only way you can post a link is to use the URL field. Maybe in the future I have to remove it, but I left it there for the time being. And yes, of course I banned the IP after checking it and deleted the comments. I'm curious to see what kind of comments I'll get for this entry.

--- EDIT:
Today, October 25th, I removed 11 blog spams and also removed the option to post anonymous comments. Sad, isn't it?

Posted by thoughts at 09:03 AM | Comments (0) | TrackBack

October 08, 2003

Creature Programming

So here's the thing. No one really knows what 4GL (4th Generation Language) is, even though everybody wants to develop in it. That's because everybody also realized that object-oriented technology by itself didn't really turn out to be the silver bullet to make programming fast & easy.

A quick recap:
1GL = machine language (starting from punch cards)
2GL = Assembler language (symbolic machine language)
Then depending on who you ask, either
3GL = Functional, object-oriented languages
or 3GL = Functional languages
and 4GL = Object-oriented languages

Given that the basics of object-oriented programming were developed at roughly the same time as the basics of functional programming and that a method call is just a function call with one additional parameter (a reference to the object itself), I would be more inclined to say object-oriented programming is just a 3GL language. Only it has better packaging of functionalities than functional languages.

Ask any programmer now, and at least all the good ones will say that object-oriented programming is the best and most productive way of programming now on the market. Although they will likely also tell you that it's still not a picnic. Ask them how to to make it better, and they don't have any idea.

I've always been saying that while learning multiple programming languages is easy because the concepts stay more or less the same, actual programming is just inherently laborious and tedious. It's not the big things that are difficult, but the small things, like taking care of all the exceptions, error handling, fail recovery and generally making the code robust enough to expect the unexpected.

Sure, design patters, unit testing, IDEs with code completion, increasing number of available frameworks, components etc. make things easier, but many times you still end up solving the same problem over and over again.

One problem is that the more complex and the greater amount of concepts you try to replace with simpler language concepts the bigger your language tends to get. And if you don't extend the language itself, but write code frameworks (which arguably is a better way), you need to know them as well. Consider an elegant language like Smalltalk, which only has five reserved words. Pretty easy to remember them, huh? But can you do anything with Smalltalk if you are not familiar with its foundation classes? No. Believe me, it's a bitch to trace down through fifteen subsequent method calls to find out what one badly named method actually does.

One answer is domain-specific languages. Create a specific language for well-defined, stable domain and you can make your language support concepts at much higher levels of abstraction without the burden of concepts you don't actually need. It's great for the programmer as well, since you have less possibilities to make mistakes :) I've worked with domain-specific languages and code generation in the past, so I know the approach works. In some cases really really well too. Only the problem is that it works in just those limited, well defined domains. What if you don't have the domain, or your domain is still quickly evolving? The task to maintain a DSL will quickly become more laborious than the actual development with the DSL.

So, I try to think out of the box. Functional and object-oriented languages really revolutionized programming, as did assembler programming to machine language programming. Can there be anything new anymore? Many say that components and component-based development is programming in 4GL. But aren't they just mature objects with well-defined, stable interfaces?

Often new inventions have been made by studying nature. Nature has already had billions of years to think things through. Could we do that again? Functional languages imitates machines with functionality broken down to smaller pieces and objects have their ideals in real-life objects that provide different functionalities. But what do living beings do that their counter-part code objects don't? They perceive, think and evolve. Could it be that the next step of programming evolution after object-oriented programming is Creature Programming? (See I even have a catchy name :)

Creature Programming, as I envision it, is based on three fundamentals:
- Means of perception
- Ability to memorize events
- Ability to dynamically change your own behaviour

If you think about it, we already have much of the elements needed for Creature Programming in place, much the same way as we had for object-oriented programming before actual object-oriented programming.

JIT compilers today can already change the behaviour of an object run-time. Granted, it's pretty limited and there's no way for you to tell it to optimize differently, but it's something. But what if you as the programmer could teach your creature how to do things?

Also, lines between compiled and interpreted languages start to become more and more blurred. Fairly well-developed languages, such as Java, support introspection and dynamic method invocation. You can include scripting engines, such as Rhino inside your Java-application and write your Java-application in scripting language.

Objects can already listen and react to events, but their perception is fairly limited. They don't see, feel or hear anything in the world they are live in. What is the world they live in? What kind of means of perception they would need to observe it? They also don't remember anything they just did, and thus cannot evolve to do the same thing better next time. Many AI implementations are based on state machines reacting to various events, but you need to carefully create those events that you want to system to respond. If the objects had better means of perception and ways of trying out different reactions we wouldn't need to create so many specific events for different situations.

Objects would need memory to become creatures that could evolve. The creature could work in two different modes, in "practising" mode, where it could track its performance and verify it did the task right and in "automated" mode where it would execute the task the best way it found to get accepted result with minimum amount of work. Isn't that the same thing you do when you practice your golf swing or optimize your commuting route?

What would programming the creatures be like? Probably you wouldn't like to write code to tell the creature exactly what to do, but it would be more like teaching or interactive question and answer session.

One problem though. How does the creature know what is the best way of doing something? What motivates the creature to do things? Wouldn't the creature need a mission, to hold everything together? We need a mission too, our purpose to exist and to live on. While some days your conscious self can feel like you don't have a direction, that life is just not worth living, we all have built-in mechanisms to just hang on to life, to grow and to breed. On those days, it's very handy.

Is this more like AI I hear you say. Isn't it terribly hard to do? But no, I'm envisioning only little things, only very dumb creatures that you can teach to do small tasks. This looks like something I could try out, build prototypes of it and in general make my hobby. I'm happily leaving somebody brighter than me to envision AI programming in 5GL :)

All for now about this topic, I'll keep you posted if and when I have something real to show. I probably still need to clean this entry a bit over the next few days and add some URLs.

Posted by thoughts at 05:10 PM | Comments (0) | TrackBack

October 02, 2003

Google got me indexed

Wohoo once more. Google got me indexed, so now for the first time I really feel my virtual thoughts are alive :) Everybody who have founded a new site faces this problem: how do you let the world know that you are there? It didn't actually take too long, since I just founded the site around 10 days ago. I submitted the site to Google as the first thing after I got the site up, and then to some other directories and search engines. However, from the stats I could see that I was getting practically no hits. It wasn't until a few days ago when I found this pretty handy website that allows you to submit your site url to several search engines and directories at once. I also turned on PageRank (which I normally don't use) from my Google toolbar. I don't really know which one did the trick to get Google to index me, but there my Thoughts are now. Google really is THE search engine where you need to be. Once you get there, it's just up to you to deliver content useful for others. Some might even argue that Google is becoming a little bit too powerful. I'm not too worried about that though. A search engine in theory is fairly simple to build and there are lots of competitors who'd just love to become the next Google. The competition can only be good for web users.

I noticed that you need to be really careful about setting your meta tags correctly. This site should be fairly secure so that's not a problem, but some of the indexed urls neither "look nice" nor are meant to be indexed at all. A funny thing is that Movable Type doesn't use default meta tags at all in their templates. There are many templates that shouldn't be indexed, so you need to add < meta name="robots" content="noindex,follow" > to various templates and go through all of them to add "description" and "keyword" meta tags to pages you actually want to index.

Boy. It was surprisingly difficult to produce these < > characters in text. Is it absolutely necessary to leave the space there to get MT to allow and convert the characters to URL encoded format, anyone know? Note to self, need to take a look at MT source code sometime. Another point, I've tried to use well formed urls, as you may have noticed. I've also also tried to make the content otherwise as user (and Google) friendly as possible by following the Nine things you can do to make your web site better.

The posted topics have been somewhat light on content, but now I have an actual thought forming up in my head. Maybe I'll mull over it a few more days before posting so I don't look over-enthusiastic.

Posted by thoughts at 10:10 PM | Comments (1) | TrackBack