Q+A

<aside> 🧟 Put your two questions here. Please include your name.

</aside>

In theory, the difference between method-oriented and goal-oriented parameters is clear to me. However, I’m not sure I understand the difference between the two in practice. Could you provide an example? - Unnati

just in case it isn't clear: method-oriented and goal-oriented are my own terms, and not in common use.

I'm not sure that the distinction is really talked about very much in coding style discussion, but I think it is pretty helpful to think about it when designing your functions' interfaces.

(And I think "designing your functions' interfaces" is something many people dramatically underconsider!)

I should try to keep an eye out when i'm coding for real world examples. But here is an example by analogy, that might be a stretch but...

Imagine you are ordering a hamburger at a restraunt. You might be asked "how would you like your burger done?" and your options are "rare", "medium", and "well". 
This is a goal-oriented interface, you are being asked what you want the kitchen to ACHEIVE.

You could be asked "how long do you want your burger on the grill" with the answer in minutes. And maybe also "how hot do you want the grill" with the answer in celsius degrees.

This would be a method-oriented interface. You are being asked what you want the kitchen to DO.

The method-oriented interface requires the user of the function to have an understanding of how the function works. It also demands more thought/effort of the user.

The goal-oriented interface abstracts what the function does much better. You don't need to know that burgers are cooked on a grill at all. You just need to know what you want.

Similar Question here: Looking at the 2 examples you gave, is it always more intuitive to have goal-oriented parameters? What situation might be more suitable to apply method-oriented parameters? - Simone

I think goal-oriented parameters are usually better for the users of the function. 

But method oriented parameters might be better sometimes:
- They provide more direct control to the user, which is good in cases where the user has very specific requirements.
- They are usually less work for the function writer. 

Do you have recommendations on resources to style tweakpane/parameter pane? (If we want it to look different than the default view) - Unnati

This is an annoying non-answer:
Don't style tweakpane. 

The real value of tweakpane is a very quick way to get a rough interface running. Its perfect for times where the interface is not the point, and spending time on it would use time better spent elsewhere. Its especially great when the interface is for your own use.

If you need more control over the interface you'll probably find that styling isn't enough, and you'll need to build a "proper" interface anyway.

How can we use constraint solvers while coding? - Paridhi

Does this mean:

How can we use contraint solving as part of our project?
I don't have an answer for this. You could search for a library, i found this one: <https://github.com/njoubert/csp.js>
But probably working a constraint solver into a project is non-trivial.

or

How can we use constraint solvers as a tool to help us code?
I don't have an answer for this either, but this is a great design prompt.

Which method is more efficient in terms of building an interactive pane for adjusting many different parameters, the p5 DOM functions or the tweakpane library? - Paridhi

tweak pane would be much faster, less code, and better separated from your sketch code.
p5 DOM would make sense if the interface was more integral to your project, and you needed finer control.

I found debugging GUIs sometimes can be tricky. For example, dat.gui.js doesn’t work for me sometimes. How can we find up-to-date debug GUIs normally? -Simone

I don't fully understand this question. It might help to talk through this so i can get a better sense of it.

Can you provide an example or two of how we might show users the end results of their choices through feedback? What might this look like? - Ariel

Best case, your sketch renders quickly enough that you just let the user tweak a param and show the result.

If your sketch takes a long time though, you might do something like a "low res" render as feedback.

I've been playing with the Stable Diffusion text-to-image ML model. It takes a while to render things, and it just shows a progress bar. Thats not great feedback, but its better than literally nothing.

Is there any benefit to manually creating interface controls over just using the Tweakpane library? It seems like using Tweakpane would be much faster - Ariel

If you want the controls for your own use, and Tweakpane does what you need, I'd say use Tweakpane.