Monday, 20 April 2009

In search of the perfect IDE

Today I spent a fair few hours banging my head against a stone wall and seeing little benefit from the experience. It came about because I was fed up with Eclipse and I needed a new IDE.

Over the years I've spent many hours writing software - since this is where I derive my income from, you'd think by now that I'd have the perfect development environment and all would be sweet - if only.

In ancient history, I used a Macintosh and BBEdit. This is back in the days of the early 1990's - and I'm pretty sure that there was a stint of using MPW, the Macintosh Programmers Workbench - and I recall Borland Turbo Pascal before that.

In the "ye-olden days", I used Windows NT and Notepad. It served me well, until I started wanting to open multiple files and doing stupid search and replace things. BBEdit didn't exist for Windows and I found after much hunting Edit Plus II. I must confess that this is the first piece of software that I used for less than 10 minutes and purchased on the spot. It was also one of my first online purchases as I recall.

After much hair pulling I moved away from Windows to Linux - initially Debian, and after several years, Ubuntu.

Edit Plus II didn't manage to come with me, it wasn't for the want of trying either! I tried all manner of things, but it didn't play well any more. I found nedit. It worked well, was *fast*, and stable, launched within seconds and was my all-purpose editor everywhere - then it stopped being maintained and I couldn't compile from source and it died.

I moved over to gedit, which over the years has become slower and slower. It has poor functionality compared to a real editor and most infuriatingly sometimes takes over 2 minutes to launch - not something I enjoy *ever*.

During this time I found out about version control. CVS was installed on my workstation and my productivity sky-rocketed. I found LinCVS which could integrate with nedit and later gedit and had other ways of interacting with my projects which were getting larger and larger.

LinCVS seemed to die a mysterious death - I think it went commercial, but it no longer seemed to work, couldn't do anything other than CVS and was discarded.

After much searching during which time I played with gphpedit - which didn't highlight colours properly and had a non-responsive developer and a stagnant bug list, I bit the bullet and finally installed Eclipse.

Now Eclipse promises to be the garden sink of software development, and after todays experience with Netbeans, I can confirm that there are many things to like about Eclipse. Unfortunately there are more things to dislike.

Eclipse integrates with all manner of tools - this is excellent, but trying to make anything work involves trying to find a place to get support in such a way that the answer is not "dunno" - which seems to be the case for most things I have run into.

Eclipse uses plug-ins that do stuff and it seems to be grouped into projects that provide functionality, but trying to understand what each project does and looking for bug reports is a never ending process. For example, lets say that you want to upload your project to a web-server - something which you'd think was pretty straight forward. Under Eclipse there seems to be no "normal" way to do this. You need to either do it manually yourself, or you need to install a synchronisation framework, then an ftp framework, then you can do it. But not with scp. Then you need to install something called RSE, Remote System Explorer which seems to be built around the notion of remote controlling the server on the other end - and all I wanted to do is upload a file via scp.

I tried getting bzr working with Eclipse, tried to get spell checking working, tried to get the debugger working with PHP, tried to run sites locally without installing a complete LAMP stack locally - something which I'd done in the past, but then involves needing to keep track of local LAMP configuration settings and making your code deal with varying paths, or if not that, then deal with changing dynamic host names to make your local development machine look like the remote host for the purposes of debugging. Of course you could just upload each change across the network - something that Eclipse is happy to do for you, but there is no understanding that you might not have your server on the LAN, and that its somewhere on the Internet.

So with all that frustration, let alone huge memory footprint, poor copy/paste, etc. it was again time to look for a better IDE.

Yesterday I installed Netbeans. I needed to update a website for a client, about 30 odd changes, pretty simple and straight forward. Nice little project to try a new IDE with.

That was a bad idea.

Well, let me put it another way. Netbeans is crap.

I ran the latest PHP version, not even packaged in Ubuntu - which I hate - because it means that as root I need to install something that never cleans up after itself if it gets removed. I installed 6.5.1 from the netbeans site.

If Eclipse is giving me heaps, Netbeans is worse.

No spell checking; double-click means something different depending on where on the file name of a document you click - rename, open, diff; there is no way to open an image editor from with Netbeans, so I need to have the same folder open twice, once in Netbeans, and once on the desktop; right-click on the filename of a list of selected files causes none to be selected; upload can only upload all files, not just the 2 you changed; upload is FTP only; integration with SVN returns all manner of cryptic errors and no indication on how to fix things; importing into SVN didn't work and required me to learn SVN to run the manual commands to make that happen; an ASP file full of HTML is not recognised as containing HTML; the HTML editor does not do smart-tag complete, so starting a <p> only offers you the closing tag, even if the text that you want to enclose is already there - meaning that you need to cut the text, start the <p>, finish the </p>, then paste the text - like I want to do that when I'm converting a wordprocessed document into HTML - yuk!

I'm not impressed with any IDE I've found yet and Netbeans is yet another one to hit onto the slag heap.

Why is it so hard to find an IDE that can do these things:
  • Has a syntax aware editor
  • For HTML and CSS has the ability to switch between Source and Display view
  • Allows me to rename a function and have the rest of the source be updated accordingly
  • Have a spell-checker that understands the difference between a variable name and a string
  • Has integrated version control that speaks to anything I need to
  • Can update via whatever file system/remote access protocol I need
  • Can edit images, databases, PHP, HTML, CSS, perl, C, C++, bash and .htaccess - and has syntax checking for those
  • Runs on a machine with 1.5Gb of RAM without hogging all the RAM
  • Launches within a reasonable time
  • Has the ability to track time while I'm writing software so I can bill the client accordingly
  • Has the ability to quietly do backups in the background so I can get on with writing code
  • Understands regular expressions for both the find and the replace box
  • Can deal with any external linux command I can throw at it
  • Doesn't run under JAVA
You'd think that I wasn't asking that much. I don't need an integrated news reader, or email, or a calendar, or any other crap. I have applications that are perfectly capable of doing that.

I write software. I want to do that without needing to re-invent the wheel every time I need to achieve something. Most of what I write above, I can do from the command line. Yes, I'm capable of runnig vi. Next thing I might go back to running screen on a text-only console, perhaps with green or even amber letters on ablack background.

Seriously, why is this so hard?

Thursday, 16 April 2009

Eclipse bzr integration

There is a plugin for Eclipse called bzr-eclipse, you can install it within Eclipse simply enough, but it also requires that you install a bzr plugin called bzr-xmloutput, which isn't packaged for Ubuntu Intrepid.

I'm not a believer in dropping files across my file system and will try many things before untarring something into my system. Packages are there for a reason, and I'm not about to try and break things by fixing them if you know what I mean.

Fortunately, bzr-xmloutput is packaged for Jaunty, but it requires python-central that is of a later pedigry than the current one in Intrepid.

So, this worked for me:
  1. Download bzr-xmloutput (Jaunty package) and python-central (Jaunty package) from Jaunty.
  2. sudo dpkg -i python-central_0.6.11ubuntu6_all.deb bzr-xmloutput_0.8.3-0ubuntu1_all.deb
If you're doing this, it's likely that the versions here are not the latest, so make sure you check that.

Tuesday, 14 April 2009

CIFS VFS: cifs_mount failed w/return code = -22

Last week I upgraded a Gutsy 7.10 server to Hardy 8.04.

Today I got a report that a mounted drive was missing.

Turns out that the ip=hostname part of an /etc/fstab line works in smbfs, that is, if you've defined the hostname in /etc/hosts, but under cifs, it doesn't work.

In addition, it seems that smbfs uses a fallback when a user authentication fails and falls back to the guest user, but cifs doesn't.

Friday, 3 April 2009

mount: could not find any free loop device

Just tried to mount a bunch of .iso images I'd made from backup cds so I could hunt for a missing photograph without needing to continually swap cds. I ran out of loop devices, that is I got this error:

mount: could not find any free loop device

Here's how I fixed it thanks to this article.

Creating extra loop device entries

Also make sure you have enough devices available. You can
check how many you have by doing:

ls -d /dev/loop*

An easy way to create more, is by doing:

for i in $(seq 0 255); do
mknod -m0660 /dev/loop$i b 7 $i
chown root.disk /dev/loop$i

You can have up to 256 loop devices mounted.

xserver-xorg-video-intel independent destops

I'm running Ubuntu 8.10 - Intrepid Ibex. I moved from Gutsy where I was running the i810 driver which allowed me to have independent desktops so I could have a number of independent workspaces on each of my two monitors.

The i810 driver has been removed and is now considered depreciated.

The intel driver does not support two independent desktops. The XStrikeForce page on RandR states that: "[there are] [n]o more multiple independent desktop[s]". There is a whole discussion about the intel driver and RandR.

Meanwhile, I hit on the idea of opening up a virtual screen on the second monitor.

Using tsclient, I can connect to the localhost using XDMP, and as long as I've allowed local connections and multiple logins, I can connect. However this only works with Xnest, not Xephyr.

I wrote a tiny wrapper script that substitutes the geometry call with screen and it magically works.