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."

4 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. 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?_