Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 7:54
mvePIEBALDconsult7-Oct-09 7:54 
GeneralRe: Code Readability Poll Pin
LimitedAtonement7-Oct-09 7:32
LimitedAtonement7-Oct-09 7:32 
GeneralRe: Code Readability Poll Pin
Not Active7-Oct-09 8:01
mentorNot Active7-Oct-09 8:01 
GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 8:07
mvePIEBALDconsult7-Oct-09 8:07 
GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 7:40
mvePIEBALDconsult7-Oct-09 7:40 
AnswerRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 7:26
mvePIEBALDconsult7-Oct-09 7:26 
AnswerRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 8:41
mvePIEBALDconsult7-Oct-09 8:41 
AnswerRe: Code Readability Poll Pin
OriginalGriff7-Oct-09 10:35
mveOriginalGriff7-Oct-09 10:35 
I agree with the previous responses: readability is the important bit, and line spacing can seriously improve this - that is one reason why the "how to get an answer" bit at the top of the page stresses to use "code block" or <pre> tags to preserve formating.

Three points:
1) Whatever the company style is, that is the one you use. Making it all look the same is the easiest way to make it all readable - because if the company style makes it all harder to read, then everyone will complain, and the company style will get changed. If everyone codes to a personal style, then everything gets muddled and harder to cope with.
2) My personal preference is always to use braces for a loop of conditional statement. That way, it is much harder to get it wrong when adding a second staement to a single line conditional. This is a lot easier nowadays, with VS etc auto indenting etc., but it is still easier to see what is going on. (It is similar to the reason why C++ accepts "if(A = B)" while C# wont - avoidance of potential problems.)
3) I also indent braces to match the statements in the functional block - I consider them to be a single indented statement in effect. I really hate the open brace at the end of an if statement, with it's matching brace indented. It looks clumsy and makes it difficult yo find matching braces by eye. But, if that is the company style, then I use it. They write the cheques...

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: Code Readability Poll Pin
PIEBALDconsult7-Oct-09 13:22
mvePIEBALDconsult7-Oct-09 13:22 
QuestionPocket PC development tools Pin
libelledriver7-Oct-09 4:21
libelledriver7-Oct-09 4:21 
AnswerRe: Pocket PC development tools Pin
EliottA7-Oct-09 4:24
EliottA7-Oct-09 4:24 
GeneralRe: Pocket PC development tools Pin
libelledriver9-Oct-09 3:25
libelledriver9-Oct-09 3:25 
GeneralRe: Pocket PC development tools Pin
EliottA9-Oct-09 3:27
EliottA9-Oct-09 3:27 
Questionscoket communication through internet IP between two machine? Pin
Tridip Bhattacharjee7-Oct-09 4:20
professionalTridip Bhattacharjee7-Oct-09 4:20 
AnswerRe: scoket communication through internet IP between two machine? Pin
stancrm7-Oct-09 5:43
stancrm7-Oct-09 5:43 
Questioni need help Pin
Mohamed El-Wehishy7-Oct-09 4:17
Mohamed El-Wehishy7-Oct-09 4:17 
AnswerRe: i need help Pin
Blikkies7-Oct-09 4:28
professionalBlikkies7-Oct-09 4:28 
RantRe: i need help Pin
Greg Chelstowski7-Oct-09 4:41
Greg Chelstowski7-Oct-09 4:41 
GeneralRe: i need help Pin
Blikkies7-Oct-09 4:44
professionalBlikkies7-Oct-09 4:44 
GeneralRe: i need help Pin
Mohamed El-Wehishy7-Oct-09 4:53
Mohamed El-Wehishy7-Oct-09 4:53 
AnswerRe: i need help Pin
Blikkies7-Oct-09 4:52
professionalBlikkies7-Oct-09 4:52 
GeneralRe: i need help Pin
Mirko19807-Oct-09 5:46
Mirko19807-Oct-09 5:46 
GeneralRe: i need help Pin
Blikkies7-Oct-09 7:11
professionalBlikkies7-Oct-09 7:11 
GeneralRe: i need help Pin
Blikkies7-Oct-09 7:14
professionalBlikkies7-Oct-09 7:14 
GeneralRe: i need help Pin
Christian Graus7-Oct-09 10:03
protectorChristian Graus7-Oct-09 10:03 

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.