Almost all the code I've seen until now uses the following style for curly braces:
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
Visual Studio also defaults to this. However I have read Code Complete 2nd edition and Steve McConnell argues against this style. "Avoid unindented being-end pairs (...) Although this approach looks fine, it (...) doesn't show the logical structure of the code. Used this way, the begin and end aren't part of the control construct, but they aren't part of the statements after it either." Steve McConnell recommends using the pure block style, which emulates Visual Basic (where there's no curly braces):
void swap(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}
or this (begin-end block boundaries):
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
Although I tend to agree with McConnell's reasoning, all the books I read, the classes I attended, and Visual Studio, use the first style, so I find it a bit weird. What do you think?
did you realize this mean that every american can be tracked, and put in prison if they don't use these tools the way the governement want. (I hope you realize the real objective of all of this)
I let you imagine why Putin as so much power... now I let you realize the direction the US is going (and its not the only country unfortunately)
so, yeah, let's go, let americans to be monitored by their government.
the others will be safe: they will not have access and will not be tracked.
From 86 to 32GB... Wow... The massive inefficiencies and technical debt they had...
Better texture compression, shared asset bundles, duplicate asset removal, audio/video cleanup and recompression, removing obsolete files...
The thing you look at when buying a computer or laptop is not the CPU/RAM/SSD. You are looking at what features are on the system. USB 2/3/4/c, GPU, (not for the gaming aspect, but if you want nice movies, this helps) and other helpful add-ons. Keyboard media keys, for example. Also long battery life is a plus, too.
Might want to also mention what brands you are looking at. Dell, Lenovo, Frameworks, etc.
Edit: Unless you are looking for a laptop for portability, get a desktop.
Question
Andre S. Veteran
Almost all the code I've seen until now uses the following style for curly braces:
void swap(int &a, int &b) { int temp = a; a = b; b = temp; }Visual Studio also defaults to this. However I have read Code Complete 2nd edition and Steve McConnell argues against this style. "Avoid unindented being-end pairs (...) Although this approach looks fine, it (...) doesn't show the logical structure of the code. Used this way, the begin and end aren't part of the control construct, but they aren't part of the statements after it either." Steve McConnell recommends using the pure block style, which emulates Visual Basic (where there's no curly braces):
void swap(int &a, int &b) { int temp = a; a = b; b = temp; }or this (begin-end block boundaries):
void swap(int &a, int &b) { int temp = a; a = b; b = temp; }Although I tend to agree with McConnell's reasoning, all the books I read, the classes I attended, and Visual Studio, use the first style, so I find it a bit weird. What do you think?
Link to comment
https://www.neowin.net/forum/topic/630296-curly-braces-placement-and-indentation/Share on other sites
63 answers to this question
Recommended Posts