Let’s says you want to make a program that takes user input and follows the CRUD structure for some data. This program would be executed from the terminal and wouldn’t be used in any other projects.

If this program was made in a language that supports creating packages for other programs (e.g. Python, Rust, NodeJS), should this program be a ‘package’, or should it be a standalone program that has a simple “setup” script?

Assume this is a CLI/TUI app that runs in a Linux terminal.

EDIT: I’ll provide some more details since it seems I was too vague:

This program would allow the user to create ‘Script’ objects that would be saved to a file on their system. These objects would contain metadata such as a name, the command to run, and a description.

These Script objects would only be used by this program, and by the user. (i.e not a system program)

  • Phoenix3875@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    2 days ago

    It doesn’t matter if it’s truly a one-off.

    However, the conventional wisdom is to split the potentially reusable part as a library package and the executable to be a thin layer on top of that library.

    In this way, for example, testing can just depend on that library. In the future, if there are requests that calls for a separate executable, the library can be reused.

  • talkingpumpkin@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    No idea what you are talking about… did you get an assignment to implement some CLI program and want ideas for what to do?

    If this program was made in a language that supports creating packages for other programs (e.g. Python, Rust, NodeJS), should this program be a ‘package’, or should it be a standalone program that has a simple “setup” script?

    I’d assume what you call “packages for other programs” would be plugins? In that case, unless you have a specific existing program you want to write a plugin for, then yours would be a standalone program.

    About the “setup script”, if you mean that’s an installer of sorts, then no, your program must not necessarily have an installer (you or others may write standalone installers or packages for various package managers, but that’s another story).

  • Gonzako@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    You’ll need to go to some specifics if you want some pointers. Atm, I use Python to bridge a booking program into the financials one through the creation of xml files.

  • Maddier1993@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 day ago

    Does this program need to save the data for the CRUD part?

    If so, it’s best to make it into a standalone program that writes to a DB and maybe also provides APIs to external programs to query the data from the DB.

  • Azzu@leminal.space
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 day ago

    It entirely depends on what you want the user experience to be like, and what ecosystem you choose.

    So, no idea, give exact specifications.