domingo, 16 de septiembre de 2007

Unix and Linux design flaws

Like it or not, all software has desing decisions built into them. Those design choices may be good choices or bad choices, in which case we say design flaws.

Some times the design is not clearly either good or bad, only after 20 years you may realize one of those design decisions turned out to be flaws.

Usually the ones that are hard to change, maintain or improve are the worst ones. Also the ones that take time from unsuspecting users (or customers), since the whole point of using computers is that you can save time by using them.

Unix design flaws

Unix design flaws are shared with Linux since Linux is a Unix clone. I already wrote Unix is a Linux clone because Linux is a lot more popular than Unix. But Unix has really old design choices made in the 70's when computers were expensive, and resources in computers were scarce. No one ever though you could possibly have more than 1 GB of RAM, so a lot of the design decision of C and Unix are really dated (C and Unix originally were developed together).

The fact that Unix and C were so popular were that they were almost open source. BSD was freely available to some universities and to this day it is not clear which company has the rights on Unix.

Linux is simply changing the scenario by making a Unix clone free and therefore the price is zero, but the design flaws are still there. I know I'm not going to win any friends with this post, but what the heck.

File descriptors are integers and everything in Unix is a file, so you operate on them using file descriptors, and integers in C are machine dependent, which means that all Unices have different integer sizes and therefore you write some code and it is machine dependant.

So Linux runs some way in one machine, and in other machines it fails. GNU was the inventor of the "GNU is Not Unix" moniquer and what they did was to reimplement Unix from scratch (the APIs can't be copyrighted according to US courts) and also, make GNU code portable across different hardware.

How did they do this?

make
make install

And that's about it!

Therefore GNU, Linux and Unix is portable at the source level when using the GNU mechanism for building software (basically make and configure).

But Windows is portable at the binary level. and this is a superior alternative.

Going crazy

Probably now you think I'm crazy. How it would be possible for Windoze to be superior to the almighty Linux?

I agree that Linux and specially Ubuntu have gone a long way to make Linux a viable alternative to Windows. You can install Windows binaries from a CD without having to recompile and the same can be done with Ubuntu. But the parallel stops there.

I installed Ubuntu in one of my computers and then instead of cabling my house I tried to use an USB based wireless network. The only problem is that the USB stick didn't come with the Linux drivers, small frustration, I downloaded them from the Internet and then I have to compile them. But Ubuntu doesn't come with the compiler. Should I download it? It comes in source form, since if it is compiled, it is not guaranteed to run in my computer.

What can I do now?

It is really a bad decision to be compatible at the source level. Windows design choice was clearly superior.

Java is superior

But I think it is even better in the case of Java, because you can write once and run everywhere, so it is compatible at the binary level.

No hay comentarios: