Boost logo

Boost :

Subject: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakablelibrary?
From: Pierre Morcello (pmorcell-cppfrance_at_[hidden])
Date: 2009-09-06 16:30:50


Thanks for sharing you point of view. At least you are not the only one who seems not interested !

>>>>you might consider an overhaul of your code
Please could you be a little more precise concerning the problems that you see ? ( because it sounds like 'this is bad but I don't tell you why').
>>Is this concerning some compilers executing wrong statements ?
>>Is it just concerning optimisations?
>>Is it because you believe the code to be less readable / manageable?

>>>>>My remark is not meant to be snide, just an advice from an old fart, having wrestled, and eventually mastered, C++ for the last 20 years :-)
Don't worry! But I would like to point out something. There are people judging scientific documents by the name of the authors. I am not of this kind : even if you had only 1 year C++, I would listen to your remarks with interest, wondering if I forgot something, and if I can learn something from you.

Anyway, could you be more precise concerning the overhaul?

Pierre

--- En date de : Dim 6.9.09, David Bergman <David.Bergman_at_[hidden]> a écrit :

De: David Bergman <David.Bergman_at_[hidden]>
Objet: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakablelibrary?
À: boost_at_[hidden]
Date: Dimanche 6 Septembre 2009, 12h56

On Sep 6, 2009, at 3:48 PM, vicente.botet wrote:

> Hi,
> ----- Original Message -----
> From: "Pierre Morcello" <pmorcell-cppfrance_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Sunday, September 06, 2009 7:58 PM
> Subject: Re: [boost] [Boost.Breakable] Any interest in a Boost Breakablelibrary?
>
>
>
> Hi, there is no difference.
>
> Indeed, the macro as I use it right now is even less optimised than a GOTO or a do...while(false) : it's currently just a simple 'for' loop in a macro..
>
> The aim is to make code more readable. A goto is a pain to manage when you use a lot this 'breakable' structure.

If you use a lot of that 'breakable' structure - or its concrete counterparts (single-iterative for-loops or do-while's) - you might consider an overhaul of your code. I have written a lot of abstract machines and compilers so I am aware of the (quite few) cases where goto's and such use of breaks are justified, but such cases are rare. My remark is not meant to be snide, just an advice from an old fart, having wrestled, and eventually mastered, C++ for the last 20 years :-)

> The fact that it is easy to use and readable makes it easier to use a lot.. In the end, I happen myself to use it lot more than I thougth I would at first. That is the main reason why I am proposing it here.
>
>>>> Both are probably shorter to write.
> Yes, although someone using such library may redefine the macro as he wishes :
> e.g. #define Breakable BOOST_BREAKABLE
> I am just conforming to BOOST coding style.

A comment regarding interest: no, I am not interested. As sebastian pointed out, "do { .... } while (false);" is simple enough, and ugly enough to at least make the coder think twice before using it :-)

/David
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk