Boost logo

Boost :

Subject: Re: [boost] 5 Observations - My experience with the boost libraries
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2010-03-23 19:25:20


Tom Brinkman wrote:
> There are many things that the typical C++ programmer could learn from the
> typical C programmer. Not sure it works in reverse though.

How about using the appropriate data structures for the task at hand? OK, I admit that this is challenging without having templates to help you with this. But macros should be able work around this problem. Fixed size buffers, variable size buffers and singly linked lists are extremely overused data structures in typical C code, while C++ code tends to use the appropriate data structures for the task at hand (if they happen to be part of the standard library).

Something more practical to learn is to write "constructors" for all your "potentially evolving" data structures, because adding new members to these could otherwise lead to bugs in code using these data structures.

So, now it's your turn. Just name one or two of the many things that the typical C++ programmer (me) could learn form the typical C programmer.

Regards,
Thomas


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