Refactor Reorder Parameters[CategoryRefactoring/RefactoringLanguage]
If you find 'f(a,c,b)' inconvenient, change it to 'f(a,b,c)' -- along with reversing the last two parameters of all calls.
Why would you want to do this?
From "The little book of basic style: How to write a program you can read." by John M. Nevison, 1978 AddisonWesley ISBN 0201052474
JohnCarter posted on the Yahoo Refactoring list:
A typical progression might be...
A::f( Thing t, Thong tt, That ttt) A::g( Thong tt, That ttt) B::h( Thong tt, That ttt, Thing t) C::i( That ttt, Thong tt)refactored to....
A::f( Thing t, Thong tt, That ttt) A::g( Thong tt, That ttt) B::h( Thing t, Thong tt, That ttt) C::i( Thong tt, That ttt)Then considering for a while all the recurrences of Thing, Thong, That and consider making a
class ThongThing? : public Thong { Thing t; That tt; } A::f( const ThongThing?& t) A::g( const ThongThing?& t)and perhaps...
ThongThing?::h( const B& b)and
C::i( ThongThing?& t)
EditText of this page
(last edited November 11, 2001)
or FindPage with title or text search