Tuesday, April 15, 2008

Linux is still dumb....inherited Shell genes

If you are working on both windows and linux at the same time, one of the first annoying thing that you will discover is that linux's shell (bash) is very unforgiving when it comes to "\r" or
carriage return or ctrl-ascii-13 ...whatever you call it.

When you use an ide to write some scripts and when you copied it to Linux, you get a really dumb message : "bad intepreter: No such file or directory" . It is really amazing at the time and age when software are supposed to be smarter and better, we have linux still stuck with dumb shells like bash who dont understand nor have to common sense to ignore "\r" as part of the new line. Although on windows if you open via notepad any text files written in unix, you will be similarly annoyed due to the missing \r, but i have yet to find a Windows program that is unable to process a file that is missing \r or created by unix text editors. Thus i can say Linux is still pretty much dumb due to the fact that it inherited some cow legacy while Windows have smartly sided with the users.

Meanwhile, you have to live with doing commands like this :

mv original.file backup.file; tr -d '\r' <> original.file

whenever you move some scripsts over from Windows.

Tuesday, April 8, 2008

IDE rules the day

I tried 2 Python IDE, Komodo 4.3 and Wing IDE 3.0.
Komodo has support for other languages like php and ruby while Wing IDE is on Python itself.

I must say Wing IDE's "intellisense" works much better than Komodo and the latter had a problem running on Vista with UAC on (even with admin rights) while Wing running under Admin was good.

However there are some things that both IDE could not address in Python coding that makes
the standard lower compared with VS 2005 IDE (we wont even talk on VS 2008).

When you key in python class for eg that inherits from another class, none of the ide manage to display the base class members methods when you are coding the new class. Maybe this is the problem with Python language itself make it much harder for the IDE to present the valid context for showing lists of members methods.

For eg if you have a base class "Dog" and it has 2 methods :

class Dog () :
def DigGround (self, where, depth) :
pass

def Jump (self, objecttojump, height) :
pass


class Basset (Dog) :
(expect no help here if you plan to override DigGround, you will need to look at the api reference as none of the IDEs could show you)

I know it a minor thing but if you are using Twisted for example, there are many instance where you would need to refer to the documentation for the apis if you plan overriding or calling some of these attributes which in the process is really frustrating. Unless you memorized stuffs like "one of the method you can override is def connectionMade(self): or def dataReceived (self, data)" it would be hard pressed to ask the IDE to show you these methods implemented at the those libraries you are using. (Twisted is becoming more of an essential library then option)

Updated : Incorrect, the Wing IDE source browser could show the base class methods even though the autocomplete does not provide much help. Definitely a good enuf reference to program productively in Python . Only on Wing IDE PRO. If you buy Wing IDE personal, too bad life goes on..

Ultimately the IDE makes a big difference in your productivity. Python is a very productive code however without an equivalent productive IDE, Windows Programmers will find VS offering an irreplaceable IDE to work with.

However, having said that, if you are into PHP and ruby as well, then there probably is no better ide than Komodo for "multi-open-source" language editor (apart from Eclipse which you need to download the plugins ). As for Wing IDE, it is still one of the best Python editor around, so if you are into serious Python (which i do hope to see more Windows commercial project on this), then its an excellent choice.