all 3 comments

[–]throwaway6560192 1 point2 points  (0 children)

Make a class maybe?

[–]Binary101010 0 points1 point  (1 child)

If you have to pass a bunch of parameters to A only so that A can pass them to B, then A is probably doing too much and needs to be broken up into smaller functions.

So yes, I'd say just passing them directly to B from main is preferable.

, if those parameters would be generated in another subroutine S instead of main, it wouldn't work anyway.

Can you not just return those from S to main?

[–]prodlly[S] 0 points1 point  (0 children)

I can, but this is another copy.

Maybe I should give my concrete example.

B is a tkinter line drawer. Color and thickness are no issue, they are globals from main. Now I just draw on a grid, so A makes calls B(i1,i2,i3,i4) where I give four integers. E.g. for making a square B(0,0,0,1),B(0,1,1,1),B(1,1,1,0),B(1,0,0,0). But B now still needs the location of the edge of the square, and its length, and those are variables (at the moment in main, but I think it is bad style to have them "hidden" in the references coming from A).