Author Topic: Source file sizes  (Read 14363 times)

Etinarg

  • Rogueliker
  • ***
  • Posts: 424
  • Karma: +1/-1
  • Idea archivist and game tinkerer.
    • View Profile
    • Gedankenweber Blog (German)
Re: Source file sizes
« Reply #15 on: August 17, 2010, 10:15:19 AM »
I personally find shorter functions harder to understand than longer ones, since they usually rely heavily on other function calls, which makes tracing the logic and debugging a bit of an adventure.

A good IDE helps with the tracing aspect. The method/function names bear semantics.

A method call "move_monsters" tells quite well what it does. A 20 line block of code which does it, doesn't tell so easily. So each called function has a name that speaks for itself, and basically lifts the whole thing onto a higher level.

I agree that the innermost loops of a pixel processing pipeline have different constraints. But still, many languages can inline functions, so you do not loose performance due to the split, and still gain the higher semantic level.