Re: cocoa-dev digest, Vol 2 #2366 - 12 msgs
Re: cocoa-dev digest, Vol 2 #2366 - 12 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #2366 - 12 msgs
- From: Mark Smith <email@hidden>
- Date: Wed, 21 May 2003 12:11:55 -0400
Regardless of it's merit, it's a common C++ idiom for writing
exception safe code.
Obviously, and I understand the reasoning that leads to such a
solution. I even thought it was a Good Thing, initially. It took me
a while to realize just how much of a coding horror it is.
I can't see why this qualifies as a "coding horror" for anyone fluent
in C++. It's arguably just a kind of Method Object. If the issue is
revealing intent, then you could either make the name more obviously a
verb:
AutoSaveGraphicsContext save;
or add an explicit method:
GraphicsContextSaver saver;
saver.save();
but the latter will be pointlessly redundant (and more error-prone) to
a C++ programmer. The real "coding horror" here is surely the attempt
to simultaneously use two languages with totally different rules and
idioms rather than anything inherently wrong with either one of them
alone.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.