3 ms·
Better yet, don't offer a CLI as the primary interface; provide a reasonable library to use instead.
by JoshTriplett 10y ago
Better yet, don't offer a CLI as the primary interface; provide a reasonable library to use instead.
- notheguyouthink 10y agoThough, that only works for the language that you use. Other languages may opt to use the CLI as the API
- raverbashing 10y agoThinking a bit about this problem, I'm a bit torn In one side, a CLI offers a "better" way of using the product (as with a library it's easier to misuse something) On another, issues like this (But I guess in this specific case the issue is that encfs is not doing a minimal validity check of the password being provided) It would be good if CLIs would/could be more consistent, but in the Unix/Gnu options world, probably it won't
- JoshTriplett 10y ago> In one side, a CLI offers a "better" way of using the product (as with a library it's easier to misuse something) A CLI provides a better interactive interface, but a terrible programmatic interface.
- raverbashing 10y agoYes, it is awful in the programmatic sense, I don't want to assemble command lines by hand or parse error messages It is nice in the conceptual sense, because it usually fits the common use cases
- zimbatm 10y agoA CLI is usable by any language that can fork/exec and read/write IO. A library is more likely to be usable by only one language.
- JoshTriplett 10y agoA C library, or a library with a C interface, is usable by any language with an FFI.
- 3pt14159 10y agoThat's true in theory, but in practice most Ruby developers don't know how to use C or the FFI well enough to build a library out of a C or C++ library. It's reasonable to shell out sometimes. It's what Github did when they were first starting. It's what 500px did when they were first starting. Trying to do everything the right way early on is just going to slow you down.
- deong 10y agoI think with security-related software in particular, the proper answer there is "tough". If you can't figure out how to call a C function, you should probably just not write critical software.
- marcoperaza 10y agoOne of the important lessons that the profession has yet to fully internalize is that there is very little software that is NOT security-related.
- Kalium 10y agoIt's very, very difficult to get product managers to internalize that there are real security restrictions on how they can enable users to make things pretty. Almost everything is security-related. Almost nobody is willing to work with this.
- zeveb 10y agoOTOH, a C library will almost certainly be unsafe and insecure, while POSIX pipes can be secure.