Click here to Skip to main content
15,885,683 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch23-May-20 4:49
mvahoney the codewitch23-May-20 4:49 
GeneralRe: The Roslyn API is nasty Pin
User 1106097923-May-20 5:13
User 1106097923-May-20 5:13 
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch23-May-20 5:44
mvahoney the codewitch23-May-20 5:44 
GeneralRe: The Roslyn API is nasty Pin
User 1106097923-May-20 5:54
User 1106097923-May-20 5:54 
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch23-May-20 5:58
mvahoney the codewitch23-May-20 5:58 
GeneralRe: The Roslyn API is nasty Pin
Sander Rossel23-May-20 23:08
professionalSander Rossel23-May-20 23:08 
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch24-May-20 4:19
mvahoney the codewitch24-May-20 4:19 
GeneralRe: The Roslyn API is nasty Pin
kalberts24-May-20 7:15
kalberts24-May-20 7:15 
Both using braces and indenting is, in principle reudundant, I can't protest against that.

One of the most common problems (although in the "minor" class - they are almost always caught by the compiler) is getting the braces and indentations right - especially in C-like languages where the closing brace is "anonymous", with no indication of what it closes (no ENDFOR, OD, ENDWHILE or anything of that sort.

So I see the redundancy as a great aid to getting things right: There is never an opening brace without an indent, and never an indent without an opening brace. Never an undent without a closing brace, never a closing brace without an undent.

When an indent may or may not come with another level of bracing, and the next statement following that for-for-if were (incorrectly) indented or undented, and the function goes on for thirty lines with this mis-indentation, it could be difficult to spot the location of the missing or extra brace. The compiler will hopefully tell you that something is wrong, but it might require some work to decide what is wrong: Maybe the next statement really belongs within the inner for-loop, so the problem was a missing brace, not an incorrect indentation.

So, I go for redundancy: Neither indentation nor braces, or both indentation and braces. For the last if-statement: If you don't want the braces, then rather put it all on one line (as long as it doesn't exceed 70 chars). You know that after an if-condition, the rest of the line is either a single, short expression which is the entire if-clause, or a brace that opens an indented block. (The only thing that may follow an opening brace is an end-of-line comment.)

Obviously, the compiler doesn't care. This is only for my own sake, to make it easier for myself to spot where there is an error in the nesting levels.
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch24-May-20 10:13
mvahoney the codewitch24-May-20 10:13 
GeneralRe: The Roslyn API is nasty Pin
Sander Rossel24-May-20 21:56
professionalSander Rossel24-May-20 21:56 
GeneralRe: The Roslyn API is nasty Pin
Jacquers23-May-20 19:53
Jacquers23-May-20 19:53 
GeneralRe: The Roslyn API is nasty Pin
honey the codewitch23-May-20 20:32
mvahoney the codewitch23-May-20 20:32 
GeneralRe: The Roslyn API is nasty Pin
Sander Rossel23-May-20 23:05
professionalSander Rossel23-May-20 23:05 
GeneralRe: The Roslyn API is nasty Pin
Super Lloyd24-May-20 18:30
Super Lloyd24-May-20 18:30 
AnswerHow I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
Nand3222-May-20 22:21
Nand3222-May-20 22:21 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
OriginalGriff22-May-20 23:01
mveOriginalGriff22-May-20 23:01 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
CodeWraith22-May-20 23:05
CodeWraith22-May-20 23:05 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
OriginalGriff22-May-20 23:13
mveOriginalGriff22-May-20 23:13 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
Nand3223-May-20 1:18
Nand3223-May-20 1:18 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
CodeWraith22-May-20 23:02
CodeWraith22-May-20 23:02 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
RickZeeland22-May-20 23:17
mveRickZeeland22-May-20 23:17 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
Nand3223-May-20 1:17
Nand3223-May-20 1:17 
GeneralRe: How I killed the Anterrorists with Pasta (Ant-hunt follow up) Pin
Daniel Pfeffer24-May-20 7:20
professionalDaniel Pfeffer24-May-20 7:20 
GeneralMini CCCs 179 Pin
Tim Deveaux22-May-20 17:03
Tim Deveaux22-May-20 17:03 
GeneralRe: Mini CCCs 179 Pin
OriginalGriff22-May-20 19:19
mveOriginalGriff22-May-20 19:19 

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.