News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Code quality: uniform parameter ordering

Started by Spike, February 29, 2012, 11:13:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spike

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.