Is there a recommended programming style here to prevent the definition of m1 from getting too verbose?
Sort of. The style is called "working in small iterations, doing regular refactorings, ideally supported by unit tests".
Fowler's refactoring catalogue contains some refactorings which can help to reduce the number of parameters, introducing parameter object is one of them. Another technique which is sometimes applicable is to combine functions into a class, so the class provides member attributes which can be accessed from every member function without being explicitly passed around.
Still, from anonymous names like m1
or p1
,p2
, ... it is impossible to say which of those refactorings make most sense for your specific situation (if any), or how to apply them exactly.