Newbie questions...
I recently made the decision to move from Lisp to modern C++ mainly due to performance problems in the Lisp I/O system.
Now, I already "know" C++ sort of. I've written C++ stuff (~ 20 kloc) that compiles and links fine, I know all about class inheritance, virtual functions, namespaces, pointers, references, templates, etc.
What I DON'T know is "modern" C++. I can get by with STL, I know of the Boost libraries and have used a few of them before, but I haven't yet written C++ code that isn't ultimately just C-structs-with-functions. I am near the beginning of what is going to eventually become a significant project (100 kloc+) and want to start out in the best form possible. Here are my questions:
1) What is the modern way of handling pointers and memory? I've heard people say that with the recent C++ standard one does not need to worry so much about memory leaks and dangling pointers. auto_ptr by itself is clearly not enough, so what else is used to make memory handling easier?
2) Outside of STL and Boost, what other libraries are "standard" these days?
3) I've head it said that C++ templates provide as much power as Lisp macros. Can anyone here support that statement with some examples? I mean, Lisp macros are pretty dang powerful. Is the power of C++ templates what people call "generic programming" or "template meta-programming"?
4) Which single C++ book would you recommend to buy to bring a C++ circa 1995 programmer into C++ today?
5) Given the choice between iostream (cin/cout) and stdio.h (sscanf, fprintf), does anyone here have strong reasons to prefer iostream? I'm curious because it seems like iostream actually makes things more complicated compared to fprintf which is easily translated (can even re-order the output variables in the final string) and handles number formats trivally.
I appreciate anyone's help.
Now, I already "know" C++ sort of. I've written C++ stuff (~ 20 kloc) that compiles and links fine, I know all about class inheritance, virtual functions, namespaces, pointers, references, templates, etc.
What I DON'T know is "modern" C++. I can get by with STL, I know of the Boost libraries and have used a few of them before, but I haven't yet written C++ code that isn't ultimately just C-structs-with-functions. I am near the beginning of what is going to eventually become a significant project (100 kloc+) and want to start out in the best form possible. Here are my questions:
1) What is the modern way of handling pointers and memory? I've heard people say that with the recent C++ standard one does not need to worry so much about memory leaks and dangling pointers. auto_ptr by itself is clearly not enough, so what else is used to make memory handling easier?
2) Outside of STL and Boost, what other libraries are "standard" these days?
3) I've head it said that C++ templates provide as much power as Lisp macros. Can anyone here support that statement with some examples? I mean, Lisp macros are pretty dang powerful. Is the power of C++ templates what people call "generic programming" or "template meta-programming"?
4) Which single C++ book would you recommend to buy to bring a C++ circa 1995 programmer into C++ today?
5) Given the choice between iostream (cin/cout) and stdio.h (sscanf, fprintf), does anyone here have strong reasons to prefer iostream? I'm curious because it seems like iostream actually makes things more complicated compared to fprintf which is easily translated (can even re-order the output variables in the final string) and handles number formats trivally.
I appreciate anyone's help.
