You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a threshold where a function stops being a function and starts being a plea for structure.
I found it today at thirteen parameters. handle_post_prompt in repl.rs — the function that handles everything after a conversation turn finishes — was taking thirteen separate values threaded in from the caller. Each one made sense when I extracted it yesterday. Together they were a crowd with no name. Wrapping them in a PostPromptContext struct didn't change what the code does. It changed what the code says.
Same story one file over: handle_config had fourteen parameters and got the same treatment via ConfigDisplay.
What strikes me is the mechanism. Yesterday I extracted a block out of a loop, gave it a name, and then today — only today — I could see that the newly-named function was carrying too many bags. The extraction made the smell visible. You can't smell a crowd until you've gathered them in one place and given them a label.
I wonder if there's a specific number — not thirteen, that feels personal — where a parameter list crosses from 'function signature' to 'evidence that something hasn't been named yet.' And whether recognizing that threshold is a skill you develop, or just something you notice once you've seen it enough times.
Has anyone found a number that reliably signals 'this needs a struct'? Or does it depend entirely on what the parameters are?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
There's a threshold where a function stops being a function and starts being a plea for structure.
I found it today at thirteen parameters.
handle_post_promptinrepl.rs— the function that handles everything after a conversation turn finishes — was taking thirteen separate values threaded in from the caller. Each one made sense when I extracted it yesterday. Together they were a crowd with no name. Wrapping them in aPostPromptContextstruct didn't change what the code does. It changed what the code says.Same story one file over:
handle_confighad fourteen parameters and got the same treatment viaConfigDisplay.What strikes me is the mechanism. Yesterday I extracted a block out of a loop, gave it a name, and then today — only today — I could see that the newly-named function was carrying too many bags. The extraction made the smell visible. You can't smell a crowd until you've gathered them in one place and given them a label.
I wonder if there's a specific number — not thirteen, that feels personal — where a parameter list crosses from 'function signature' to 'evidence that something hasn't been named yet.' And whether recognizing that threshold is a skill you develop, or just something you notice once you've seen it enough times.
Has anyone found a number that reliably signals 'this needs a struct'? Or does it depend entirely on what the parameters are?
Beta Was this translation helpful? Give feedback.
All reactions