|
I often comment the closing brace, saves a lot of brace-matching but does add some clutter:-
...
}
}
}
}
|
|
|
|
|
RossMW wrote: Do you have any tips on keeping these damn { } under control?
Always, always, always have my opening and closing brackets in the same row or column. And put comments after }, as Member 10707677said.
Trying to figure out where the missing { is when people put the opening { on the same line as the function or if, is just making life unnecessarily hard. And sometimes I come across conditions that are so ugly, I have to do it there too...
if (((x==0) && (y==1)) && (z==2) && ((w==3) && foo==bar))
if ( ((x==0) && (y==1))
&& (z==2)
&& ((w==3) && foo==bar)
)
Occasionally, I have to go and ask whoever wrote it... why?
|
|
|
|
|
I've been doing web dev for a couple the last couple of years. Necessity (a/k/a providence) has allowed me to go back and play with C++.
At first, it was a fierce battle to bring distant memories into the fore - but like riding that bicycle: strong typing, ::, and the like, do give one a warm fuzzy feeling.
A clear move back towards the top of the fool chain.
Time to make some tracks towards home.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I've been using C/C++ quite a bit for the last couple of years and I find a lot of satisfaction in using them.
New version: WinHeist Version 2.1.1 new web site.
I know the voices in my head are not real but damn they come up with some good ideas!
|
|
|
|
|
You need to seek help. Perhaps go and see a sharp therapist.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Your problems seem to be very basic.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Fool chain?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
W∴ Balboos wrote: A clear move back towards the top of the fool chain.
I did some C++ for a Beaglebone a few months back. Funny thing is, when I started with C#, it took a while to get used to not having a .h with class/method prototypes. Thought it was a bad design. Now, when doing C++, I can't stand it. And even worse is (IMO) is the trend to put all the method code in the .h
Marc
|
|
|
|
|
Marc Clifton wrote: And even worse is (IMO) is the trend to put all the method code in the .h Oddly enough, I don't mind the idea of header files, but when I see the aforementioned I still can't help but think WTF.
Jeremy Falcon
|
|
|
|
|
Marc Clifton wrote: And even worse is (IMO) is the trend to put all the method code in the .h Then, again, it's a trend and who wants to follow trends, anyway?
Actually, when using VS20nn I follow the trend in that its templates set thing up that way (at least for C++ forms). I'm working on a console application (it needs to run and then go away on its own): the real main() is in a .cpp file. When I first started with VS I was quite taken aback by the whole thing. I'd come from the pristine world of "C". More of my foul-mouthed attention was, however, given to all the do's and don't's of managed (vs. unmanaged) code.
The thing I like about C++ (vs. C#) is that one has clear distinctions between namespaces and classes and all sorts of stuff (:: vs .), and more a less a better idea of what's really what. There's also "IJW" when I go unmanaged now and then.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Did the man who invented “knock-knock” jokes get a Nobel Prize?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
His act wasn't noble.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Think he worked for Mel Brooks[^]
New version: WinHeist Version 2.1.1 new web site.
I know the voices in my head are not real but damn they come up with some good ideas!
|
|
|
|
|
|
No, the man who invented the Nobel Prize also invented bang-bang jokes.
Software Zen: delete this;
|
|
|
|
|
Hmm.. that does ring a bell.
/ravi
|
|
|
|
|
So I take it you are eating at the moment?
|
|
|
|
|
There's something... but I can't quite put my finger on it...
|
|
|
|
|
Think about it...maybe a thought would ring a bell..
|
|
|
|
|
A Nobel who?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
No, because all that knocking made Victoria Cross. But he did get a nomination for the Cordon D'or!
|
|
|
|
|
|
If I can find a flower for my hair..
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
Someone's showing their age!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
|
|
|
|
|
At my age, you're lucky to have hair.. I'm not that lucky
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|