Ask HN: Are there any resources to learn how to think about programming?
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 think 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.
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.
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.
12 comments
[ 5.4 ms ] story [ 39.6 ms ] threadAt least one version available here: http://sicpebook.wordpress.com/ebook/
Some other foundational texts I'd recommend:
* "How to Solve It" is a (the?) classic introduction to mathematical problem solving. http://en.wikipedia.org/wiki/How_to_Solve_It
* CLRS ("Introduction to Algorithms") is the classic introduction to solving problems through computation: http://en.wikipedia.org/wiki/Introduction_to_Algorithms
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:
* 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.
* 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" (http://www.infoq.com/presentations/effective-api-design).
* A recent talk I found insightful is Rich Hickey's talk, "Simple Made Easy" (http://www.infoq.com/presentations/Simple-Made-Easy). 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."
*I would highly recommend the "Destroy All Software" screencast series by Gary Bernhardt (https://www.destroyallsoftware.com/screencasts). 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.
[1] http://en.wikipedia.org/wiki/Programming_in_the_large_and_pr...
The problem with CLRS is that I haven't had a discrete mathematics course yet, so the math involved in the book is way over my head right now.
Thank you for providing all those resources. I'll definitely make sure to check into the remaining books and lectures.
You raise a good point about discrete math, let me add the following to my list above:
* MIT's 6.042 ("Mathematics for Computer Science") Lecture Notes start at first principles and go on to cover relevant discrete math topics motivated by common types of computer science problems.
http://ocw.mit.edu/courses/electrical-engineering-and-comput...
Also, Project Oberon by Niklaus Wirth, for showing how it can be done well and clearly.
SICP and How to Solve it, as others have recommended, are also great, ditto Project Euler.