Tuesday, 19 April 2011

VIM vs EMACS - again

«Two snakes facing each other!»

Looking to my blog statistics, I realized visitors come here mostly because they're looking to "vim vs emacs". It's comprensible: this is one of most (in)famouse computer "wars".
In last months I used a lot VIM, because I had some problems with Aquamacs Emacs. So, I decided to write another post to these two max-weight editors, maybe helping you to choose.


I became an Emacs fan since 1999, when I first heard about "a free, open source, configurable, programmable editor". I gave Emacs many tries, just because it was Emacs. But, let's admit it, it hasn't a quiete learning curve. Emacs has more options and controls than an SR-71 and has it's own default settings. This is the "beauty" of Emacs: to discover that a simple function (one-tab if I type tab key, e.g.) needs to be configurated.


Usually, everybody tries VIM after some frustration with Emacs and find a bit confortable with it. Editing file in a modal program is a bit weird, but become quite fast. You can have problems with some "complex" tasks, such as search-and-replace. To do this in VIM you have to type

:s^$/text to find/text to replace/gc

where, last 'c' stands for "confirm".


When I have to write an iPhone App, I must use XCode. When I'm working on a win32 platform, Notepad++ is the choice. To develop a Java application, I prefer Netbeans (and some friends of mine use it also for PHP development). I admit Emacs or VIM are fundamental to a programmer, but to use them for huge programs could be a delirium. So, as general line-guide I say:

  1. VIM or Emacs are good to write small/medium scripts
  2. For large applications, I'll use a SDK (Netbeans? Eclipse? XCode?)
  3. Emacs with cua-mode is easier than VIM, but you could have troubles with other tasks
  4. Do not be ashamed to use a simpler editor as gEdit, Kate, Bluefish or JEdit. Use what you prefear. A text-editor is just a tool. Real Programmers write programs

And happy programming! :)

Monday, 18 April 2011

Nobody can choose how to trash

Today I read an interesting letter sent from Ted Evans of Techrunch to Steve Jobs. He said

Please give us garbage collection

When you say "garbage collection" you always think to Java, to its slowness and to its inefficency. I think, instead, about days spent to detect a memory-leak error, when I was near to the deploy deadline. Working with iOS is wonderfull, but can also gives you headache if you aren't enough careful. Useless to say, when you have to realize a 4000-rows-of-code in two days, it's hard to be "enough careful"!

Ok, I admit a garbage collector could makes programs slow. But if I could use it when I want and if I could dealloc objects when I want, I could realize a "slow" version in time. Slow as you want, but it will not crash because of memory overflow, segmentation faults, ecc.
In next version, with more time, I could analize the code, optimizing memory use and detecting overflows and errors.
So, yes: I would like a Garbage Collector. But activable only when I want.

Can you recognize the man on the "wanted" poster on this TechRunch article? Well, our prime minister (I am italian) isn't very admired in other countries