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?

Why Linux?


In one of my first posts, I ranted about how Windows is buggy, unstable, and hard to maintain. There has to be something better out there for those of us who don’t have Apple hardware and yearn to be free from expensive proprietary software and operating systems.

A solution exists. It’s called Linux. Yes, it’s derived from the Unix operating system, and that legacy is still there for you to play with, if you want. But most people today would be horrified by the terse (albeit powerful) Unix command set and the tools used with it back in the bad old days. DOS copied many of the commands and structures, and most people don’t realize that the present Apple operating system has deep roots in a Unix derivative.

Linux gets its name from Linus Torvalds, who as a college student, wrote a non-commercial alternative of a Unix derivative. Since then, it’s become an Open Source world wide phenomena with programmers from all over the world contributing toward its future.

It is constantly updated and renewed, becoming more powerful, stable, and easier to use. It’s broken out of the nerd elite and they’re coming after you, the average user by making the experience more like that of Windows, without all the bugs, high prices, and frustrations.

Have old hardware that can’t run the latest software? How about a new operating system that’s only 50MB and runs completely in RAM on an old machine without much memory? Or one that can boot and run from a USB stick or a CD without altering the machine it’s running on? Or one that can be run or installed from within Windows, or booted as a choice alongside Windows, if you can’t yet bear to do completely without Microsoft. Or, gasp, can run Windows from within Linux simultaneously. How about more bells, whistles, and eye candy than Windows could ever dream of. Something more “Mac like”, perhaps. Stable as a rock and just keeps working. How about something which can live along side Windows, read and write its files, and can rescue those files when Windows crashes, all without having to be installed itself.

Want choice? That super small efficient version that flies on old hardware, or a version which takes advantage of all the CPU cores, memory, and fancy video hardware, packed with a huge suite of applications ready to run? Linux is all about choice. Small/efficient like DSL (Damn Small Linux) or cute as a Puppy (Linux). Commercial support on big servers or across the Enterprise (Red Hat). Or a refuge for the average Windows user on recent hardware (Ubuntu). Choose your size and look and feel, all with a familiar core that constantly improves and scales up and down to all the variants. Try it with no obligation by just booting from CD. Try one, try another. Freedom that’s free.

You won’t miss defragging (you won’t be fragmenting), worrying about viruses and spyware (they can’t get a foothold), fixing broken registries (there isn’t one), and keeping up with updates (you’ll be notified and the operating system and applications can be updated together easily at one time, most of the time, without rebooting). Many of the applications are also trying to win you over also. Substitutable for and compatible with Microsoft Office applications, and substitutes for or better than substitutes for other common expensive software applications. For free!

OK, it’s still a bit techy, and sometimes you still have to roll up your sleeves and get under the hood a bit on some of the more challenging applications, but it beats keeping buggy Windows stuff going that you paid good money for.

More along the way.

Newsreaders (RSS) and FeedDemon

A newsreader is a program which allows you to read and organize “feeds” from news sources, magazines, blogs and other sources, including podcasts and videocasts. Think of it as a headline service, which presents you with just the headlines, or just the headlines and a synopsis of the feed, allowing you to pick and choose which ones you’ll drill into.

You can collect the feeds all at once, or you can simply have the program collect the feeds in the background at predetermined intervals. The program doesn’t download the detailed information unless you request it. The detailed information is usually displayed in a brower window and doesn’t clutter up your hard drive. A good program can keep track of what you’ve seen and what you haven’t, can easily mark all unwanted feeds as read, and can retain only a certain number of items in each folder or can delete all feeds older than a certain date.

I’ve played around with several different newreaders, but by far the best has been feedDemon. It wasn’t free when I started to use it, and even though it is now, it’s been worth every penny I’ve spent on it. Great browser integration, a nice “panic button” for clearing out old items, and very good automatic handling and downloading of podcasts.

It was bought out by NewGator (newsgator.com) and became free software. The best part about the integration with NewsGator is that FeedDemon synchronizes with their web service so you have all your feeds available via the web when you’re away from home, and their service remembers which feeds you’ve read and which you haven’t with the FeedDemon client. And as a bonus, if you have FeedDemon on multiple machines, they stay synchronized so you aren’t presented as unread old feeds you’ve read on your other machines.

Only two things on the wish list to make it perfect. First, make it portable or put out a portable version so we can take it around with us on a USB stick. OK… you can always go to the NewGator web site (free account) to read your feeds, but using the reader is so much nicer. And please either make a Linux version, or make it so it can be run under WINE (to be explained in another post).

FeedDemon is one of my last reasons to still be using Windows. I use Liferea with Linux, but it’s not nearly as slick and the synchronization capability of FeedDemon has no rival. Good stuff.

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.

Broken Windows

I have always been an early adopter. I owned an AIM-65 early 6500 development system, a commodore 64, wrote programs on an Apple II at work, and had the first generation IBM PC on my desk (4 MHz 8088, dual low density floppies, no hard disk). From those prehistoric times to the present, software has always seemed to fall short of the potential of the underlying hardware. Not that the 8086 architecture is the epitome of elegance.

I have suffered through DOS, Windows 3.1, Windows 98, Windows NT, Windows XP, and Windows Vista on the PC, while being exposed to much more stable VMS and Unix operating systems on larger machines. Why, oh why, is Windows still so buggy and unstable? Vista is a step backwards, so I keep XP chugging along on most of my machines at work and at home. Even so, it seems I can't go too many years without having to reload XP when it gets too gummed up from all the exposure to viruses, spyware, and from all my install/removals of software I evaluate or use.

Reloading, reactivating, and trying to get back to where I was has always been a major pain, but at some point, too much accumulated damage occurs too easily with Windows and it eventually becomes unmaintainable. The average user is clueless and doesn't know how to maintain their machine. Even with obtrusive virus and spyware software, their machines quickly get gummed up beyond repair, and they all too soon either buy a new machine or suffer through major loss on reload because they rarely back their stuff adequately. That is if they even still have half of their original disks for all the accumulated "stuff" on their hard drives.

Apple does a much better job with their operating systems, but I don't like their higher price, proprietary hardware, and their closed system attitude toward development on that platform. Their machines are arguably worth it and I have no problem recommending them to new users.

There has be a better way, and I’ve found some which I’ll report on shortly.

Friday, October 24, 2008

Welcome

I intend this blog to contain my list of favorite things. Over time that may change.