Tips about designing containers [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Every time when I'm designing new data structures in C++, I have some troubles with pointers, references, constness, etc. Can somebody please recommend me good books with good tips about designing containers?
P.S book of John Meyers, is that good choice?

There is a detailed description of how the STL is implemented in "The C++ Standard Library: A Tutorial and Reference" by Nicolai M. Josuttis.
Meyer's Effective STL is less comprehensive but does have a section on containers.

Scott Meyers' Effective C++ is a pretty good resource for general C++ wizardry and it does have a great discussion of class design, but I honestly think that his "More Effective C++" is a bit more appropriate to what you're talking about. It talks a lot about class design concepts like reference counting, copy-on-write, etc. It might be a bit advanced for what you're looking for, but it's perhaps the best intro to advanced class design out there.
I also think that Herb Sutter's "Exceptional C++" might be good. I know that it has a pretty good discussion about designing the string class, and that single example is so useful that I would recommend it above everything else. That discussion is also available online, if you find that useful.
Both of those discussions are more about the mechanics of designing a good abstraction around a data structure, but they don't talk much about data structures in general. There are a lot of fascinating data structures out there, and it's probably a good idea to see some of them in action before trying to implement your own. I'm personally of the school of thought that you can learn a lot about class design by taking known data structures and coding them up, though I concede that this might not be the optimal way of learning how to code. If you're interested in seeing some fun data structures (like the binary heap, red-black tree, binomial heap, B tree, disjoint-set forest, and Fibonacci heap), consider picking up a copy of "Introduction to Algorithms, 3rd Edition" by Cormen, Leisserson, Rivest, and Stein. It's widely considered one of the best texts on algorithms, and has enough pseudocode that if you wanted to write up a good data structure, you could almost certainly find enough hints here. These structures, combined with the above books, should have all sorts of info. It's a lot of reading, granted, but you'll be well on your way toward data structure guruship if you can make it through them.
Hope this helps!

Related

What's the preferred sequence to read Effective, More Effective & Effective Modern C++ (and STL)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I understand that More Effective C++ is an expansion of Effective C++, while Effective Modern C++ focuses on C++11 & 14. Being a newbie to the language and just starting out with these books, should I read Effective Modern after the first two? Also, where should Effective STL fit in?
What is the preferred sequence to reading the above books, in the sense that each book is building on the content of the prior books? (Assuming everything inside is new to me?)
Additionally, is Effective Modern C++ considered an unofficial next edition to Effective C++?
An answer to this can be gleaned from the Books, etc. summary page on Scott Meyers' website:
Effective C++, Third Edition, 2005. Scott's flagship book, and the
industry's must-read second book on C++ (i.e., what you read after
you've learned the fundamentals of the language)
Read this first.
More Effective C++, 1996. Still relevant after nearly 20 years!
Indispensable in its own right, and an invaluable companion to
Effective C++
Read this together with, or after, Effective C++.
Effective Modern C++, 2014. The book on effective use of the features
new in “modern” C++ (i.e., C++11 and C++14). A complement to Scott’s
existing books
Read this once you have mastered the concepts in the other two, as it is focused on the changes in the later versions of the language.
Effective STL, 2001. 50 specific ways to improve your use of the STL,
including techniques for improving performance, eliminating resource
leaks, avoiding portability problems, and more — all in Scott's
inimitable style
This one is less clear although I would suggest reading it after the first two and before the third.

Websites rich with exercices or explanation for SML? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I know that I need to pass through google to search etc, I did but they don't offer what I need 90% of this sites give the same example and even sometimes the same explanation, If there someone who have for example links from university or school or may be in his dropbox, I will be very thankfull.
Unfortunately it seems that the best resources for learning Standard ML are various paper books (e.g. Introduction to Programming using SML by Hansen & Rischel, ML for the Working Programmer by Larry C. Paulson, or Programming in Standard ML by Robert Harper (the last one is available for free online), as well as resource material from various university courses of which none I have encountered excels.
Here is a number of exam assignments from one course using Standard ML:
I took the Programming Languages Course at Coursera and it was superb. Most of the course is based on SML.
The first first four weeks are entirely about SML. The material distributed in the course is great and every week there are plenty of interesting exercises to solve.
The good news is that this course is about to start in October 3, 2013 again. So this is your opportunity.
I own the list of books mentioned in the other answer. They all are very good. But I also own another one not mentioned above and that I considered great for initial ML learning: Elements of ML Programming by Jeffrey Ulman. In fact I preferred this to the others mentioned above because I found its explanations simpler and the exercises more progressively challenging.
I am using the book Programming in Standard ML by Colin Meyers,Chris Clark,Ellen Poon
and ML for the working Programmer by L C Paulson.The former is really a great book as it always puts types in function declarations..this way you will master the underlying types in sml

How to learn Fortran. Problems? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have just got a job, starting in a months time which requires me to use fortran.
I have brought a couple of books, but they seem to lack any questions or problems and that is how i learn best.
I would like to know if you could recommend and books or websites that offer problems that i could practise with.
Thanks
I can recommend several, depending on your previous programming in general knowledge and Fortran specific knowledge.
For an absolute beginner (and don't take this in a negative context; it just means you're starting anew, and unlike someone who has a habit of some bad Fortran77 practices, you'll start with a clean mindset) I would definitely go with Chapman's Fortran 95/2003 for Scientists & Engineers. It is an excellent learning book, and although it has some drawbacks they're not important at this stage. It also has a plethora of examples useful in real life. It also emphasises good modern Fortran concepts and ideas (Fortran 90 and newer).
After it, or maybe instead of it, if you're looking for more of a reference book one cannot recommend enough one of the following:
- Metcalf, Reid and Cohen's Fortran 95/2003 Explained (btw, a new edition covering the latest Fortran standard is coming up in a few days) - a classical reference book. Some swear by it instead of Chapman's.
- The Fortran 2003 Handbook: The Complete Syntax, Features and Procedures by several authors; a standard reference book, dealing with the finer aspects of the language. Not important at this stage but just so you know it's there.
Apart from these, which I like to call "the big three", there are numerous tutorials, scriptas and handbooks all over the web (free) and on Amazon. Some links were given in here as well, so I won't repeat those. Also, your compiler is bound to have a good reference manual I don't know about the free g* ones, but all commercial ones do.)
Apart from that, you know you can always ask any question that comes to your mind in here, and on comp.lang.fortran (usenet group; google for a "Usenet client" or "newsclient" and check it out.). Some very(!) knowledgeable people lurk in there.
If you haven't already, install Linux and gcc on a home computer and begin to play with FORTRAN or Fortran. The command prompt syntax is gfortran filename.f which produces an executable file named a.out.
As for hints of what to experiment with, use previous answers to Stack Overflow questions, from simple to not-so-simple:
Hello world
the CONTINUE statement
variable scope
integer to string
procedures and functions
F90+ KIND explanation
i/o units
file reading
file writing and implied do loop
formatted output
passing variable array parameters
Legacy FORTRANisms
Back in the day, I had the book "Structured Fortran 77 for Engineers and Scientists". There are updated versions of this book that cover the newer Fortran standards.
My Vote goes for the classic McCracken Book
http://www.amazon.com/Guide-Fortran-Programming-Daniel-McCracken/dp/0471582816

What C++ book talks about recommended ways of organizing big projects? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I would like to know about books that talk about design issues like when to use namespaces and other coding standards to write good quality efficient C++ code. One that talks about Code testing will also be appreciated.
"Large-Scale C++ Software Design" by John Lakos worked great for me years ago on how to organise code in large projects.
On testing, this is not my area, and I cannot recommend a great book. What I can do is discourage you from getting "Testing Computer Software", 2nd edition by Cem Kaner, Jack Falk and Hung Q. Nguyen. I found it severely dated and extremely clumsy. But please take this with a grain of salt.
For big projects, it is essential to follow a common design and coding style. Consistently.
I found the following book useful to have a common ground in a big project.
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices by Andrei Alexandrescu, Herb Sutter
book about refactoring: http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672

Suggestion for template book for C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am learning templates. Which book is worth buying for doing template programming?
I already have The C++ Programming Language and Effective C++.
Those two books are pretty good in my opinion and they helped me a lot
C++ Templates: The Complete Guide by David Vandevoorde and Nicolai M.
Josuttis
Modern C++ Design by Andrei Alexandrescu
The first one explains how templates work. The second book is more about how to use them. I recommend you to read the first book before starting with Modern C++ Design because that's heavy stuff.
Maybe a bit mind-boggling if you are just learning, but after the books you mention, you may want to read Andrei Alexandrescu's Modern C++ Design, if only to learn what can be accomplished through templates. Besides, it discusses many advanced aspects of templates wonderfully.
Search for fairly recent book "Advanced C++ Metaprogramming" by Davide Di Gennaro
Both Modern C++ design and C++ Template Metaprogramming are very good (and quite advanced) books on the subject. I have a strong personal preference for the first.
C++ Templates: The Complete Guide is your best bet. You could also learn about the Standard Library which heavily uses templates.
There is a hidden treasure in C++ templates that very few people are aware of: C++ Common Knowledge: Essential Intermediate Programming.
The last 15 chapters of that book both teaches better and complements C++ Template Metaprogramming in some respects. I strongly recommend anyone who is to learn templates to read this book foremost.
"C++ Templates: The Complete Guide (Vandevoorde & Josuttis)" is excellent for the theory.
Then you can learn even more about actual templating practice by looking at how templates are used in the Boost library.
Effective STL by Scott Meyers