|Rants||By Shamus||Aug 8, 2006||6 comments|
A coding rant follows. It’s not for everyone. Or anyone. I’m just venting.
I need a library to compress zip files. (By library I mean a .lib or .dll, I didn’t need a PROGRAM to zip files. I’m writing the program, and zipping files is a very small but very crucial aspect of what this program needs to do.) I need it quick. Money no object. (I’m not the one paying for it.) A quick Google search reveals that there are many, many out there. What hampers my search the most is that nearly all of them are documented by absolute stooges. To wit: When you write an example program demonstrating how to do such-and-such, you make that example as clean, uncluttered, as simple, and as short as possible. You do not make a production-grade program with dialog boxes and some convoluted MFC interface, a splash screen, an about box, or anything else that is not directly related to the task at hand.
I see this all the time and I can’t imagine what sort of imbecile would go to so much trouble to make something so useless. Several of the “example” programs I reviewed were many pages of C++ code, usually spread out over several modules and employing various elaborate class interfaces, and somewhere in what soup were the half-dozen lines of code that interested me and would show me what I needed to know.
Imagine if you had a tutorial for how to hammer a nail:
- Lengthy description of how to obtain the blueprint for a house
- Directions for how to select and prepare the building site.
- Long list of the tools needed. Somewhere in this list is buried the information about the hammer and how to use it.
- List of building materials. Somewhere in this list is a description of nails and how to hold them.
- Assemby instructions. Somewhere in here you might find instructions on how to arrange the two pieces of wood you’ll be nailing together.
- Instructions for adding a roof.
All of this comes in a hundred-page bound volume titled, “How to Drive Nails”.
This is one of the reasons I never bothered to learn DirectX. There was never a lesson on how to hook up with DirectX, start rendering, make ONE polygon, and then close DirectX. No, the tutorials were bloated, messy, and so confusingly written that I couldn’t tell which parts were DirectX calls and which were parts of the tutorial. Layers and layers of obfuscation were built up around function calls with confusingly similar (and painfully LONG) names.
Hmmmm. Am I supposed to call:
No, both of those just turn around and call:
Which in turn calls…
But that’s just a container for… Um. Geeze. Forget this. I’m about ten levels deep and suffering from a personal stack overflow. I forget what I was even looking for when I started tracing through this mess.
(On the other hand, if you want to do a little rendering with OpenGL, NeHe is stellar. It starts with simple concepts (how to hammer a nail) and adds things one tutorial at a time, until you have everything you need to build a house. The tutorials are simple, as short as possible, and many are even cross-platform.)
So what happened with the zip library? I found one with a simple tutorial. The entire program would fit on one side of a single piece of paper. They also had the fastest, smallest external library out of all that I reviewed. I am of the opinion that all of these advantages are related. (The coders knew what they were doing.) As a bonus, the library as was also the cheapest. Amazing.