Which is the best and appropriate way to write the code in Winforms ?

Posted by Harikrishna on Stack Overflow See other posts from Stack Overflow or by Harikrishna
Published on 2010-05-06T05:29:36Z Indexed on 2010/05/06 5:38 UTC
Read the original article Hit count: 170

Filed under:
|
|

What is the best way to write the code ?

(1) Like directly writing the code in the button_click() event.

or

(2) Make the function of that code which I write in button_click() event and write this function in one class and then that function I should call in the button_Click() event.Like is it called three-tired approach to write the code ?

Like in button_Click() event I write the code to save the records in csv file from datatable.So I should write that code in button_Click() event or I should make one new function and one new class and write that code in that function which is the new class and calling that function in button_Click() event.

This is only one example but I am talking about all the code written in my application that which is the appropriate and best way to write the code and what are the benefits ? Note that I write the code in Winforms with c#.

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms