On C++ programming IDEs

I've been doing a bit of programming work under Linux for the last few days, and I'm very disappointed with the selection of integrated development environments on offer. Read on for my complaints.

First though, a bit of history. I usually write code under Windows for my job. I use Microsoft's visual studio 6. For those of you who haven't tried it, compiling code with the VS6 C++ compiler is a bit like pulling teeth. For example, Microsoft thinks that the following is perfectly valid code:

for (int i = 0; i < 10; i++);
printf("After loop, i = %d", i);


However, The scope of the variable "i" is limited to the contents of the for loop (in this case it's en empty loop), and so shouldn't be available to the printf line. This becomes even more painful when you want multiple for loops within a function, and you want to be able to use the "i" variable for each loop. Under windows, you can do this:


for (int i = 0; i < 10; i++)
{
// do something
}


for (i = 0; i < 10; i++)
{
// do something else
}


Note that I don't need to re-declare "i" in the second loop, since it already exists? If you try and compile this code under a compiler that observes the C++ standard, you'll get compilation errors. So, how do you turn this into cross-compiler code? AFAIK the only way is to use a second variable inside the second for loop, OR to wrap each for loop in it's own additional scope block, like this:


{
for (int i = 0; i < 10; i++)
{
// do something
}
}

{
for (int i = 0; i < 10; i++)
{
// do something else
}
}


However, I digress from the true subject of this post. For all it's compiler digressions, the user interface actually isn't that bad. Sure, the toolbars seem to move to random positions on your screen every time you debug a project. Sure, you can't use it on a second screen because all the tooltips draw themselves on the first screen, and yes, if you want decent code completion you need to use a plugin like visual assist X, and no, there's no code folding either. But apart from all that, the UI is just right. It's not overcomplicated, it's easy to use.... simple!


So, let's look at KDevelop, KDE development environment. I have several problems with it:

  1. Code completion requires the user to jump through waaaay too many hoops. As far as I'm concerned it should be turned on by default, or, if that ruffles too many feathers, have one checkbox to turn it on. I shouldn't have to root around in the KDevelop settings, and project settings, add the library include directories I want to use for the project, exit KDevelop, install ctags, re-load project, tweak settings, and then find that code completion is actually not that brilliant.
  2. The User interface is way too cluttered. Many of the menus are so full of entries that they cascade off the bottom of my screen. There are so many toolbars and sidebars that I can barely see my work. Many of the sidebars don't even work properly! The documentation sidebar seems particularly useless. I could probably find out what I have to do to get it going, but my point is that it should work out of the box! When I fire up KDevelop, I want to write some code, not mess about with the environment.
The best development environment should be completely transparent to the programmer. OK, so none of the IDEs I've used to date achieve this, but a man can dream, right?


In the mean time, I'm going back to my old IDE: Kate, with the scons build system, activated from the console, and gdb as a debugger. What more could you want?

Maintaining Binary Compatability

It seems to be common practice for software development companies to patch individual parts of a released product. Usually this means distributing a second installer that creates new shared object (.so or .dll) files, so the next time the application in question runs it loads the new object files, and thus runs the new code.

In practice this is a great idea - it means that companies don't need to re-release and re-ship the entire product. Unfortunately, it's not always that easy. The biggest problem is that the new libraries must be binary compatible with the old ones. Essentially this means making sure that all objects within the library are the same size as they were, and that things like vtables haven't changed.

For a while now I've been looking around for a definitive list of guidelines to help me maintain binary compatible libraries. I finally found it on the KDE website.

Behold: Binary Compatible Issues with C++

Anyway, I thought that might be useful to some of you. Enjoy!

New Tools!

I've started to use scribefire to publish posts on this blog. The built-in blogspot editor was just too clunky. Ideally I'd like to use a separate KDE application, but the ones available simply aren't good enough for me to use yet.

Speaking of KDE, I'm currently downloading the KDE sources from subversion - I'll see what small contributions I can make.

Finally - I know this is old news, but if you haven't already, head over to the GIMP website, and check out gimp 2.4. It's been a long time coming, but it was worth the wait. The new version contains (amongst other things) a whole raft of bug fixes, improved icons, scalable brushes, and (my personal favorite) a new and improved selection tool!

post-vacation blues.

Well, I'm back from my holiday, with a slight tan and some great photos. Works has been busier than usual, so I'm struggling to find spare time to domuch at all.

My next hobby project will be to build my own ADSL / Ethernet / Wireless router box. I'm planning on using a Soekris net 4501 motherboard running a cut down version of Debian Linux. I'll update the blog when I get the parts, and I plan on writing a short HOWTO document which will include selecting the hardware, putting it all together, and the software as well.

I've added a selecton of photos from New Zealand to the main page - these haven't been edited in any way - yes, the country really does look like that!


Until next time!

Holidays and Higher Standards

In the last few weeks, Jeff Atwood has posted a few articles about common problems in code. The one that grabbed my attention was about ASCII vs. Alphabetical sorting. I couldn't agreee more with the post. However, I think it's slightly unfair that the programmer cops the flack for these issues.

I know, that sounds odd. We write the code, why shouldn't we be responsible for it? Personally, I think that a lot of poor quality code is written in places where there is no higher standard. Managers accept code that achieves 90% of the initial specification, and thus bad code is born.

Programmers need to have a bit more pride in their work! Why can't we peer review other's code, even if it's not in a formal manner. What's wrong with striving to better your coding skills? Employers can help too - find the programmers who are serious about their work and offer to send them on a usability course. You will be rewarded with cleaner user interfaces, and happier programmers. Promote programmers who write good code - let THEM shape the programming culture in your business, not the programmers who have been there the longest.

On that note, I leave you, dear reader. I'm on holiday for three weeks in New Zealand. I'll try and take some photos and upload them when I get a chance.


Till we meet again!

General update

After spending four days in France, I have a newfound respect for anyone who lives or works in a country where their language is not spoken. The French are certainly not the most forgiving when it comes to people who don't speak their language.


In other news, I'm starting a new project to build a better build script for my work's source tree. It's kind of like scons, but much much simpler. Should be interesting to see what it's like when it's finished.

I'm still thinking about ideaforge... I really think it needs to be done. I wonder who can provide some insight on the issue...

Turning ideas into applications

If you're anything like me you'll frequently come up with ideas for neat applications. For me, turning those ideas into code is the challenge. It's not that I'm incapable of writing code - I have more than enough experience to write simple applications. The problem is that I lack the enthusiasm and energy to complete my projects.

Looking back over the projects I have completed, I notice a pattern. In order for me to complete a project, one of two criteria must be present:

  • I need to be paid. Money is a great incentive. Think this is shalow? you're probably right.
  • I need to be working with other, like minded individuals. There's nothing more rewarding than working with a bunch of intelligent people who are as excited about the product as I am.
For commercial projects, the former requirement is enough to get me to do my work. For open source projects however that is a luxury don't have.

So, getting back to the original problem - how do I turn a half baked idea for an application into an open source project with 2+ developers? Traditionally the process has been something like this:

  1. Have brilliant mind-blowing Earth-shattering revolutionary idea.
  2. Start writing code.
  3. When code gets slightly usable, create a sourceforge project and advertise project page like crazy.
  4. Hope that some like minded developer notices it and wants to join in.

There are several problems with this approach. First, sourceforge is littered with projects that have 0% activity. These ghost projects have long since been abandoned by all the developers (I swear they're not all mine!).
Second, you only have a chance of attracting new developers to your project after you've written a good chunk of the code. This forces new developers to learn the code that has already been written, and prevents them from offering any input as to programming style, programming language, libraries, code organization, feature list development strategies etc. etc. Personally, I think that one of the best parts of working on an open source project is having the opportunity to makes these kinds of decisions.

It seems to me that what we need is an ideas forge. Imagine a place like sourceforge, but for ideas. There would be facilities for advertising ideas, giving feedback on existing ideas, hosting design documents, holding discussions etc.

Unfortunately, ideaforge is an... idea.. Now all I need are some talented programmers to help me create it....