Tuesday, September 21, 2010

The Perfect Programming Language, will there ever be?

Is there a Perfect Programming Language?

Any programming language could be the best depending on you and what you want to use it for. Reading user reviews of different programming languages or using their killer apps would make you think every language is the best.

Imagine a newbie thinking of a programming language to start with then finding out Facebook and Yahoo are mainly PHP, he will think PHP is the best. Google uses Java and Python, the all-popular Twitter is written in Ruby, MSN and Hotmail are ASP.NET, Mozilla Firefox and OpenOffice are both written in C++, the multipurpose Netbeans & Eclipse IDEs are Java apps to mention a few.

There is still a question of 'can't I just choose the best and learn it?'. But which is the best of the programming languages. My own answer is NONE. None of them is perfect. Each programming language solves problem(s) and leaves/creates other(s).

Looking at a language like C++, it is statically-typed and runs fast. But you'll write several lines of codes, you can sleep and wake and still meet your program compiling (if you've built a large C++ program from source before, you'll notice this), there is need to build your program on the target platform before it can run on it and so on.

Java brought a new dimension. You can write once and run everywhere, it provides a cross-platform UI (User Interface) toolkit, it is statically-typed. But there are still some problems. It runs in the JVM (Java Virtual Machine) which leads to slight reduce in speed, you still write lots of code, your program's maximum capability is the JVM's and so on.

Then the interpreted languages like Ruby, Python, Javascript e.t.c solved some issues. No need to wait for compilation, you write shorter codes, easy to learn. But the fact that it doesn't compile leads to unnecessary runtime errors that could be checked during compilation and slower runtime.

There are also some JVM based languages like Scala, Groovy e.t.c. They also solve some problems but the fact that they are JVM based still leaves the JVM issues above unfixed.

October last year(2009), Google released a programming language named Go. It is statically typed, has fast runtime, shorter codes, lightweight inheritance with the use of interface, cross compilation (can build a program targeted for Windows on a Linux PC, even targeted for a 64bit on a 32bit PC) and so on. Apart from these features, I'm also a Google fan so I tried the language. One thing that is painfully missing is a fully functional UI toolkit, most apps written in Go uses Javascript and HTML as fronted which is viewed through a web browser. It may be available later in the future but right now it is not available.

Mozilla is also working on a language called Rust. Knowing Mozilla as a company that has written popular desktop apps (Firefox and Thunderbird to mention a few), Rust should have a functional UI toolkit but I believe something will still be missing, we can't know that till it is released.

So, will there ever be that perfect programming language? A programming language that is cross platform with a fully functional cross-platform UI toolkit, fast runtime, easy to learn, clear syntax and shorter codes? Hmmn, time will tell.

But till then, you just have to use the language that best fits the job.

I'm still waiting and hoping for that Perfect Programming Language, I just pray and hope my wait will not be eternal.

Monday, September 20, 2010

Becoming a Linux User

5 years ago had someone told me I'll be using Linux as my primary OS, I'll just have a loud laugh.

Growing up in an environment where your orientation is that every computer runs Windows, in fact, it is like Windows is the only OS that exists and Microsoft is the only company that develops computer softwares. Note: I knew of Mac but it was very scarce and expensive so I never considered it.

When I learnt about programming, it was still Microsoft Visual Studio. I thought I was really working towards becoming a Computer Scientist not knowing I'm actually becoming a Microsoft Scientist (couldn't find a better title).

There was this shout about an OS that doesn't get infected by virus(es) named Linux. Some time in 2007, I was able to get a Mandriva 2008 DVD from a friend. After receiving the DVD, my mind was filled with imaginations of how it will look like i.e. for the first time, I will see something different from Windows.

I inserted the DVD on my then Toshiba laptop, booted from it and saw a colourful Mandriva image. I keep following the instructions and clicking next. What amazes me during the installation was the fact that it can shrink my windows partition to free some space for itself, never seen that during a windows OS installation before. After 30 mins I finally saw a desktop. I was able to access my Windows partition, open my existing office documents from the windows partition, read pdf files, play music, watch movies, browse the web. All this is possible immediately after the installation, no reboot, no extra software installation. But one thing that is very obvious is that it is uglier than windows.

I just thought to myself I can use this, but Windows is far better.

After a while I got an OpenSUSE cd from a friend and tried it. The installation was successful but I couldn't play music or videos. I then figured out the Madriva I installed is a DVD version so most things are present. I got pissed off and I went back to Windows.

Later I came across Ubuntu (then version 7.10). I thought to myself, this is the most popular distro, if I have any issue I should easily get help. I installed it alongside windows and found nothing new but a different look to openSUSE and Mandriva (later discovered it is using Gnome desktop and they are both using KDE). One day I was playing with the Ubuntu, I went to Appearance Preference and went to Visual Effects and chose Extra. The elastic behaviour of my windows were amazing.

Coincidentally, a friend of mine just got a laptop and Ubuntu was on it. Finally someone else is using it too. I downloaded the JDK and Netbeans for Linux and I tried it. It worked. One thing I fail to notice is that I'm getting more comfortable with Linux the more I use it.

My Linux world started after the release of Ubuntu 9.04. The boot screen now looks sexier. I can now spend hours on Ubuntu without remembering or thinking 'had it been Windows'. But one fact remains i'll spend like 5mins to configure a program that'll work out of the box in Windows.

Despite being this comfortable in Linux I'm still not confident enough so Windows is always on another partition in case of anything. Until one day, a very close friend of mine using a trial version of Windows 7 got locked out of his PC, he also installed Ubuntu alongside windows so he just switched to Ubuntu till he'll get it sorted. Days passed, month passed and he still hasn't sorted it. He walked up to me and told me 'If I've been able to use Ubuntu for the past weeks without breaking my pc, then I can cope without Windows'. So he got the Ubuntu 9.10 CD from me and installed Ubuntu alone on his pc. That action led to my own to give it a try. I can always go back, I thought.

The truth is that right now, I can only think of 'had it been Ubuntu' when working on a windows pc.

What are the things I really enjoyed in Linux
  • The filetype recognition not being dependent on file extension. U can try it by naming a movie file .doc and see if u won't get the screenshot as file icon
  • The archive manager - It handles virtually any format that exists and the drag and drop behaviour between the archive manager and native OS is just too sweet.
  • The fact that virtually any software I come across is available in the software repository
  • Highly customizable - no matter how good you can tweak windows, it will still be obvious. But you can see 2 different linux (even Ubuntu) desktops and think they are 2 completely different OS
  • Network Manager - can have specific IP settings for different connections
  • Compiz Effects
  • apt-get install - installs and configures for you.
  • It is free and you don't have to worry about Genuine Windows and lots more...
I'm not saying Windows is bad or Linux is the only way. But if you are a developer (even web) and your main platform is not .Net. And you can't use a Mac. Then u should consider Linux. It is not unusable and not too complex.

You may still need windows. In my case as a Software Developer, large percentage of the end-users are running Windows, so there are cases I need to test my programs on Windows. There are several ways to go about it but the easiest way if ur pc is capable (i.e. is multi-core and has enough RAM) is through Virtualization (using VirtualBox or VMWare). No need to reboot into another OS.

My conclusion is simply that Linux can be your primary OS, it could even be more user friendly than windows if u get it right. It is not as hard or meant for gurus as it is painted. There are a lot of distros out there but Ubuntu or Linux Mint should be a good welcome.