Slashdot Mirror


Don't Overlook Efficient C/C++ Cmd Line Processing

An anonymous reader writes "Command-line processing is historically one of the most ignored areas in software development. Just about any relatively complicated software has dozens of available command-line options. The GNU tool gperf is a "perfect" hash function that, for a given set of user-provided strings, generates C/C++ code for a hash table, a hash function, and a lookup function. This article provides a reference for a good discussion on how to use gperf for effective command-line processing in your C/C++ code."

10 of 219 comments (clear)

  1. Re:C++ I get by V.+Mole · · Score: 5, Funny

    There's this little project of which you may have heard: http://www.kernel.org/

  2. Re:Speed in options parsing? by Anonymous Coward · · Score: 5, Funny

    You're not a real programmer if you won't over optimize unrelevant parts of your code.

  3. Re:Speed in options parsing? by ai3 · · Score: 4, Funny

    You must not have seen the recent proposal for GNU tools options, which will require four dashes instead of two and a minimum of four words per option. Under a UN/EU funded program to ease the transition to intelligent machines, developers are rewarded for implementing full-sentence options and/or prose. But initial experiments showed that many users where unwilling to wait for the parsing of the command "remove-files --recursively-from-root-directory --do-not-ask-for-confirmation-just-delete --i-really-want-this!" just to be 1337, which led to whatever development efforts are mentioned in the article, which I didn't read.

  4. Is this a fucking joke? by pclminion · · Score: 2, Funny

    Where's the Foot icon? Optimizing command line parsing? Oh God, my sides are splitting.

  5. Re:Speed in options parsing? by Anonymous Coward · · Score: 1, Funny
    Yes, this will help maintainability but a consistent and standardized naming convention is helpful too.

    function ifYouThoughtYouWereGoingToEditThisFileUsingATermin alBasedEditorThenYouNeedToThinkAgainOhYeahIIndentU singTabsToo()
    {
    /* */
    }
  6. Re:Speed in options parsing? by Maniac-X · · Score: 4, Funny

    Klingon function calls do not have 'parameters' - they have 'arguments.' AND THEY ALWAYS WIN THEM!

    --
    (A)bort, (R)etry, (I)gnore?_
  7. Re:Speed in options parsing? by smittyoneeach · · Score: 2, Funny

    Writing code--drudge work.
    Writing code that writes code--now we're thinking!

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  8. Re:All the world is not a PC by mikael · · Score: 1, Funny

    I thought that read kibobytes, or maybe even kibblebytes

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  9. Re:Byte counts when compiled with devkitARM by sholden · · Score: 3, Funny

    It's not pushing it all. It's storage, it's network attached, it's in a box... What I am pushing is the poor little linksys device. It's plugged into 4 USB hard drives (plus a thumb drive, but that's just for booting) which it's running software RAID5 on. Poor little thing, if it could scream I'm sure it would be. Sadly it's the only machine with a C++ compiler on it at home these days...

    Please don't tell the poor thing it's running on MIPS, the ARMv5TE kernel might just freak out and collapse the universe.

  10. Re:Speed in options parsing? by muridae · · Score: 2, Funny

    Writing code that writes code--now we're thinking!
    But what could we call this code, a compiler? Nah, I think we need to think of another word for it.