

Ask HN: Should we use C++ instead of C? Which version of C++? - pramodbiligiri

For a new data service I'm building at work, I'm seriously evaluating using C++ instead of C (I can't use Java/Scala due to memory footprint). I'm confident our team can cope with either so I don't see that as an issue.<p>Advantages of C++ over C, as I see it:<p>- Slightly easier memory management<p>- Better standard library: strings, STL, Boost etc<p>- Access to modern libraries open-sourced by Google 
(http://stackoverflow.com/questions/4721824/what-libraries-has-google-released-for-c), 
  Facebook (https://www.facebook.com/notes/facebook-engineering/folly-the-facebook-open-source-library/10150864656793920) et al.<p>Cons:<p>- The language is more complex; should choose the right subset<p>- More chance for library/version incompatibilities?<p>I'm not too aware of the state of C++ nowadays. Does anyone have any recommendations for which version of C++ to go for, which style guidelines to follow etc? (All our environments are Linux)
======
papaf
Have you considered using a mix of languages? For instance Python with C in
areas that are performance critical. I'm seeing this used increasingly on
scientific projects and I have heard no complaints.

The reason I suggest a mix of languages is that, as you probably already know,
writing in C slows development time and writing in C++ is like walking through
a minefield where seemingly simple things explode in complexity. In my
experience/opinion C codebases are more maintainable although the code
probably took longer to write.

~~~
pramodbiligiri
Hm, I haven't given that serious thought. I'm used to doing cross language
calls on the JVM but not to native code.

In our use case we need to load a lot of data and serve it. The client library
could be written in Python. I'm trying to decide on the language to use for
the lower level.

------
pramodbiligiri
I must add that I've looked at this recent HN thread on the same
(<http://news.ycombinator.com/item?id=3953434>) by the author of 0MQ. But I
felt the question is still valuable enough to stand on its own.

