tags:

views:

answers:

Even though I have a robust and fast computer (Pentium Dual Core 2.0 with 2Gb RAM), I'm always searching for lightweight software to have on it, so it runs fast even when many apps are up and running simultaneously.

On the last few weeks I've been migrating gradually to Linux and want to install a free lightweight yet useful IDE to program on C++ and PHP. Sintax highlighting and code completition tips are must-haves.

I bounce about between Mac, Windows and Ubuntu and while Emacs used to be my editor of choice, I'm finding that in my old age I prefer to something GUI-based (using command-line for the shell is still fine by me). My preferred editor is Komodo Edit, which the advantages of:

Being free (as in beer)

Available for Mac, Windows and Linux

Syntax highlighting for a boatload of languages, including C++ and PHP (I'm using it for Ruby, Python and PHP myself)

Code completion, even for classes I defined myself

Ability to "remote save" via FTP, SFTP or SCP

Support for organizing your files into projects

Tabs and other interface niceties

I'm not sure how lightweight it is, but it certainly feels snappier than Eclipse!

If you're going for very lightweight and switching to linux, I recommend installing DSL, or Damn Small Linux. It has Vim pre-installed which is an editor I've used for source code editing for quite a while. I'll admit it has a learning curve, but it's worth it as you'll be able to work very quickly.

Vim (or Emacs varying on religion) will always be my first answer to this question, over any point-and-click IDE.
As they write in The Pragmatic Programmer

Choose an editor, know it thoroughly, and use it for all editing tasks. [...] The editor will be an extension of your hand; the keys will sing as they slice their way through text and thought. That's our goal.

Make sure that the editor you choose is available on all platforms you use.

Vim is configurable, extensible, programmable and can be turned into an IDE with all the regular features. Lately I've been using Eclim to "bring Eclipse functionality to the Vim editor" (projects, better java support etc.) making it a complete platform with advanced IDE features.

If you are taking your time switching to linux, I'd switch to emacs or vim at some point as well. There will always be a resource or a document describing exactly the problem you are having with either of them, and generally a solution is just a few more clicks down the road.

Emacs may be easier at the beginning because of modeless editing... but don't let modal editing scare you away from Vim.

The key with either Vim or Emacs is knowing it could probably take you the better part of the day just to figure out what you want them to do, let alone how to get them to do that.

Once they work for you though, you'll see why mostly everyone is in one of two camps.

General hints:

Setting up a Makefile for your project is almost always worth it.

Using cscope and or ctags will make your life easier.

Vim hints:

:make

:cn, :cp

OmniCompletion

using BufRead autoloads to set what :make should do depending on file type

Console editors, such as emacs and vi, are more lightweight than their GUI counterparts, and (at least those two are) just as capable as any other IDE (syntax highlighting, mouse support, ctags, autocompletion ... all the way to gdb integration). The learning curve might be somewhat steep, and you might have to do some customization, but its all worth it. Also, vi is present on every installation of unix-like operating system.

Amongst X applications, there are

gedit which comes with GNOME and has many of these IDE features (see, for example, this blog entry),

Geany - really fast, depends only on GTK, and with even more features including code folding.

This is a really religious question - just choose the one you like. Every editor has it's pros/cons and you need to decide which set suits best to you. There are many IDEs out there that can use various editors like Pida.

Not only is it a fantastic Open Source IDE for C++, but it's fully cross platform, so if you need to work on a Windows or Mac box for a bit, you can use the exact same IDE, and exact same project files to do so! Which is great for cross-compiling!