views:

451

answers:

12

And what's your suggestion to move to the next level of C++ programming for someone who may be called, well, an intermediate C++ programmer?

Intermediate Programmer: Understands ISO C++ reasonably well, can read and modify other's code with some luck, good with data structures and algorithms but not great

  1. Learn C++0x
  2. Learn what kind of assembly code gets generated for different construct types, maybe for x86
  3. Forget language nuances and get the fundamentals -- automata theory from somewhere like Sipser or Papadimitriou
  4. If you know OOP or at least think you do, consider how to incorporate functional programming skills with C++
  5. Work on something on the lines of a compiler and open-source like LLVM or GNU Toolchain
  6. The whole idea is busted -- the next level means more sophisticated data structures. So if you know AVL, consider learning left leaning red black trees et al

Now obviously nobody can do everything in this list without prioritizing, so we need some suggestion on what might be the best way forward.

NOTE: Thank you all for the very helpful responses.

+1  A: 

Learning assembly (e.g. to write assembly) might be a good idea, but I strongly suggest you don't become attached to the particulars of what your compiler generates, as that will change from version to version and optimization level to optimization level.

Ken Bloom
+1  A: 

I would be a strong proponent of #4. Learning functional programming is very valuable. I haven't done a whole lot of it in C++, so I don't know how natural a fit it is, but I love how Ruby and Scala do functional programming.

Ken Bloom
It's a bad fit for C++, which doesn't mean that learning FP won't make you a better C++ programmer. Learning about any different programming paradigm will make you a better programmer overall.
David Thornley
+13  A: 

I'd say you can do everything on the list, just not all at once. At least IMO, you're looking at things a bit backwards though. Learning C++ (or any other language) is a means to an end, not an end in itself.

Learning more advanced language techniques, more advanced data structures, etc., should mostly be done when and as needed to accomplish something. You certainly need a reasonable starting "base" to do much, but beyond a fairly small set of basics, most advanced techniques, data structures, etc., are also relatively specialized.

Instead of trying to learn something for it's own sake, write some code. When something seems clumsy, unnecessarily difficult, inflexible, etc., find a better way to handle it. This way, you'll not only learn the more advanced technique, data structure, etc., but also a good idea of what it really accomplishes so you'll have a decent idea of when, how, and why to use it (and just about as importantly, at least some idea of its limitations and when it's probably not applicable or useful).

Jerry Coffin
+1 for writing a lot of code.
Alexandre C.
TopCoder.com practice rooms are a great way to write a lot of code if you don't have any particular inspiration at the moment.
Cogwheel - Matthew Orlando
@Coghweel: Quite true. Project Euler, and the Sphere Online Judge have some interesting problems as well.
Jerry Coffin
There's a lot of sites out there for you to practice writing code. See http://stackoverflow.com/questions/662283/websites-like-projecteuler-net
Dubs
But sometimes learning just by searching for specific solutions just doesn't have the same effect. For example, there are a lot of C++ paradigms out there, but you won't find the one you need unless you already know about it.
Tomer Vromen
+1  A: 

I suggest you go into the designing part of programming. Learn how to design, write good code, learn good programming practices. Design patterns, UML, unit tests belong here.

As one hardly does the same thing all the time I also recommend, as you said, the assembly language. Learning assembly is fun and it really makes you understand computers better. Nothing beats the feeling of knowing how computers work at the lowest level.

Having knowledge of both low and high level programming beats everything else.

yper
question was about C++... I see it a bad taste at least to mix such different things as C++ and FP
+8  A: 

I'd learn about BOOST.

You can start piecemeal, just by using it, and as you get deeper into the libraries, you will find yourself thinking "How does that work?".

  • Using it will make you a more productive and better C++ programmer!
  • Understanding how it works will get you a "guru" badge!!
  • Contributing to and extending it will ensure immortality!!!
Roddy
+8  A: 

To answer your specific questions:

Learn C++0x

You definitely need to do this. So possibly you have your answer right there...

Learn what kind of assembly code gets generated for different construct types, maybe for x86

I would say learn how to understand the assembly language the compiler generates, in outline if not in detail. You certainly should not be trying to predict what the compiler will do, however.

Forget language nuances and get the fundamentals -- automata theory from somewhere like Sipser or Papadimitriou

If it turns you on, I suppose...

If you know OOP or at least think you do, consider how to incorporate functional programming skills with C++

Of all of the paradigms C++ supports, functional programming is probably the worst supported - if you want to learn FP, learn Haskell (or whatever), not C++.

Work on something on the lines of a compiler and open-source like LLVM or GNU Toolchain

GNU is written in C, so it's not likely to boost your C++ skills - I know little about LLVM.

The whole idea is busted -- the next level means more sophisticated data structures. So if you know AVL, consider learning left leaning red black trees et al

RB trees are not much more sophisticated than AVL trees - same basic concept. If you understand the basic structures covered in a data structures textbook, I don't see the need to dig further, unless the subject particularly interests you.

anon
+1 Answering specific questions
Caleb Thompson
+1  A: 

Don't worry too much about C++0x right now... make sure you really really really understand the basics first. This means make sure you understand references, pointers, L-values, R-values, templates, inheritance, memory management, etc etc. I'm not just saying grab a basic understanding of these, I'm saying really know the C++ memory model and what each expression means.

I really like #4 and #6. In regards to #6, try coding up some really advanced data structs in C++. Nothing will make you learn the language faster then trying to solve some problems that advanced data structs entail.

Polaris878
+1  A: 

Study how other people solve difficult problems in an elegant way. Very important: just practice, without forgetting to evaluate. Have your code or problem solving methods reviewed.

Yes (referring to point 4), learn other programming languages, especially those that have specific advantages over c++, rather than applying their techniques directly in C++. Focus on finding methods for yourself to code with as few errors disrupting your workflow as possible, find a calibrated systematic and abstract approach that you can always apply to problem solving and implementation.

Collect/build a set of tools/libraries and coding practices that allow you to stop inventing the wheel, but deal with all the most common tasks in the best ways. Cause if you think about it, appart from bugs, readability, scalability and extensibility and in much lesser degree performance, if you write code that gets the job done, you have actually shown yourself a good programmer.

I aim at productivity here. If you are more into theory, you might as well just occupy yourself with little snippets and obscure language features.

ufotds
A: 

For another point of view: 7. Learn other programming languages, as different from C++ as is practical. Definitely learn about functional programming, and don't worry about how it applies to C++ yet. Some languages to consider: Scheme, Common Lisp, Haskell, Prolog, Forth, Smalltalk. You don't have to become proficient in them, but you should try to understand how they work and what's good code in those languages.

If all you know is one language, your thinking will be restricted to what's natural in that language. If you know more than one, you'll be able to think in more different ways. You'll be more flexible in your approach to problems.

David Thornley
A: 

Anything you mentioned above will make you become a better C++ programmer. You need to make a choice based on your career plan. For example, if you want to develop hardware driver with C++, you should learn assembly code generated.

hehongyu2000
+1  A: 

I'd say the next step is to read Structure and Interpretation of Computer Programs from cover to cover and do the exercises.

Paul Reiners
+1 for a link to a free book. I like free.
Dubs
+3  A: 

If you know the basic language:

Then in this sort of order (though there will be some back tracking)

  • Learn study and digest RAII
    • Figure out how to use RAII in all C contexts so you are never stuck with C code.
  • Figure out Exceptions and what the exception guarantees are.
    • Figure out how to implement methods so that each of the different types of guarantees holds.
  • Learn about the standard containers.
    • Learn about the requirements required of each container.
  • Learn about iterators
    • Learn about iterator traits and how they work in conjunction with pointers.
  • Learn about the algorithms library
  • Learn about the stream library
    • Go back and learn how streams and iterators work
  • Learn about the method pointers and how they can be used in algorithms
    • Figure out what a functor is and how to use it.
  • Learn about bind and look at boost bind
  • Learn about the boost containers and how they differ from the standard containers.
  • Learn about smart pointers.
    • What are the different types and when to use each one effectively.
  • Start reading about the other things available in boost.

At this point you will be at the start of learning how to use C++

Martin York