Hmm, depends on your language I guess. The point is that if you have a big chunk of code somewhere that's all working on drawing your character on screen, then it's usually best to split that off into a function called "drawCharacter()" or something. Even if you're only using it once and the code itself isn't that big, making functions like that makes it much easier to skim your function. Then you'll usually find some generic parts in the new function that you can reuse somewhere else with some small adjustments, or you still have big chunks that all together do one thing. In the end you're likely to end up with a bunch of low-level functions that can easily be checked for bugs, which are combined in higher-level functions which, if the functions they depend on work, are also easy to skim and debug. You can of course overdo it, and I guess 12 lines is a little low if you're using some lines just to assign some variables (make that 12 lines excluding variable initialization) or if you've got a particularly low-level language (but then again, in such a language, you can gain a lot by developing some base functions).
A good example is the following function, in C#:
public void DrawObject(MapObject obj)
{
Model model = obj.getModel();
foreach (ModelMesh mesh in model.Meshes)
{
// This is where the mesh orientation is set, as well
// as our camera and projection.
foreach (BasicEffect effect in mesh.Effects)
{
effect.World = obj.getWorldMatrix();
effect.View = Cam.ViewMatrix;
effect.Projection = Cam.ProjectionMatrix;
effect.EnableDefaultLighting();
effect.DirectionalLight1.Enabled = true;
effect.DirectionalLight1.Direction = new Vector3(0.0f, 300.0f, 0.0f);
effect.DirectionalLight0.SpecularColor = new Vector3(0, 0, 0);
effect.EmissiveColor = new Vector3(0, 0, 0);
}
// Draw the mesh, using the effects set above.
mesh.Draw();
}
}
Looks pretty concise, no? (that's exactly 12 lines excluding indentation, comments and putting accolades on separate lines) Now take the following function:
public void DrawWorld(GraphicsDevice Graph)
{
Graph.Clear(Color.Black);
[s]DrawWorld()[/s] DrawBackground();
foreach (MapObject MO in objectList)
{
DrawObject(MO);
}
}
If DrawBackground() is another function with 12 lines, you've got a large piece of code, which is hard to skim unless you're adding all kind of comment breaks. Instead, in this function you can just look at the function and say "Oh, that first draws the world, and then draws a list of objects on top of it", which you can't if you've got to parse some 30-odd lines of code.
(Note that I'd probably split the last part of the first function off into a low level function called AddLighting() because I'm using 5 lines to do 1 thing, which is setting up the lighting, but I'm not quite sure as to how to do that in C# since it does weird things with foreach variables)