Closed christhekeele closed 1 month ago
I do feel like including a verb in the function name improves the readability (here and in most function names). Kino.nothing()
is a noun because it is returning the special t:Kino.nothing
atom, but once aliased just calling nothing()
tells me nothing about what the function call accomplishes.
I am not sure I like nothing/1 because it gives the impression something is done with the argument.
Perhaps a different verb would make you feel more comfortable with it, say ignore_output/1
?
The issue is that it is inconsistent with everything else. audio
, mermaid
, etc are all outputs, we don't label any of them.
Perhaps a different verb would make you feel more comfortable with it, say ignore_output/1?
Not really, it has no relationship with the input in any case. :)
The issue is that it is inconsistent with everything else. audio, mermaid, etc are all outputs, we don't label any of them.
I see what you mean, they are all nouns too. Despite that, I still like the readable verb form and /1
arity, since the fact that the function does not return something kino-renderable makes it kind of a non-entity in Kino terms (and therefore not a noun). While Kino.render(nothing())
reads nicely, providing the verb context, just nothing()
does not to me.
If you're not sold on verb-name or arity-1, though, I think it's fine to close this PR, as the exact same thing as your proposed alterations can be accomplished with more clarity via import Kino, only: [nothing: 0]
I am ok with adding nothing/0
as a shortcut, as the functions here are only meant to be shortcut, not new functionality. But if you don't see a value in that, we can close this.
As I make more sophisticated Kino UIs:
Kino.Shorts
more to streamline large complicated blocks of Elixir Kino UI codeKino.nothing()
since I've taken control of the rendering processIn the spirit of
Kino.Shorts
reducing the times you have to typeKino
, I thought a shortcut function might make sense. For a use-case extracted from a pattern I've used several times now, see the second example in the function docs.The name I've chosen here (
output_nothing
) is debatable:Kino.nothing()
s at the end of code blocks