According to Is it OK to split long functions and methods into smaller ones even though they won't be called by anything else?, I should split long functions into smaller functions even if they are used once only, but my question is , how should I name extracted functions? For example, I have code like that:
var changeProfilePic=function(){
//upload image to server, get response "response1"
//submit upload result to another server
}
how should I name the extracted functions? Should I name it as number:
var changeProfilePic=function(){
changeProfilePic1();
changeProfilePic2();
}
changeProfilePic1(){
//upload image to server, get response
}
changeProfilePic2(){
//submit upload result to another server
}
or name it relate to the task:
var changeProfilePic=function(){
uploadImage();
submitUploadResult();
}
uploadImage(){
//upload image to server, get response "response1"
}
submitUploadResult(){
//submit upload result to another server
}
?