Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making n4::ui::apply_cli_{early,late} implicit #159

Open
jacg opened this issue Oct 20, 2023 · 2 comments
Open

Consider making n4::ui::apply_cli_{early,late} implicit #159

jacg opened this issue Oct 20, 2023 · 2 comments

Comments

@jacg
Copy link
Owner

jacg commented Oct 20, 2023

Requiring the user to write them explicitly only provides some extra hoops to jump through and gives the opportunity to make a mistake.

The only reason for having them explicit is to allow injection of apply_command and apply_{early_late}_macro both before and after the CLI args. Is this genuinely useful? Is it worth the extra complexity for the client?

@jacg jacg added this to nain4 Oct 20, 2023
@github-project-automation github-project-automation bot moved this to Triage in nain4 Oct 20, 2023
@jacg jacg moved this from Triage to Eventually in nain4 Oct 20, 2023
@gonzaponte
Copy link
Collaborator

The other point was that it would help the user understand exactly when each command/macro is executed. If we ignore apply_command, this can probably be described thoroughly in the documentation and might be enough.

apply_command is a general utility that provides a lot of flexibility, but

  • it probably has very little use in realistic cases
  • goes against the philosophy of macros. Macros allow you to turn knobs and switches without recompilation. Using apply_command requires recompilation.

There might be some cases that I'm not considering where apply_command might be useful, but I think those can always be solved by using macros.

@jacg
Copy link
Owner Author

jacg commented Nov 1, 2023

  • goes against the philosophy of macros. Macros allow you to turn knobs and switches without recompilation. Using apply_command requires recompilation.

I see the point of apply_command as hard-wiring something that is more easily done with macro commands than with C++ source code. In that way, you are not re-compiling any more often than you would be when changing any other behaviour defined in the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Eventually
Development

No branches or pull requests

2 participants