I'm a college sophomore. I've taken various C++ programming classes, and I'm currently in C++ Data Structures. While my assignments have been fairly challenging, I was never really taught how to <i>think</i> about tackling programming problems. I'd write down some pseudocode, then proceed to hack code together until the program met the professor's requirements. The whole time I feel like I'm shooting fish in a barrel hoping I get something instead of coming up with a proper strategy for achieving what I want.<p>I've purchased tons of programming books, but they merely explain language syntax. I don't want to learn how to declare variables and use loops, I want to learn how to approach a difficult problem, break it down, and come up with a proper solution. I want to develop a mindset for problem solving and programming, not learn more syntax.<p>I know the only way to improve in programming is by practicing, but programming is hard to do without a proper foundation in problem solving.
"Structure and Interpretation of Computer Programs" (SICP) by Abelson and Sussman is a must read.<p>Some other foundational texts I'd recommend:<p>* "How to Solve It" is a (the?) classic introduction to mathematical problem solving. <a href="http://en.wikipedia.org/wiki/How_to_Solve_It" rel="nofollow">http://en.wikipedia.org/wiki/How_to_Solve_It</a><p>* CLRS ("Introduction to Algorithms") is the classic introduction to solving problems through computation: <a href="http://en.wikipedia.org/wiki/Introduction_to_Algorithms" rel="nofollow">http://en.wikipedia.org/wiki/Introduction_to_Algorithms</a><p>Those texts are useful for "programming in the small." [1] As you get closer to "programming in the large" (basically putting together non-trivial software systems), some good things to look at are:<p>* The "Gang of Four" book ("Design Patterns: Elements of Reusable Object-Oriented Software") introduced the idea of design patterns to software engineering and provides a useful toolbox and vocabulary for thinking and talking about putting programs together.<p>* Joshua Bloch's "Effective Java" is an insightful set of heuristics on writing good code. Like with Gang of Four, you can get a lot out of this book by looking past the implementation language and thinking critically about the rationale behind the prescriptions in the book. I'd also recommend Bloch's talk, "How to Design a Good API and Why it Matters" (<a href="http://www.infoq.com/presentations/effective-api-design" rel="nofollow">http://www.infoq.com/presentations/effective-api-design</a>).<p>* A recent talk I found insightful is Rich Hickey's talk, "Simple Made Easy" (<a href="http://www.infoq.com/presentations/Simple-Made-Easy" rel="nofollow">http://www.infoq.com/presentations/Simple-Made-Easy</a>). In this talk, Hickey makes a strong argument for simplicity in software and the ramifications for the working programmer. I'd also recommend his talk, "Hammock Driven Development."<p>*I would highly recommend the "Destroy All Software" screencast series by Gary Bernhardt (<a href="https://www.destroyallsoftware.com/screencasts" rel="nofollow">https://www.destroyallsoftware.com/screencasts</a>). These screencasts show an experienced developer working through small programming problems in a test driven style and explaining the reasoning behind his decisions as he goes along.<p>[1] <a href="http://en.wikipedia.org/wiki/Programming_in_the_large_and_programming_in_the_small" rel="nofollow">http://en.wikipedia.org/wiki/Programming_in_the_large_and_pr...</a>
You might consider reading "Structure and Interpretation of Computer Programs" (SICP) by Abelson & Sussman<p>At least one version available here: <a href="http://sicpebook.wordpress.com/ebook/" rel="nofollow">http://sicpebook.wordpress.com/ebook/</a>
Try solving riddles, mathematical problems, etc. That might help to get you into the right frame of mind. Don't shoot fish in a barrel, try to think about a problem at first. What is the problem, what are you trying to solve? Now, think of the approaches to solving it. How do you get the answer? Then fool around, and twiddle with things until it works. Try to separate problems into types of problems, each type requiring a certain type of solution, and fit you problem into these lists. Just my two cents.
In addition to all the wonderful resources already suggested above, you should check out the MOOCs on Mathematical Thinking (<a href="https://class.coursera.org/maththink-2012-001/class/index" rel="nofollow">https://class.coursera.org/maththink-2012-001/class/index</a>) and Algorithms (<a href="https://class.coursera.org/algs4partI-2012-001/class/index" rel="nofollow">https://class.coursera.org/algs4partI-2012-001/class/index</a>) on Coursera.
Try "A Discipline of Programming" and "Structured Programming" by Edsger Dijkstra (the second with co-authors C. A. R. Hoare & Ole-Johan Dahl).<p>Also, Project Oberon by Niklaus Wirth, for showing how it can be done well and clearly.<p>SICP and How to Solve it, as others have recommended, are also great, ditto Project Euler.