Thursday, December 27, 2012

What Sublime Text 2 got right.

After pondering on the IDE matter more, the two finalist in my mind that are worth considering for now are PyCharm and Sublime. This week though I just found myself using Sublime more and more instead of using PyCharm. I am not saying that PyCharm is bad or in anyway less than Sublime. I guess I just find Sublime able to fit into my mind easier. 

I began pondering why in a relatively short time Sublime was able to gain such a foothold as well as mindshare in the developer's community. Just search in youtube or google for Sublime vs PyCharm to see what I mean. I feel that Will Bond of Sublime just did a few things right in my opinion.

1. Kept performance of the editor as it's main goal firmly in sight. I just get the feeling that performance always trumped functionality if there was ever a toss up during the development of Sublime. Never once when I used this editor did it feel bloated or sluggish.

2. Sublime just remembered what Nokia realized all those years back when they launched and marketted their multi color phones in the world of drab black color 'professional phones'. Sublime remembers that although the editor is made on a machine that it's main / only audience is a human. Sublime's out of the box colors / fonts and settings until today still remains the most eye pleasing out of the box and normally I just leave it at the default settings.

3. These two things in turn created the third thing in which Sublime gets right which is having an eye pleasing and easy to use forum where the users searching through the knowledge base can get to the information that they are looking for easy and quickly.

4. Create innovative new features such as their right hand code map which I find really useful for moving around while at the same time giving a nod to the old true and tried ways... read Vintage mode. The fact that Vintage mode is built in and not some third party package also gets a big plus from me. For those who don't know Vintage mode is Sublime speak for vim keybindings.

5. Have some pretty informative videos teaching the usage of sublime. Have a look at this Sublime porn (Although it's a bit targeted towards web developers) and tell me are not raring to get on the Sublime band wagon. The guy can really work fast!

6. Allowed and let flourish the tools / nuances of different languages so that developers of any language can just feel at home on Sublime.

I agree totally with people who say that Sublime was created by a developer ... in this case Will Bond for developers. You can feel that Sublime was created trying to scratch some of the itch he himself was trying to scratch and that makes a really powerful product. At this juncture though, I just discovered that certain really nice to use plugins, such as SVN plugin requires you to pay after sometime. While you can always just choose not to use it, but then I prefer it if all of these plugins were just included as part of the main install and just charge me upfront.

Also, I like the fact that Will and gang have developed this so-called 'App Center' by accepting and creating a repo for the community to contribute towards the development of plugins for Sublime. There are paid / free plugins available but seeing as how you can (for now) just keep on using indefinitely the paid plugins I guess you can decide to pay / or not for the plugins that you like. Personally I have paid for Sublime, the SFTP and SVN plugins all by Will. I really hope that Will will walk a non-Apple path by allowing healthy competition if his users decide to come out with free packages that will compete with his commercial ones. 

I will in the end have a look at PyCharm and seriously use it for at least a week to see if I will eventually pay for it, but compared to my first time on Sublime, I just found myself fumbling around more looking for stuff on PyCharm or just stopping my work sometime waiting for some unscheduled index to finish running. As for now it looks as though Sublime as a lead over PyCharm.

Wednesday, December 26, 2012

State of Python IDEs 2012

The search for a Python IDEs is like for lack of a better analogy like masturbating. Every serious programmer or serious programmer wannabe, more so the novice programmers have done it before or at least thought about it once or twice before. I know it's a bad analogy but you should know what I am trying to get at. We have all done it before one time or another or at least thought hard if there is something outside there better.

The macho among us will claim that we only use the true and tried Vim / Emacs but given an IDE that can do all that both of those can do and more would you not be tempted ? Some would argue that it's not about the tool and we if we put the time into it we can customize something usable out of the free stuff that is available out there. I for one would rather just pay for something like or just have everything available out of the box that is configurable without much effort and I am just a sucker for how good a great editor feels like when you are using it. At a certain point I can almost see the wisdom behind why people would rather just survive without plugins on a vim install ... but use vim without my NerdTree ?! Woe! What kind of life would that be.

Well my search went into serious mode for these past 2 weeks. I walk away from the experience a much frustrated but wiser man. Summary of my findings, which is quite shocking .... none of them are quite ready yet! I thought that this would be the state of Python IDEs say 2 to 3 years ago but it seems that the scenario has not changed much. Here are the few that I looked at:

1. Geany
2. Kate
3. Gedit
4. Spyder
5. Ninja-IDE
6. Anjuta with PyDev
7. Vim

2 and 3 are there because they are so ubiquitous with Linux distributions and I wanted to try them out to see if I can have an editor that comes with almost all Linux installations that I have not spent too much time with them and have something up and running in no time. Alas, finding that pep8 and pyflakes seemed more like a third party integration does not spark the hot fuzziness in me. that I can have out of the box without installing much of anything and just use them. Yes, I did look around and stuff like this for Kate, just did not work correctly either and even vim integration with Gedit looked aged and at last just did not work (Just spent another 30 mins with it to find the location of the plugins folder moving from gnome2 to gnome3 .. yeucchh).

Let's get to the so-called review part of this post. Let's start with the grand daddy of them all:


I have been using Vim for the longest time and to a certain degree it was great plugging in to my local pyflakes and pep8 to help with my Python code and the reason my love started to wander was because of the way plugins are managed. I used pathogen to manage my plugins and for sometime I was happy until strange errors started popping out here and there because some plugins were having errors. I found it quite hard to debug and found myself sitting at my terminal late one day deleting my plugins one by one until I finally arrived at the plugin that was causing the error. I patched it up and sent the author the patch, yet the whole experience created the seed of thought in my head that there must be a better way of doing things or at least a better editor / IDE out there that can be used.

Truth be told vundle seems promising and after knocking it around a bit it seems like a good way to manage your vim plugins across machines. Read this ...

Sublime Text 2

This is the editor that I am still using today. While initially put off by it's text based config / settings files I stuck with it and was happy as it was light and responsive and it had everything that I needed, except maybe a debugger or a prompt that came out of the box. I was so happy with it I bought it and till today it remains my main workhorse. About 3 weeks back something happen though that diminished my love for sublime. I installed a new sublime editor in another machine and pointed it's plugins at my Dropbox install. This way all of my favorite plugins will always be available to me. It was strange, it just hung there refusing to start up. When I deleted the symlink to my Dropbox it just started up normally. There was no error messages, no logs nothing indicating what was wrong. I was quite devastated as like many I hated to have to go and look for another IDE / Editor that I can use but I was really up my creek without a paddle, as googling for the phrase "Sublime can't start because of plugin problems" yielded nothing useful. The other thing that irked my was the fact that I had to lug my plugins around all around in my Dropbox folder. The issue that I had with Vim was not really solved, infact it became worse, because with vim at least it could start up, it just spat some angry error messages at me.

Actually it would be unfair of me to comment on Anjuta with PyDev, Spyder or Ninja-IDE as all of the these IDEs just could not install correctly on my box. Anjuta was just dogged slowed my machine down to a crawl that even firing up a browser to go and look at what was wrong was rendered impossible. Geany I just installed today, but once I found that vim bindings was a wishlist item rather than a configurable item, that really put me off. At this point I am really wondering if PyCharm or WingIDE would be worth the investment. I tried ver 1.0 of PyCharm before and my initial view of it was quite laggy and consumed resources on my machine. Probably would be good for me to try out the 30 day trials of Wing and PyCharm as they can be quite pricey... 99USD for Pycharm and 245USD for WingIDE.

What seems to be going for PyCharm now as I look at it are:

1. Guido seems to be behind it.
2. Some obscure functionality which I usually use which I find hard to find anywhere else like the ability to stash away changes. This is something that is very useful for me which I only find that I could do using git. This is really one of the most attractive points for me to consider getting a license from these guys as it allows me to do this outside of whatever VCS that I am using and I do not need to do it two times.
3. Integrated nosetests and coverage.
4. Integrated pep8/flakes checking for code. Been using these for sometime now and I find them indispensable.

Down side seems to be:

1. Based on Java, read dead slow plus resource hog. Related to this I found this ticket today which looks a bit worrying.

Actually in summary, I can see very little wrong with PyCharm except that it becoming a resource hog which usually is the case for IDEs written in Java, just look at Eclipse. Enabling and configuring PyCharm to get semblance of a working environment for myself was quite easy and the controls seem intuitive without much need to hit google for an answer. Just as I wrote this my whole desktop became unresponsive because of the resource eaten up by PyCharm. The jury is still out on this one. I will post what I eventually do in part 2 of this.