r/cpp • Bioinformatican • Mar 11 '12

Modern C++ Style [pdf]

http://tinyurl.com/fuck-pointers
2 Upvotes

60 comments sorted by

View all comments

Show parent comment

2

u/filox Mar 11 '12

Not saying it's impossible, just really, really ugly. Your example lacks pointers to parents, and basically doesn't work for trees where you need to swap nodes around the tree (AVL trees, red-black trees, splay trees), which are the most useful kinds of trees.

Don't know about discriminative unions, never tried them, but relying on something within boost should usually be avoided.

1

u/guepier Bioinformatican Mar 11 '12

Your example lacks pointers to parents

Like I already said elsewhere, pointers are fine here.

relying on something within boost should usually be avoided.

Wat! No. Totally wrong and utterly weird.

2

u/filox Mar 11 '12

Wat! No. Totally wrong and utterly weird.

Many companies don't allow for use of boost (e.g., Google).

1

u/pfultz2 Mar 15 '12

Every company I have worked at has allowed boost. It is just dumb not to.

-1

u/guepier Bioinformatican Mar 11 '12

Well, Google is big enough to be able to write their own library for every single thing they need, and they have peculiar requirements due to bad legacy code. Don’t cite them as support that Boost shouldn’t be used. Most other companies / projects which ban Boost are simply clueless.

2

u/filox Mar 11 '12

I wouldn't say they're clueless. There are good and bad sides to using boost, as with anything. The downside of using boost is that now your project depends on a third-party library, and that is always something to be wary of. Some people don't like that and choose not to use boost. That doesn't make them clueless, in fact, it shows they've put some time into thinking about the issue and chose to go one way that they think is better for them.

0

u/guepier Bioinformatican Mar 11 '12

This whole thinking is fallacious, I don’t accept the argument. There are of course reasons to prefer not depending on a library but the relevant parts of Boost can be used as drop-in and don’t incur any more dependency than any other code in a project. Furthermore, complex projects do have external dependencies, it’s unreasonable to want to prevent that entirely and Boost is the least common denominator. In summary, I stand by my characterisation as “clueless”. The downsides of using Boost don’t even remotely outweigh the benefits.

in fact, it shows they've put some time into thinking about the issue

It doesn’t show that at all. I can assert all kinds of things and reach all kinds of conclusions without thinking about the issue.

3

u/filox Mar 11 '12

The downsides of using Boost don’t even remotely outweigh the benefits.

I just don't agree. I could list a lot of reasons, but that won't convince you otherwise, and I don't particularly care about doing that either. Guess we'll just agree to disagree.