Program Structure - Using Procedures and/or Functions

Oct 15 2007 5:42 AM

Hi,

This is a general question on programming C# with Windows Forms and .NET.

I have to perform some mathematical operations on arrays, and in previous programming, C, Pascal, i used to use Procedures or Functions, and pass the array to the procedure/function, where as now i have specific global arrays.

To stop having to repeat code in each menu option code section to peform the mathematical function, i was going to use a single function called by each section of the code as and when required.

Is this still good practice, or should each menu selection from the window form have its own code ?. Seems and obvious answer to use a called procedure, just need to make sure, or, are there any other best practices ?.

Thanks in advance for your help.

Regards,

Richard.


Answers (9)