Click here to Skip to main content
15,894,720 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 12:49
venomation30-Apr-10 12:49 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult30-Apr-10 12:54
mvePIEBALDconsult30-Apr-10 12:54 
GeneralRe: Is this good code practice? Pin
harold aptroot30-Apr-10 12:58
harold aptroot30-Apr-10 12:58 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 13:04
venomation30-Apr-10 13:04 
GeneralRe: Is this good code practice? Pin
harold aptroot30-Apr-10 13:29
harold aptroot30-Apr-10 13:29 
GeneralRe: Is this good code practice? Pin
venomation30-Apr-10 13:54
venomation30-Apr-10 13:54 
AnswerRe: Is this good code practice? Pin
AspDotNetDev30-Apr-10 14:39
protectorAspDotNetDev30-Apr-10 14:39 
AnswerRe: Is this good code practice? Pin
Abhinav S30-Apr-10 16:21
Abhinav S30-Apr-10 16:21 
You might want to move some of this code out of your main method and into other methods.

For e.g.
thebuzzwright wrote:
methodList.Add("1", (() =>
_person.ForEach(s => Console.WriteLine("{0} {1}", s.Name, s.Title))));

might go into a readInput() method.

thebuzzwright wrote:
person.Add(new Person( "James","Prog" )); _person.Add(new Person( "Claire","Illu"));

could go into loadData() or something like that.

thebuzzwright wrote:
string input = Console.ReadLine(); if (methodList.ContainsKey(input)) methodList[input]();

could go into a method called userResponse().

If any of these methods are modified later, these logical groups might make it easier for others to understand what is done where in the program.

modified on Saturday, May 1, 2010 12:39 AM

AnswerRe: Is this good code practice? Pin
Som Shekhar30-Apr-10 19:41
Som Shekhar30-Apr-10 19:41 
AnswerRe: Is this good code practice? Pin
Pete O'Hanlon30-Apr-10 20:46
mvePete O'Hanlon30-Apr-10 20:46 
GeneralRe: Is this good code practice? Pin
venomation1-May-10 4:15
venomation1-May-10 4:15 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult1-May-10 5:41
mvePIEBALDconsult1-May-10 5:41 
GeneralRe: Is this good code practice? Pin
venomation1-May-10 7:18
venomation1-May-10 7:18 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult1-May-10 19:41
mvePIEBALDconsult1-May-10 19:41 
GeneralRe: Is this good code practice? [modified] Pin
venomation2-May-10 1:49
venomation2-May-10 1:49 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 4:07
mvePIEBALDconsult2-May-10 4:07 
GeneralRe: Is this good code practice? [modified] Pin
venomation2-May-10 5:58
venomation2-May-10 5:58 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 10:24
mvePIEBALDconsult2-May-10 10:24 
GeneralRe: Is this good code practice? Pin
venomation2-May-10 11:41
venomation2-May-10 11:41 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult2-May-10 17:44
mvePIEBALDconsult2-May-10 17:44 
AnswerRe: Is this good code practice? Pin
venomation3-May-10 0:56
venomation3-May-10 0:56 
GeneralRe: Is this good code practice? Pin
PIEBALDconsult3-May-10 3:59
mvePIEBALDconsult3-May-10 3:59 
GeneralRe: Is this good code practice? Pin
Alaric_3-May-10 4:45
professionalAlaric_3-May-10 4:45 
GeneralRe: Is this good code practice? Pin
venomation3-May-10 5:04
venomation3-May-10 5:04 
QuestionCreate Image in WinForms vs Asp.net Pin
#realJSOP30-Apr-10 9:44
mve#realJSOP30-Apr-10 9:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.