The International Simutrans Forum


Author Topic: Code quality: uniform parameter ordering  (Read 1239 times)

0 Members and 1 Guest are viewing this topic.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Code quality: uniform parameter ordering
« on: February 29, 2012, 11:13:54 AM »
Can we change procedures/method signatures, so that the parameter order is similar if the methods do similar tasks?

E.g. text with shadow has color first, then text pointer. Text without shadow has text pointer first, then color. It would be easier to remember if similar procedures had similar parameter sequences.

  display_proportional_clip(n.xpos, start_y + 4, msg, ALIGN_LEFT, color, true);
  display_shadow_proportional(n.xpos, start_y + 4, color_1, color_2, msg, true);

Yes, I wronged this all by myself long ago.