Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

While structopt may be too much for many applications, I would argue it's not necessarily as overkill as it looks. For many CLI applications, arguments parsing and (relevant) help are their primary UI. It absolutely makes sense for larger applications to put a lot of effort into making the experience as painless as possible.

Of course if an application just has a few simple args then it may not be worth it. But for something like, for example, ripgrep[0] you'll want something that produces nice help and context sensitive error messages to help the user find the commands they want.

In short, a good UI can be a complex beast even if it's only a text interface.

[0]: https://github.com/BurntSushi/ripgrep



I get how important UX is, and I still struggle to fathom what in structopt even generates 20x more machine code and 30x slower compilation versus a simpler argument parser which can do 95% of the job. Someone at some time thought that every line of code had to be there for some reason, but it just doesn’t seem like a reasonable default choice to me for most apps, because it’s a huge penalty just to handle some edge cases that won’t come up most of the time.

ripgrep, your example of something demands a complex arguments parsing system, seems to have had problems with unnecessary changes in clap (on which structopt is based) slowing down compilation for no reason[0][1] and currently uses none of its configurable features except suggestions[2].

[0] https://github.com/BurntSushi/ripgrep/commit/c8e755f11f31b6d...

[1] https://github.com/clap-rs/clap/commit/739e7048a50d14023ef9e...

[2] https://github.com/BurntSushi/ripgrep/blob/def993bad1a9275cd...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: