How do you call the process of taking a part of a function and making an individual function of it?

Posted by bitmask on Programmers See other posts from Programmers or by bitmask
Published on 2012-07-02T19:16:32Z Indexed on 2012/07/02 21:22 UTC
Read the original article Hit count: 225

I know there was a technical term for this. I'm just can't remember what it was.

If the title needs clarification, here is what I mean; If this is the old code:

Result foobar(Param1,Param2,Param3) {
  code that does abc
  code that does xyz
  code that does asdf
  more code that does something
}

and it's changed into:

SomeResult do_xyz(SomeParams) {
  code that does xyz
}
Result foobar() {
  code that does abc
  do_xyz(args);
  code that does asdf
  more code that does something
}

© Programmers or respective owner

Related posts about terminology

Related posts about refactoring