Hi guys,

I was wondering about this and thought I'd ask this here.

Personally I find that code readability is really important, if not the most important part of software development.

So given the following examples, which one do you think is more readable?

Code:
// example 1 (return result)
public function doSomething1(String someString):String{
 /* some manipulation on someString */
 return someString;
}
public function doSomething2(String someString):String{
 /* some manipulation on someString */
 return someString;
}


//example 2 (ByRef)
public function doEverything(String someString1, String someString2):void{
    someString1 = doSomething1(someString1);
    someString2 = doSomething2(someString2);
}
Which function would you call if you needed to apply the actions doSomething1 and doSomething2 to strings? Does it make sense to group the actions into a wrapper which manipulates the strings accordingly? Is there a magic number at which you would start wrapping your functions?
Does the Single-Responsability-Pattern still apply assuming that the actions doSomething1 and doSomething2 are strongly related?


Discuss

Laurent