As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Do you know of well designed open source applications that are instructive to analyse?
Specifically, I'm interested in practical applications object-relational mapping in C++ based programs, where there is a good separation between a domain model and persistence/serialization functionality.
If you include well designed open source libraries that are instructive to analyse, have a look at Boost.
About persistence / serialization (not relational mapping though), have a look at Boost Serialization, you might find nice ideas!
"...one of the most highly regarded and expertly designed C++ library projects in the world."
— Herb Sutter and Andrei Alexandrescu, C++ Coding Standards
"Item 55: Familiarize yourself with Boost."
— Scott Meyers, Effective C++, 3rd Ed.
"The obvious solution for most programmers is to use a library that provides an elegant and efficient platform independent to needed services. Examples are BOOST..."
— Bjarne Stroustrup, Abstraction, libraries, and efficiency in C++
While this doesn't fit your specific requirements (it's not a business app for a start), I think that OGRE 3D is a great example of an open source C++ project.
V8 javascript engine is said to be very well engineered. http://code.google.com/p/v8/
Google Chrome also has an interesting architecture and high quality code base. http://code.google.com/chromium/
Both are open source, under BSD-like license.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to walk the path of functional languages, since i have started i have only used OO languages and multi-paradigm languages; in the last period of time i have focused myself on C++ and in my understanding functional languages shines when you need to keep a consistent state and they are often used by some mission-critical services like banking services.
I don not want to leave C++, I would like to try a mix, I'm also interested only in cross-platform solutions among x86, ARM and Linux, Windows and BSD/Mac, so i suppose that F# is out ( also it appears to be just the Microsoft version of Ocaml for what i have read).
Can you suggest a language that will be good for this mix and clarify where and when a functional language can really offer the most ?
If you're interested in a language which is similar to C++ (with good C/C++ interoperability, too), but has powerful constructs from functional languages, you might like Rust. One of the Rust developers wrote up a comparison of Rust's and C++'s goals, which you might find informative.
Support for ARM does not yet exist, but Rust is LLVM-based, and LLVM supports ARM, so it's certainly possible to do.
Use C++11 lambda functions and expressions ;)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Are there resources for C++ which would be like Java has?
Like full tutorial http://docs.oracle.com/javase/tutorial
and like full API Specification http://docs.oracle.com/javase/7/docs/api/index.html
The documentation of the C++ standard library is part of the C++ standard (ISO/IEC 14882:2011). That standard has to be purchased, but recent drafts that only minimally differ from the official standard are available on the homepage of the C++ working group.
Note that the standard is quite terse. A more beginner-friendly introduction to the C++ standard library was written by Nicolai Josuttis.
I know this site. I agree that there is no API regarding C++. This language doesn't have the a.b.c.d() form that Java has. However this site is very helpful if you knwo what to look for
C++ is a language not an API there is a specification for C++ but there is no such thing as an API.
There is a ISO standard for C++ and a book: http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470846747.html
There are many books on the standard library that details the idiomatic usage of STL and the new C++11 standard adopts many Boost libraries such as smart pointers.
Josuttis' book: http://www.josuttis.com/libbook/, interestingly there is a second edition which covers C++11 which I wasn't aware of.
There are also many Boost books which you can google for, I would recommend the following: http://www.amazon.co.uk/The-Boost-Libraries-Boris-Schaling/dp/0982219199/ref=sr_1_5?ie=UTF8&qid=1336925944&sr=8-5
and http://www.amazon.co.uk/Beyond-Standard-Library-Introduction-Boost/dp/0321133544/ref=sr_1_6?ie=UTF8&qid=1336925944&sr=8-6
Any APIs you will see will be framework and OS specific, the standard library does not cover this like JAVA does unfortunately.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have been coding in java most of the time, and I also studied C and C++ at University. But I have never written a large C++ code from zero made of many files, as I have done in java with a file for each class.
I'd like to know some book or reference with exercises and examples made of many files and classes en C++, so I can face big C++ projects in the future.
Sorry if you feel this question is eternally repeated.
Large-Scale C++ Software Design, by John Lakos.
Frankly, it doesn't matter much which language you're using in the end. Good software design is good software design. I don't think you'll ever learn it from a single book - and most books that talk about that kind of thing are referring to designing large frameworks which I doubt you're doing.
Identify sub-components/functionalitities in your requirements that you can form into separate libaries (static or dynamic, read up on the difference). If you compartmentalize these components into libraries that can act independently of each other then you'll have loose coupling between libraries - and assuming you've correctly identified your sub-components, they should have high-cohesion (everything in a library is closely related).
Try and keep dependencies out of your header files whenever possible regardless of where you're coding - you should read up (even on google) about separating declaration from definition). There's a number of design patterns for this purpose (including PIMPL which I seem to be mentioning alot today).
Read the design patterns book by the Gang-of-Four, and do the above, and you'll be off to a good start. Also, assuming you're decent with C++, Effective C++ by Scott Meyers will talk about some of these topics in very helpful manners.
Good design is a key on large projects and it is doesn't matter which language do you use if you follow the OO concept.
But for some best practices in c++ you could read this book:
http://www.gotw.ca/publications/c++cs.htm
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to learn about streams in C++. I have done some googling and searching on Amazon and have not had any success in finding a book/web resource on this topic. Any suggestions would be much appreciated! I have found some information on sites like cplusplus and forums, but I'm still still unclear about a number of issues. I would really like a clear, comprehensive resource.
One thing that I would like to do is get input for my programs from external files.
Thank you for any suggestions.
Standard C++ IOStreams and locales by Langer and Kreft is dedicated to streams (and locales, which streams use extensively), but it sounds like you want a general overview as you'd find in a general reference or introductory book.
I don't know of a book that deals with streams as its major subject. I'm sure you can find a lot of resources on the Internet, but judging their quality may be difficult. The following two books have rather good coverage of streams and might be work looking into. Of course they cover a lot more than just streams.
The C++ Programming Language by Bjarne Stroustrup
The C++ Standard Library: A Tutorial and Reference by Nicholai Josuttis
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there a DI framework comparable to Google Guice? And what does Google use?
There is nothing as mature or standard as Guice in the C++ world. However, some people have put together simplistic implementations on their own. Here's a couple.
http://adam.younglogic.com/2008/07/dependency-injection-in-c/ (source for implementation is at the end of the post)
http://sourceforge.net/projects/qtioccontainer/ (requires Qt)
http://code.google.com/p/autumnframework/ (hasn't been touched since 2007)
http://programmaticallyspeaking.blogspot.com/2010/04/beautiful-dependency-injection-in-c.html (more of a description, really)
http://sourceforge.net/projects/cpp-resolver/ ("Alpha" quality)
You're unlikely to be satisfied by any of these.
If you really wanted to put in the effort to rally the world around a DI framework for C++, probably the way to go about it would be to make a proposal to the Boost guys.
I'm the author of wallaroo. It's actively developed and has the following features:
it's lightweight but powerful
its interface supports both C++11 and C++98 with boost
it's type safe
it doesn't need custom preprocessors / code generators
you can load classes defined in shared libraries
you can use a DSL syntax for object creation and wiring or
you can get object creation and wiring by parsing one or more xml / json file.
Any comment, suggestion or request are welcome.
There is a recent one that looks very interesting called Hypodermic, i haven't tested it but it looks pretty active
I am currently authoring one called sauce, whose design (and name) is directly inspired by guice. I still consider it alpha, but you may find it useful.