Comment

Comment by ceceron

I share @ezekiel68 feeling. Your solution to replace CLI parameters with code is a terrible idea...

1) CLI support is an additional logic in your program that makes no real work

CLI is a user interface, it does real work as giving user way to interact with your program. It's an interface.

2) Error (exception) handling with CLI is very poor. Another layer of (bad faulty) code is required to make it possible.

Like with any other code. That's why you should to test it (like any other code).

3) Scaling/extending is not as easy compared to programming language APIs (see example in the end)

It's much easier. At least to my wife, who isn't programmer, but can use shell.

4) CLIs are detached from essential code, which in most cases is disadvantage.

What cases?

5) Forcing users to use CLI means: stay away from my code, you’d better not work with it.

Why having CLI would have to force the user to not use the library (if it is intended to be a library, not a stupid tool)

To sum up:

API != User Interface. API = Programming Interface.

Two different goals, two different sets of requirements. You can't just reduce one to another.

parent ceceron 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton