Should every C++ programmer read the ISO standard to become professional?
No. C++ standard is more like a dictionary - something where you look up specific things that concern you at any given moment. It doesn't make a good (or useful) reading if you treat it as a simple book to read from beginning to end.
If the question were whether every professional C++ programmer should have an ISO standard at hand, and use it for reference as needed, then I'd say "yes".
I think that every professional C++ programmer should have a copy of the standard to refer to. But a sit down and slog through it, cover-to-cover read would be pretty numbing. It's mostly written for implementers (compiler writers), and it has next to no explanation of rationale for why the standard requires certain things.
So, I'd say it's more important for a professional C++ programmer to have and read:
Stroustrup's "The C++ Programming Language"
Meyer's "Effective..." series and/or Sutter's "Exceptional..." series
Lippman's "Inside the C++ Object Model"
Stroustrup's "Design and Evolution of C++"
Or at least some decent subset of them. If you have a chunk of those books under your belt, you'll only be going to the Standard for minutiae or to settle arguments.
By the way, see this answer for pointers on how to get the standard documents:
Where do I find the current C or C++ standard documents?
I think a lot of things like, "is this ok to do?" are only really answered by looking at the standard.
You can learn a lot of things by reading the standard, because it includes all the tiny details people tend to skip out on.
Having standard on hand also helps you back up your statements, because if someone says, "This is okay to do", you can say, "Actually, according to the standard, it's not okay because..."
I think in conclusion, I'll repeat what I've said before:
Knowing it can't hurt you, but you don't need to have it memorized to be a good C++ programmer.
If they're getting paid to write C++, then they are already a professional :)
But I don't think it should be required of any language to get respect. I'm sure there are plenty other uses of such time that might benefit your skillset more.
Should every driver memorize the DVM laws to become professional? It might help, but it would also a ton of work that they probably don't have the time for. Maybe reading a book like Code Complete might be more beneficial.
I'd answer with a few questions:
how much value does it provide to the developer to read the ISO standard?
Are employers demanding this attribute of their developers?
How will it make a developer's code more maintainable, and readable?
Will the reading of the ISO standard help the developer make the developers around him/her any better?
(This sounds like a wiki question.)
No. That's not how people learn effectively, and most people won't retain information after reading a spec. You need practice for information to sink in, and there's no way to get that without implementing things. Also, a lot of programmers only need to use a subset of C++, and can page-fault new information in as-needed.
Rather than reading specs, Your time is better spent learning generally how to program, how to write documentation, how to implement algorithms, and learn the more detailed facets of the C++ as you go.
Understanding how and when to read the standard are more important than just reading to to cure insomnia. Of course this applies to all the standards out there that are related to whatever you are doing. There is defiantly a skill to reading and understanding a standard. And knowing when to read them rather than just throw questions to Stackoverflow or any other random web site is a skill that is missing in many programmers (new and old). But I agree with Michael Burr and asperous.us... there are other books that should be read first.
Related
I am an undergraduate student and I recently was hired for a co-op for this summer and next fall. From what I understand I will be writing a lot of C++ which I am comfortable with but I don't have a huge amount of experience actually writing C++ in particular.
I wanted to take the time to really dive into C++ and become much more proficient with it. Does anyone have any particular resources that I could use to get some more experience before I start my job?
TopCoder was featured on This Developers Life recently and the algorithm challenges are a great way to hone your skills in various languages including C++
Getting involved in Open Source projects is a regular suggestion.
Good books from many authors are listed conveniently in many places including Amazon.com
To really deeply understand the language and learn some best practices I would recommend to read Herb Sutter's books, in following order:
C++ Coding Standards
Exceptional C++
More Exceptional C++
Exceptional C++ Style
The first one is very useful if you don't have experience with industrial development in C++.
Read The C++ Programming Language by Stroustrup cover to cover, and then read it again and again. Then, as you work with C++ programs, keep referring back to that book to remind yourself of the details of various topics.
It is, by far, the best book on C++ available, and since the author invented C++, you will get a good sense of the intentions and rationales of the various language features.
Once you have mastered the contents of that book, the next step is to familiarise yourself with the C++ 03 and the upcoming 0x standards. Reading a language standard can be hard, but once you get used to the style, standards are invaluable resources.
It is very important to be familiar with the authoritative resources and not get lead astray with possibly incorrect or out-dated information out on the web. I've seen programmers make really dumb mistakes because they just searched on Google to find out how some language feature works.
You need to practice and read manuals (tutorials) for c++.
Else you can try to look at internet website who are not protected and look at the source code.
Everybody work hard for what they learn and apply.
Good luck!
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
C++ tutorial for experienced C programmer.
I program in a number of languages frequently and have been using C++ lately. Basically my classes are just wrappers around pure C code. Almost like a struct with associated methods. This gives me the encapsulation and privacy that I want for my data. I have a small hierarchy of classes and am just barely using inheritance.
I am familiar with OO concepts and know what search terms to use when i need to find out about a particular concept in this regard. However, as I have discovered in my foray in the programming world, often the language features that are really helpful are hidden to the newcomer or novice, and the useful bits that I need have already been written and are in a library somewhere that is freely available (most times part of the framework - like in .NET).
What path would you suggest to gain this vital knowledge in C++ and stop myself reinventing the wheel (poorly).
This is the wrong way to use C++. You would be better served grabbing a copy of Accelerated C++ and reading it. Yes, it's a beginner book but unless you want to continue treating C++ as just C with objects then you need to focus on how C++ programmers do things instead of just sticking with what you already know. You need to start from the beginning and build a good foundation in C++.
Learn the STL if you're going to really plan to use C++ in the future. Though opinions will vary widely, particularly among the die-hards, I think there is absolutely no problem using C++ as "C with objects."
Boost is also pretty awesome.
EDIT: Note the downvotes already coming in from the die-hards. C++ acolytes really don't like to hear people advocate using the language as "C with objects." I stand by my statement. You can write quite shippable and commercially viable code without going crazy with an RTTI-enabled, templatized, multiply-inherited set of classes. Remember KISS.
Scott Meyers' books are a great place for C programer to begin with C++.
I recommend Thinking In C++ by Bruce Eckle. Normally it's available for free online, or as a book.
I suggest you read the books:
"C++ Coding Standards: 101 Rules, Guidelines and Best Practices" --Sutter & Alexandrescu
"Modern C++ Design: Generic Programming and Design Patterns Applied" --Alexandrescu
And probably anything else by Andrei Alexandrescu that you can get your hands on.
Then, there are a number of design patterns and programming idioms that make it very clear why "C with objects" is extremely reductionist. Just to name a few: RAII (Resource Allocation Is Initialization), PImpl (or Cheshire Cat), Factory functions, Smart Pointers, Singleton, Type Traits, Expression Templates, etc. When you know about these, you are no longer programming in C++, but in ++C (because you get a result that actually reflects the increment over C).
As for not reinventing the wheel, like many have said already, make sure to first explore the possibilities in the Standard Template Library (STL) (which is much richer than you might think) and then look at Boost (www.boost.org) which has libraries for a lot of diverse purposes and they are extremely high quality (and some are just works of art, like Spirit, Proto, Lambda and MPL). After that, there is of course a large amount of open-source software in C++ out there, but use it with caution: sometimes it is better to reinvent a wheel that fits perfectly to your application than to use one that might not be appropriate or powerful enough, or worse, full of bugs!
I suggest the book The C++ Programming Language for filling in the gaps in your basic C++ knowledge, and BOOST as the first place to look for existing libraries supporting your programming.
Have you thought about getting the C++ Primer Plus? It's a really good book.
The C++ Standard Library: A Tutorial and Reference
Read Meyers for specific tips, but also Stroustrup's Design and Evolution. The latter gets into the motivation as to why C++ is what it is, and very much comes from a "how to improve C" viewpoint.
As for "The C++ Programming Language", 3rd edition is very long. If you can find the 2nd edition, its much more digestible, although of course occasionally out of date (but mostly just less complete).
I am a fairly capable Ruby scripter/programmer, but have been feeling pressure to branch out into C++. I haven't been able to find any sites along the lines of "C++ for Ruby Programmers". This site exists for Python (which is quite similar, I know). Does anyone know of a guide that can help me translate my Ruby 'thoughts' into C++?
I don't think that language introductions written specifically for migrants from a certain language have considerable advantage over traditional "independent" introductory books. Reading as a cognitive process has a great feature: reading speed varies greatly. That means that you should take any good C++ book (I'm sure you'll find excellent recommendations here on SO) and your reading speed will be greatly affected by your previous programming knowledge - reading about things you already know will become almost skimming-fast, others will take some time. In the end, you will spend practically the same amount of time as you would if you read a specific migrant course, with the difference of having read a book that you will be able to use as a language reference at any given time in the future, unlike the "transitional guide", which is always kind of "one-time read".
On the other hand, from a perspective of a writer, it's pretty ungrateful to assume (and rely on) such thing as reader's knowledge on a topic. When one says he knows Ruby is it really a guarantee that he knows OOP thoroughly, for example? Or just have been using it not understanding the internals (which is really easy for a Rails programmer, for example).
So a general book is a safe bet both for a writer and a reader. :)
I agree with others. Your skills in Ruby will certainly help you to learn C++ in a way, but they are quite different. A great online book to learn C++ : Thinking in c++
Bruce Eckel's books are a really good start with an adapted learning curve. Simple to begin but going quite deep into the language. Recommended.
my2c
If you want to learn C++, start here.
Once you have learned the fundamentals, you should also look into these:
Effective C++,
More Effective C++,
Effective STL, and
Exceptional C++
I started programming in C++. It was my first language, but I have not used it in many years.
What are the new developments in the C++ world? What are the BIG things - technologies, books, frameworks, libraries, etc?
Over the last 7-8 years what are the biggest influences on C++ programming?
Perhaps we could do one influence per post, and that way we can vote on them.
Boost:
free peer-reviewed portable C++ source libraries.
We emphasize libraries that work well with the C++ Standard Library...
We aim to establish "existing practice" and provide reference implementations so that Boost libraries are suitable for eventual standardization. Ten Boost libraries are included in the C++ Standards Committee's Library Technical Report (TR1) and in the new C++11 Standard. C++11 also includes several more Boost libraries in addition to those from TR1. More Boost libraries are proposed for standardization in C++17...
"Modern C++", STL, template metaprogramming and Generic programming.
(And yes, they're one single answer, because they're pretty closely intertwined and together represent a complete paradigm shift in C++ development. While some of them are older than 8-9 years, it's pretty much in the last years that they've really gained traction and really left "C with classes" in the dust.
C++0x
Modern C++ is not only a OOP language. C++0x (the new standard) will include many new additions. It might take some time before it is applied thoroughly in every IDE/compilers but it will add a lot to an already excellent language.
Here is a list of new features of the new standard: C++0x
**Edit: C++0x is the result of the past 8-9 years (thank you jalf).
Qt is also pretty useful, 'pretty', well-documented, portable, and free (now under LGPL).
Developers who actually understand OO rather than C with Classes.
Though the field is still full of C programmers with think they know C++ (but don't they are just C with Classes people).
Although it started in 1998, but it really got going in the last 7-8 years, the boost libraries have added a huge amount of high quality code, which in many ways has helped keep c++ somewhat up to date with the capabilities of more modern languages.
Good books to help prospective C++ programmers learn how to use the language properly. Effective C++ by Scott Meyers was a massive help for me. There are other threads on C++ books.
Scott Meyers wrote about most important C++ people and the most important C++ books. These all had a major influence on how programmers write C++ today.
Commercially available whole-program and profile-guided optimization from various C++ compilers, notably Intel's and Microsoft's. In particular, cross-module inlining makes it easier to write well-factored code that blazes.
It’s usually not the first language
you learn at college or university
anymore. This makes prospective
learners appreciative of C++ and
eases them into it.
The internet, video editing sites,
and forums that help programmers of
all levels to get help and feedback
in a very timely fashion.
To me, besides the already mentioned boost, TMP, MC++D etc., the shift away from teaching C++ as "C plus some extras" towards "C++ is a very different language that's not to be used like C" is very important. That would make Koenig/Moo "Accelerated C++" is a huge influence, even though it's a beginners book and even though it's a beginners book that has (with only 250 pages) much too steep a learning curve.
Stroustrup had been saying things about a better language hidden within C++ and the need to teach it better, but I never really understood what he meant until, after 10 years of C++ programming and experience in TMP, I read the book and was enlighted. :^> It's not that I learned any new technical facts from the book. It just taught me a better way to look at (and teach) C++.
And, yes, I have been programming different since then.
Over the last 7-8 years what are the biggest influences on C++ programming?
Boost was already mentioned and I second that.
The importance of Boost is not just its efficiency and spectrum, but also the promotion of concept-based methods.
Stepanov's famous statement at http://www.stlport.org/resources/StepanovUSA.html
I find OOP philosophically unsound. It claims that everything is an object. Even if it is true it is not very interesting - saying that everything is an object is saying nothing at all.
still holds, the concept of "everything" is still every thing and not "object" - if it was "object", what would "class" then be?
And promoting those concept-based methods is in order, because contrary to common wisdom OOADP is often amazingly concept-less:
OOA is nice for reformulating problems the fancy way but we're not paid for talking fancy but for realizing machine support for workflow concepts users have for their problem domain.
OOD has more value in it if it used as a means to achieve a proper decomposition of large systems and as means to express thinking in patterns (which is quite natural for us), but it is never to be taken as a self purpose. I still recall OO "designs" from ~2000 which were presented with great ado and OO babble and featurism but were not even self-consistent.
The concept behind that method should be finding appropriate and useful abstractions, not finding every possible abstraction. Also in ~2000 I've once seen a (even multi)-inheritance hierarchy of depth 7 from which just one leaf class and its possible descendants would ever be used in the system to be created.
Finally OOP, in the closest sense, naturally tends to create state which is then carefully, and, of course, by more OO, so "More of the Same" (Watzlawick), to be protected against concurrent access. In these situations often the concept needed would be doing something instead ot the OO assembly having something.
C++ coding was 10 years ago, especially due to its "competition" with Java, quite susceptible for the OO odds mentioned, so I think that concept-based methods were a great cure.
Boost libs are role models for successfully applying those methods.
I've been doing C++ for 3-4 months in a local college and I'm doing extra reading / learning using Accelerated C++ and so far, I've "finished" it. Now, I'm wondering which book to get next that'll help me code better in C++.
I've looked around and found this: The Definitive C++ Book Guide and List
I'm sorry if this question may seem stupid for most of you here but I'm a bit tight in cash and I would really want to invest in something that's "right" for me at this time.
Right now, I only know the basics of stuff like (classes, templates, STL, iterators, dynamic memory management).
Do you have any suggestions? Should I focus on STL or templates..? Or should I read something like The C++ Programming language?
If you haven't yet read Stroustrup's books, they are definitely a good read. There's nothing quite like reading about the language from the person who designed it.
Whenever I learn a new language, I always try to find the canonical reference material written by the language designer or somebody very close to them.
In addition to reading Stroustrup's books (suggested by another answer here), I'd suggest his two FAQs as a great starting point:
Bjarne Stroustrup's FAQ
C++ Style and Technique FAQ
They both link to further reading material.
These two, along with the C++ FAQ Lite, are required reading for new programmers at my workplace.
Once you're even a bit more comfortable, consider jumping in to the community: subscribe to something like the boost mailinglists, watch the blogs of big name figures like Herb Sutter, read Alexandrescu's Guru of the Week articles. You may feel like you're in over your head (I still do often after many years of reading the lists) but you'll learn a ton, especially watching the language grow and evolve. (And this stuff is free!)
You can get more understanding from watching how a language changes over time, and how people actually use it, than you can from a million hours of memorizing the standard. (Not that shelling out a few bucks to have a copy of the ISO/IEC standard around is a bad idea, mind -- great for reference from time to time.)
As for books:
after the Stroustrup books,
start with the Meyers ("Effective") books.
I'd also recommend C++ Coding Standards -- a great amount of work went into gathering the "common sense" of the users of the language in this book.
Then if you want to blow your mind you can look at Modern C++ Design or some of the fun template metaprogramming resources...
Above all, just stay connected and interested. Mailinglists, blogs, websites, academic papers, magazines, whatever -- choose what suits you best, don't expect to follow everything all the time, but keep your ears and eyes open; find aspects that interest you and follow them!
The C++ Programming Language would give you the best overview of the language. It sounds like you have that but the section on object oriented programming is worthwhile. I'd probably spend more time learning about object oriented programming at this point than more specific C++ features.
A book like "Code Complete" might be a good choice for you.
I feel like you can probably make more progress learning to program by tackling real programming problems, rather than reading another book.
I certainly don't discount the value of books as a programming resource but I do think there is no better way to learn a programming language than writing real code. Given your financial constraints, you have the additional motivation that writing code is free.
Concentrating on a particular part of the language or a pattern for programming might be interesting, but a specific problem to solve will give you context that, in my opinion, is a more powerful learning mechanism.
Of course, you can't write code in a vacuum. You have already read Accelerated C++ which will probably give you more than enough to get started writing code, but there are also a whole pile of resources on the net that will help (StackOverflow is a great place to start).
Tutorials for Win32
Online C resources
VC6 Tutorial
These are my favorite:
Effective C++ - Scott Meyers
C++ Standard Library Tutorial and Reference - Nicolai Josuttis
I might suggest a library card, or hanging out and reading Border's, to make sure the books are helpful for you.
a Good book for templates - C++ Templates by David Vandevoorde, Nicolai M. Josuttis
Learn STL more and more, there is a
lot more to learn.
learn Boost. This would change how
you think about programming in C++.
If you want to go very deep, read Stroustrup's papers. Select a paper now and then, print it, read it carefully. Stroustrup is an excellent writer. reading his papers would make you a superior C++ programmer for sure.
My favorite list is :
A History of C++: 1979-1991, A
History of C++: 1979-1991. After
I read those papers I loved C++.
What is Object-Oriented
Programming?
Why C++ isn't just an
Object-Oriented Programming
Language.
Sixteen Ways to Stack a Cat.
This is a jewel that everyone ought
to read :)
If you don't want to spend money, you should learn multi-threaded programming. The basics are already in the books you have, and described in API documentation. Try to actively create a program with many threads that communicate back and forth, and then multiply the number of threads to see if you've made a good design.
You'll want to read up on Semaphores, Mutexes, and Critical Sections.
I take three approaches to multi-threaded programming:
Use a PostMessage style communication between threads
Pass thread-safe objects between threads through which data is stored and relayed
Initialize a thread on start-up, let it run on its own, and then retrieve the data at the end of the run
If you're ready to spend money, I would recommend Design Patterns as a good next-read. It's more generic, and you'll find some of the ideas make sense.
I think you started out with just the right book! For those who didn't know, this book starts with STL at the beginning and leaves pointers for the end. Most programmers learn C first, and consequently have a forever distorted view of what C++ can be.
It might be really interesting for you to now read 'The C Programming Lanugage' by Kernigan & Richie at this point. This is probably a necessity if you want to understand the mindset behind most C/C++ code in the world today.
But more important than your next programming book is to find a medium-sized program you really want to write, and go after it. Use all kinds of reference materials for the project. Incorporate a boost library or two in your program.
If you are tight on cash, read How to Think Like a Computer Scientist. Also read the FAQ lite.