Math Resources for C/C++ Programmers [closed] - c++

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
My degree is in Electrical and Computer Engineering but i'm currently employed as a Software Engineer. I took all of the algebra, geometry and calculus classes that one would expect from someone with my degree however I must admit, I think I learned just enough to pass the test but never really saw a use for it and therefore never really retained much of the material.
Now that i've matured some, I see the use for it all of the time. I KNOW that there are lots of places that math knowledge would improve my coding so i'm ready to relearn the old stuff and learn some new stuff.
What are your favorite resources out there? (Resources that can tie math into programming are even better if you have any!) Books? Websites? Blogs?

I found this blog on the subject intresting:
http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html
also has some recommendations for books.

Wolfram MathWorld is one of my favorite resources for all things math. Wikipedia has plenty of math resources as well.

I think these books will help you on designing algorithms:
Introduction to Algorithms
Concrete Mathematics: A Foundation for Computer Science
Discrete Mathematics and Its Applications

Hacker's Delight is a great little book about math and programming. The blurb:
A collection useful programming advice the author has collected over the years; small algorithms that make the programmer's task easier. At long last, proven short-cuts to mastering difficult aspects of computer programming. Learn to program at a more advanced level than is generally taught in schools and training courses, and much more advanced than can be learned through individual study/experience. An instant cult classic for programmers!

I don't use a lot of "real math", but when I need to remember those formulas that I used in school I go to Google. A lot of the results end up Here

Well, there's always Stack Overflow. :) In all seriousness, if you have a specific question that involves both math and programming, you could do far worse than posting it here.

I favourited a similar Stack Overflow question a few weeks back which contains some good info on the subject:
Essential Math for excelling as a Programmer?

Another poster recommended Numerical Recipes in C++ but posted a link to an older version. The newer Numerical Recipes in C++, 3d ed, ISBN-13: 9780521880688, is available and is an excellent resource.
alt text http://ak.buy.com/db_assets/prod_lrg_images/909/204734909.jpg

Knuth. http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419
Or as I like to refer to it: The guy that made me realize I hadn't actually invented or discovered anything that hadn't been known for years.

Alot of the best resources have already been mentioned, but since you specifically called out C++ you should have a look at Numerical Recipes in C++, 3d ed, ISBN-13: 9780521880688.
Also, one of the best mathematics resources on the web is MathsChallenge.net, and its companion site Project Euler.

Math Refresher for Scientists and Engineers (by John R. Fanchi)
Just-In-Time Math for Engineers (by Archibald L. Fripp, Jon B. Fripp and Michael L. Fripp)

I really like the book Mastering Technical Mathematics 3rd Edition. It's kind of a bird's-eye view of mathematics with a technical focus. It starts out with such simple concepts as addition and multiplication, but as it explains the concepts it also explains how computers do the calculations. About half-way through you'll find quadratic equations and calculus. Page 442 begins the discussion of "General Time-Space Hypervolume". I didn't see anything about matrix math in there, but for a good "everything about math in a nutshell"-type book it's great.

I've had this type of experience myself...one of the more comprehensive starting points I found was MIT's OpenCourseWare site. They actually offer their entire Mathematics for Computer Science course materials (and a lot of other course materials for that matter) online, and for free. Here's the link to the Math course:
http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-042JFall-2005/CourseHome/index.htm
It's not the be-all end-all of computer math, but it is a great place to get started, and figure out what other research you may need to gather.

Related

Interview question; what is the main theme of Effective C++? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was asked the following question at a recent job interview:
What do you think is the main theme / single word that sums up the Effective C++ series from Scott Meyers?
What would be your answer to this question?
In one word it's Advice
My answer would be "I'm not sure, I learned C++ without reading that book."
The two older editions gathered advice especially helpful for people switching from C to C++. Using new/delete instead of malloc()/free() and OOP was all new back in 1991.
The 3rd edition is more targeting people switching from other languages (Java, C# etc.) to C++. It comes with advice on patterns, templates, exception safety, a much richer standard library, and many other topics people didn't think about in 1991.
Basically, Scott Meyers' goal has always been to write "the best second C++ book to buy" - not something to teach you the language, but to become a real professional. He wanted to list the "50 most important pieces of advice for practicing C++".
Oh, and something we shouldn't forget: He wanted it (and succeeded in doing so) to be a technical book that's fun to read.
Although a very strange question to ask in an interview (considering your candidate might not have read such an excellent book), I would say the main theme of Effective C++ is to take the path of a semi-expert C++ programmer and adjust his/her way of thinking (especially towards the internals of C++) on the path of becoming an expert.
One thing I learned a lot about is self checking of references (Page 71, Item 17). Better memory management. Preferring new/delete vs malloc and free (which is obvious but his reasonining was very well stated). Another good one was Item 29 on page 123, avoid returning "handles" to internal data.
It is not a simple read, and it is definitely not a beginner's book. It's the next leap for a C++ programmer looking to become a better C++ programmer.
It was a very good book and although it's a little dated it is one of the best books to become a proficient C++ programmer. I still read portions of it to this day, and I'm definitely NOT a C++ expert; it's a hobby.
To impress the person interviewing you mention that although you liked Effective C++ that the interviewer should take a gander at More Effective C++. Explain some of the pros to this book as well and ask he/she if they too have read it considering they've read Effective C++. That should stump the chump :).
That C++ is an insanely complex language with lots of tricks, tips, idioms and odd constructions that you have to know by heart rather than being enforced by good language design?
Probably not going to get you the job at anywhere except MSFT though !
Don't
{blah body too short blah}
C++ gives you enough rope to hang yourself with. However, you can write solid code using it, if you follow these guidelines.
Guidelines to write better C++.
Main (plagiarized) theme: "With great power comes great responsibility"
How to write effective C++?

Resources for learning C++ for game programming [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 4 years ago.
Improve this question
I am a relatively newbie in C++ and have worked in the game industry for a few months. I am looking to get back into the industry and understand that one needs to be a very good C++ programmer (mainly because of how competitive it is to get into making games). I was wondering if there are any really good websites online that would help with that. Basically I am looking for something that would help me master C++ concepts and help me be a good coder through practicing programming examples.
Scott Meyers' books: "Effective C++", "More Effective C++", and "Effective STL" are absolutely essential for you.
Add to that "Modern C++ Design" by Andrei Alexandrescu.
Someone once said that it takes 10 years to learn C++. Having 14 years of C++ experience and still regularly learning new things, I'd say it's true. I would hesitate to call myself a C++ expert even after my considerable experience. Don't expect to master it overnight... you will go through many phases where you think you get it, then you'll discover a whole new world (for lack of a better term; I believe Richard Dawkins refers to this process as "conciousness raising"). I've come to accept that another one of these epiphanies is always ahead of me, hence why I'm not calling myself an expert.
That said, you must practice practice practice. I'll 2nd (or 3rd, or 4th, whatever we're at now) Gamedev.net. I spent a lot of time there back in the day...
GameDev.net.
In Resources, there is a "For Beginners" section. Read through all of this!
C++ FAQ Lite is good. You can learn a lot from that website and there is also a related book which is also good.
The books by Scott Meyers contain very good specific advice too.
C++ is a great language and I love it. It builds ridiculously fast code. With good use of profilers, profile driven optimizers, intermodule optimizers, const and restrict keywords, MMX/SSE/vector intrinsics and other stuff it can build ludicrously fast code.
You probably have your eye on job listings from the bigger game companies and there is a lot of C++ demand.
That said, it isn't the only way to develop games. I just want to present some alternatives.
Microsoft's .NET stuff works pretty well. Check out their XNA platform.
You can also write awesome games even in Java. There is a Java version of Quake2 that can get 1,000 FPS in some areas on my Core I7 system at home. Most of the heavy work is in the OpenGL and graphics drivers of course.
Tons of people are writing fun games in Flash, which has language performance much worse than Java or .NET.
I totally recommend Brucke Eckel's: Thinking in C++
You can download for FREE at his webpage.
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
That should help you master C++, from there, you can start reading code from engines, like Ogre3D, that would be a better learning.
Later, you should check out books from GameDev.net, they are really cool. But in my opinion, the articles found in GameDev are outdated.
www.gamdev.net is an excellent resource for game programming.
I would also recommend the Game Programming Gems Series.
As far as mastering C++ concepts, who better to learn from than the guy who created C++?
He wrote this: C++ Programming Language
One way to get back in and have fun at the same time is to go through Nehe's OpenGL tutorials, or by using higher-level gaming frameworks such as Irrlicht or Ogre3D
You should check out wildmagic at http://www.geometrictools.com/. This is a nice game engine with lots of sample code and related books. I'd highly recommend it as a deep examination of game engines on c++.
I learned C++ (having no previous coding experience) with the following books:
"C++ Without Fear" by Brian Overland
"Sams Teach Yourself C++ in 24 Hours" Fourth Edition
And
"Beginning Game Programming through C++" Second Edition by Jonathan S. Harbour
The first one is very good and ver detailed, if a bit slow to read. The second I use mostly as a reference, the last one is very useful and quick to read, but it uses the phrase "beyond the scope of this book" fairly often.
The C++ Programming Language
by Bjarne Stroustrup.
I use this to this day. It contains succinct descriptions of all the features of the C++ language. When I search on the web for this information, it's flourished beyond clear understanding. Bjarne did a really good job of clearly defining all the principles of the language, and it's a must-have. I haven't read the whole book, but I've read sub-sections.
(Also gave a vote up for Effective C++, Effective STL, and Exceptional C++ (Sutter))
The above are good suggestions for learning C++ and games...
I will give you a recommendation for software if you just want to make games without a lot of programming background...
You could quickly make simple games and then learn the C++ and other languages it really takes to make serious games...
Software:
Gamemaker
http://www.yoyogames.com/make
The Games Factory 2
http://www.clickteam.com/eng/tgf2.php
Books
Picture Yourself Creating Video Games, 1st Edition
Awesome Game Creation: No Programming Required, 3rd Edition
Make Amazing Games in Minutes, 1st Edition
Good luck to you...
I'd recommend starting with the basics:
The C programming language, by Kernigan and Ritchie.
With this book you'll be closer to C's internals than with others. Then you can go with C++ books.

Practical and advanced C++ usage

I've studied C++ as a college course. And I have been working on it for last three years. So I kinda have a fairly good idea what is it about. But I believe to know a language is quite different from using it to full potential. My current job doesn't allow me to explore much.
I have seen you guys suggest studying a open source project and perhaps contributing to one too. So my question is, can you suggest one(of both?) to start with that is simple and doesn't overwhelm a starter.
I was in the same situation 12 years ago when I got my first programming job out of college. I didn't do any open source but I managed to gain a lot of practical and advanced C++ knowledge by reading books (the dead tree kind).
In particular, there was an excellent series by Scott Meyers which I feel helped the most in turning me from newbie to professional:
Effective C++: 55 Specific Ways to Improve Your Programs and Designs
More Effective C++: 35 New Ways to Improve Your Programs and Designs
Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library
The topics in these books range from beginner to advanced. It took me about 2 years working in C++ to understand every chapter in these books, so don't be disheartened if it goes over your head at some point... just try reading it again later :)
If you're willing to climb the very steep learning curve, I would think that you could do worse than studying parts of the boost libraries. I don't think there is another similar body of C++ code out there that is pushing the boundaries of what can be done in C++.
re project selection: you'll want to hack on something that has some relevance to you, otherwise it's just unpaid work. i might suggest eg. Pure, but will you find enough interest?
re advanced code: see Boost
Obviously learning something like this does not happen overnight; You can study existing open-source projects like other posters suggested. However, I have one more suggestion: I suggest joining one of the big IRC c++ channels (for example #c++ on efnet or freenode). Of course most of the questions / discussions going there are basic; however quite often interesting discussions and questions come up. Over the several years I've learned quite a bit just by participating in channel discussions.
My main advice would be that you do not need to stick to C++ to learn technique.. Study Erlang, Lua, and Haskell (lots of others). You will learn so much from these language that you can apply in C++.
Google protocol buffers is a very well written C++ application that sticks to the features of C++ that are proven in the industry -- i.e., they don't go over the top with features that cause headaches for using the code.
In terms of learning to use C++ to its full potential, well the full potential is often hidden. There are very few exceptional C++ programmers, even in the open-source community. So I suggest you read some books. Like the books from Scot Myers and Herb Sutter (all 6 of em).
Boost is an amazing library and has a lot of good code, ranging from simple techniques to very advanced techniques. It definitely touches all of the bleeding edge of C++ idioms. The problem with boost is, it doesn't work well with modern IDE features (code-completion being the main problem), and it has a LOT of symbols :D. It is the place to learn about generic programming and template meta-programming, the former represents the most advanced and immediately-usable idioms, and the latter you can skip for the immediate future.
Apart from the Scott Meyers books DSO has already suggested: Participate on SO and try to answer other people's C++ questions. If you don't know the answer, wait a little until some good answers are posted. You will probably get some idea where the gaps in your knowledge are and you could do some more reading to fill those afterwards.

C++ interview preparation [closed]

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 a Phone interview coming up next with with a company which works in financial software industry. The interview is mainly going to be in C++ and problem solving and logic. Please tell me the method of preparation for this interview. I have started skimming through Thinking in C++ and brushing up the concepts. Is there any other way I can prepare?? Please help.
Edit:
Thank you all everyone for the advice. I just want to add that I am currently fresh out of grad school and have no previous experience. So Can you suggest some type of questions that will be asked to new grads??
Make sure you know your basic data structures and algorithms. You're more likely to be asked about that stuff than something higher up the food chain. Those are usually saved for the in-person interview.
Put another way: be solid with the fundamentals and solid with your C++ syntax. Also, knowledge of common libraries like STL and Boost couldn't hurt...but be sure you know what those libraries give you! In the end phone screens are there to cull out people who can't do the basics. Prove you can and you should move on to the next step. Good luck!
Here's some links of interview questions to check out:
C++ Interview Questions # DevBistro
C++ Interview Questions # Blogspot
C++ Interview Questions # FYI Center
Steve Yegge's Five Essential Phone Screen Questions (added this in response to your edit. This isn't C++-only, but a lot of it applies to C++ and I think would be a good read in your situation).
Now, for completion's sake, some books:
Scott Meyers "Effective" series (Effective C++, More Effective C++, Effective STL)
Herb Sutter's "Exceptional" series (Exceptional C++, More Exceptional C++, Exceptional C++ Style)
The C++ Standard Library by Josuttis
C++ Primer by Lippman et al
Stroustrup's text as a reference
I have interviewed several candidates specifically focusing on their C++ knowledge, and if there was one question that worked well to put peoples' knowledge of C++ on a gradient, it was this one:
Fix this memory leak as robustly as you can:
void doSomething()
{
Foo* pFoo = new Foo();
[do some stuff]
}
+1 for putting delete pFoo at the end
+2 for putting pFoo in a std::auto_ptr
+3 for knowing what RAII is - the concept, if not the acronym
+4 for mentioning exception-safety guarantees of the auto_ptr
+5 for putting pFoo in a boost:shared_ptr
+6 for knowing when a shared_ptr might not be freed.
+7 for talking about garbage collection techniques to fix circular references
This always worked to show how long someone had been working with C++. This is one datapoint you can use to tell where you are in the scale of C++ knowledge.
Edit: I would recommend someone for hire at level 3 or above.
Try some practice problems on TopCoder.
Check out Marshall Cline's C++ FAQ. Its a good way to learn some new stuff and bone up on the things you already know in case the decide to ask you some 'knowledge' questions as opposed to 'problem solving' questions.
Grab a knowledgeable friend and have them ask you some C++ programming problems that you can solve on a whiteboard. A lot of interviews will have you solve a problem on a whiteboard, and it can be disconcerting to think on your feet and write things out in front of someone if you are not used to it.
Even if they're interviewing for a C++ position not all questions may be specific to C++. For example, I've been hit with questions related to the following all in the same set of interviews for a single C++ position:
Algorithmic complexity of well known sort and search algorithms
Multithreaded programming
Multiprocess programming
Sockets programming
Software development philosophy / approach
Software test and validation philosophy / approach
Debugging
Benchmarking
Dynamic and static analysis of code (e.g. run-time memory leak detection vs compile-time)
In my case, the phone interview was part of a screening process to determine if I could take an online C/C++ knowledge test (e.g. through BrainBench). The online test results then determined if I would be flown out for on-site interviews, which also included more "hands-on" software development tests.
YMMV. A lot depends on what you claim on your resume, as well.
Interviewers often try to help you by giving you hints so that they can see if you can arrive at the answer they're looking for. Besides gauging your knowledge, they also want to see how you think. Occassionally you might get a crummy interviewer that is neither helpful nor positive. The key is to be confident in your abilities and be truthful.
HTH and good luck!
Something which I am starting to believe is that there is sometimes a clear divide between candidates that enjoy programming as a hobby versus those who consider it "just a day job".
Even if you don't know the answer to a specific question it is worth mentioning that normally you'd look up the answer on < your favourite resource > (eg. StackOverflow).
Based on your experience I don't think the interviewer will expect that you'll get every question right. They're most likely trying to decide if you've got "potential".
So relax and try to enjoy it!
Besides the obvious parts of the language, I've found that employers will want to see if you fully understand pointers, references, how copy-constructors come into everything, probably STL, and of course the basics of classes.
Read (or skim, depending on how much time you have to prepare) "Large-Scale C++ Software Design" by John Lakos. Chances are, you will need it.

C++ and STL refresher course [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 8 years ago.
Improve this question
I know C and C++ quite well. I know in much detail about pointers and well versed with pointer arithmetic and worked on Win32 API and a bit of MFC as well in my university days. In my previous job, I had no chance to look on these matters and worked in some other domain. Now what I want is a crash or refresher course in:
C++
STL
I do not want to go through 500+ pages of books because I know C#, Java, Ruby, Python and even x86 Assembly as well. What I want is to cover advanced and dark corners of C++ and intermediate STL.
Can anyone point out good links about it?
I know about Google! ;-)
But an intelligent human recommendation is something else yet Google has not implemented.
SGI has a pretty nice reference for STL.
As sort of a path to a deeper understanding of the STL you may want to take the time and watch some of the videos at http://www.stepanovpapers.com/. Also "Notes on Programming" http://www.stepanovpapers.com/notes.pdf will also help you understand the "Why" behind the design of the STL.
I'm not quite sure what you mean exactly by advanced C++ and intermediate STL.
The C++ FAQ Lite helped me a lot when I first started with C++.
www.cplusplus.com I like this site a lot
A quick read through of one or more of the 'Effective' books by Meyers and/or the 'Exceptional' books by Sutter would make a nice refresher course. They're short and generally easy reads for someone who's not a novice, but they'll refresh your memory on some of the edge cases you need to know about.
Read STL - C++ feeds on stackoverflow =)
comp.lang.c++
comp.lang.c++.moderated news groups
Herb Sutter's "Guru of the week" - http://gotw.ca/gotw/index.htm
Start learn boost (boost.org), it will be good way to refresh c++ and stl.
C++ Coding Standards : 101 Rules, Guidelines, and Best Practices (C++ in Depth Series) - small and easy for reading in subway book. It helps you refresh your knowledges.
Other books from "C++ in Depth Series" nice too.
For me, the best book on the STL is "Generic Programming and the STL" by Matthew H. Austern. It explains the STL very well from a conceptual point of view, rather then being a reference or tutorial on how to use it.
Some YouTube videos to refresh memory:
STL vector part 1
STL list part 1
I faced the exact same problem about 4 years ago. Moving from a java role back to c++.
The most useful book I found was "Effective STL" - Scott Meyers. This explains how to use the stl properly once your head gets around this your other C++ knowledge will come flooding back.
If you are struggling or still unsure of all the intricess of c++ after this read "Effective C++" and "More Effective C++" by the same author. All the Effective books are short and concise.
Also I always have Stroustrup's book on my desk, And I dip into it as I need to.