Showing posts with label portable applications. Show all posts
Showing posts with label portable applications. Show all posts

Saturday, October 25, 2008

Code::Blocks and MinGW


As part of my job, I write embedded software and write a lot of simple console applications to process data. I’m not a GUI kind of guy, and tend to stick with simple portable ANSI “C”. Stuff I can port painlessly between a PC, a workstation, and various embedded microprocessors and DSPs. I’m not an object oriented kind of guy, and you might say I have no “class”. I work close to bare metal, and I want to know where every byte is going. “C” being a universal assembly level language is a complement from someone who’s written and still writes a lot of assembly code. As you can guess, I’m not a software engineer.

I’ve been through every combination of Microsoft and Borland compilers, along with dozens of different and funky microprocessor and DSP compilers. And I’ve paid a lot of money for most of them. I used to use command line tools because I had to, but I’ve been spoiled by integrated editors, debuggers, project, and build tools. Yeah, there is free alternatives like GCC for many processors, but I don’t like having to learn the quirks of yet another command line compiler and linker.

How about having it both ways: Free and friendly. I was looking for more portable applications (ones which don’t need to be installed and can be run from a USB stick on the road), and I came across Code::Blocks (codeblocks.org). A nice middle of the road IDE with a decent editor, debugger, and project organization tools. Better yet, downloadable with the MinGW version of GCC already integrated. Or it will recognize and can your off the shelf Microsoft or Boland tools, if you like.

Best yet, the combination of Code::Blocks and MinGW works great from a stick, without installation on a PC. Good compiler/linker warnings, and it seems to output decent code. For the road, I can now carry my source code with me in an encrypted folder, and can modify and rebuild it on any PC, leaving nothing behind on the host.

Cool, eh?

Portable Applications

One of the biggest problems with most software written for the PC is they aren’t designed to be stand alone. They use a tangled web of resources from windows and other programs, and often make complicated registry entries. The registry becomes all too easily corrupted by botched installs or removals, viruses, spyware, and by just plain badly written software. Wrong, missing, corrupted, or incompatible DLLs further complicate the process. Clueless, careless, or simply desperate users often give up and simply erase unused software, leaving a real mess behind. We pay good money for expensive and often obsolete software only to have it become the “living dead” when it’s updated, removed, or whacked by some other badly behaved software.

Solution: Open Source (free) software which doesn’t “install”. Remember when life was simple and all you had to do was to copy the executables and support files to your hard disk, and click on it to use it? No installation and no registry entries to get messed up. It doesn’t depend on anything outside of itself other than basic operating system services, and it won’t get tangled with your other software. If you don’t like what you’ve download, simply erase the whole directory. To update it, simply overwrite the old files with the new ones. And the updates, like the original, don’t cost you a dime. Want to share it with someone else or have it on another machine, simply copy the folder over to the new machine and you’re in business.

Why Open Source? First, it’s written by people who care and aren’t just out there to make a buck, and the code is out there for other people to find the bugs and improve it. It can either be designed to be to be “portable” as described above, or someone might be able to create a “portable” version of it.

And as a bonus, properly written portable software will run fine on any type of portable storage, such as a USB keychain drive, without changing the target machine it’s running on. Pull the stick out when you’re done, and nothing’s changed and no personal files are left behind.

Where to you find these jewels? The best source is portableapps.com. They’ve created portable versions of many different and popular Open Source programs, including heavyweight programs like Firefox, Thunderbird, and the OpenOffice alternative to the expensive and bloated Microsoft Office suite. Look also under “portable application” on Wikipedia for a list of other programs which were designed to be, or simply work, as portable apps.

I’ll report on some of these applications in the future.