[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]
On 16/12/10 09:25, Robin Cornelius wrote:
I don't (as yet??) have a use for Boost but I'm looking at a couple of open source projects that use some of the bits - and I look at the code and go WTF does that do. I refer to the Boost documentation and got ???? rinse and repeat and am little the wiser. I can use the debugger to get a grip on it but that's slow and tedious and provides little coverage. Just a 'necessary and sufficient' real use example would be nice! C++ and Ruby seem to be the easiest languages to write impenetrable code in but also seem to attract the least commented the better crowd. Sells books but doesn't improve programming efficiency. I'm glad I'm not doing this for a living any more! But it is a language and just because all I've come across so far is the a bit Bekky Pollard X Will Hunting doesn't mean there aint no Shakespeares (or Milligans) out there.On Thu, Dec 16, 2010 at 8:58 AM, tom<tompotts@xxxxxxxxxxxxxxxxxxxxxx> wrote:OK perhaps I should say looking for example uses that dont make some Boost libs look like a solution to a problem that doesn't exist other than ideologically. There's a lot of 'you do it like this' but no 'why you don't do it like that' which for me is often the clue to the whole thing. I should perhaps say I'm coming back to C++ after a long absence using other OO languages, and I'm finding it the ugliest of the lot- barring PHP I guess. Tom te tom te tomWhat do you want to use boost for/which part of boost are you interested in? I've used some boost libs but certainly not the entire set or even come close to using even the majority of the features even on the libs i do use, its a huge library set. The boost docs can be very confusing at times and can take a good few passes and experimentation to understand them. And yes you probably can do the same thing without them the question is how much extra code/complexitity will this introduce and how much is then simply reinventing wheels? and boost is cross platform too and takes into account various issues with specific compliers and differences with template handling in versions of MSVC etc, so portability becomes a lot simpler. A few examples, boost::signals is one i use frequently, it provides a nice signal/slot system for application messaging, so interested peices of code can "subscribe" and recieve a call back when the signal is sent, then the code emitting the signal does not need to care too much about who it needs to notifiy it just does a sig() on the event. Also with boost::bind added in you can use non-static class member functions as callbacks, as the bind operation can add the implicit this pointer. All of this can be achieved without using boost but its such a handy time saving code simplyfing thing that i just use it. boost::regex is a handly one, although plenty of other regex libraries do exist, but if you are going to drag boost into your application and you need regex then its there already (boost::sprit is another boost regex library) The various boost smart pointers are also handy, they do a lot more than the auto_ptr and firends in std by allowing shared pointers with ref counting and also delete() when ref count =0, and yes again you could create your own smart pointer class with its own ref counting with just pure c++ templates and classes. I do think some of the issue with c++, expecially if you have been off using newer OO languages is c++'s core is some what lacking many of the additional features and helpers that boost provides for c++, just exist, for other languages and because boost is essentially an extension to c++ using only its built in mechanisms of templates/overloading etc it can end up a bit clunky. The one big gotcha i keep comming across with people using boost is the fact its a c++ library not a c library, so you can't just link a binary of the boost libs compiled with one compiler version against your application built with another and then be suprised when it either fails to link or wierd crashes happen. Sure you can often get away with it but often you can't so best practice is use the same compiler version. Robin
Tom te tom te tom -- The Mailing List for the Devon & Cornwall LUG http://mailman.dclug.org.uk/listinfo/list FAQ: http://www.dcglug.org.uk/listfaq