DEV Community

Roman Mikhailov
Roman Mikhailov

Posted on

Learning to think like a programmer.

I’m looking for a book (video, blog, or online course) for Somebody who just learned their first language. They know the “words”, but what will help them to write “poetry” - solve problems using computer programming? Ideally, this book will teach them the art of thinking like a programmer. It will teach them techniques to approach a problem, analyze it, come up with a solution, validate and troubleshoot it. Think whiteboard sessions at an interview.

I’m not looking for a book that concentrates on teaching a specific language like python or c++. Preferably such book assumes minimum computer science knowledge and should heavily use pseudo code, flow charts, diagrams or other ways to generalize concepts, but if it chooses a language to show implementation, that’s OK too. As long as the language is not the main topic.

What was your favorite book, video or lesson to learn thinking in code?

Top comments (33)

Collapse
 
vithabada profile image
Vít Habada

Stop looking for a book. Best advice, I think, is to just write code. It will, eventually, turn into programming.

Learning to think like a programmer on some basic, novice, level is very much like learning a language. And one learns a language by memorizing a bunch of stuff and then speaking.

Once bigger challenges arise, one has to study. And one is able to study, only if they speak the language.

Collapse
 
jacoby profile image
Dave Jacoby

The pitfall of just write code, of course, is that the conventions and protocols and styles you're "of course" about (because you learned it all yourself) are things that may drive others batty. Like my preferred indenting scheme.

So, additionally, reading code and asking questions to other programmers should be part of the process as well.

Collapse
 
vithabada profile image
Vít Habada • Edited

I really don't think that a novice, that is just learning to think algorithmically should focus or be able to focus on following some conventions. As you say, one can 'learn that for himself'.

First thing to master is putting a thought into code. Conventions and best practices just add a layer of overhead on top of that.

So, additionally, reading code and asking questions to other programmers should be part of the process as well.

Definitely.

Collapse
 
itscoderslife profile image
Coder

Try "The Pragmatic Programmer" book - amazon.com/exec/obidos/ASIN/020161...

And here is the recommended list by CodingHorror.com site:
blog.codinghorror.com/a-pragmatic-...

Collapse
 
rommik profile image
Roman Mikhailov

Thanks for the suggestion. It is a good book, but unfortunately not for this case. It is too broad. I'm interested in just how to teach to learning to solve problems and think in "code".

Collapse
 
regul4rj0hn profile image
Mauro Lavigna

Was going to recommend this one as well, but I looked in the comments first cause I'd be amazed if I was the first one to do so.

Collapse
 
websvc profile image
WEBsvc

In my opinion, well....
A book might teach a lot of stuff but...
It might also teach how to cover a load of concepts, but the essential for me is, not even if a developer has much knowledge, to be thistthy for knowledge, to be curious, to have logical thinking, to be smart enough to see a problem for various points of view
A developer in my opinion must be able to do that in a natural way
I work on a daily basis with dozens of developers and it is desolating to see people that make basis mistakes just because they don't stop for 2 seconds and think!
A developer, more than "shith" code must be able to think, and then put into code

When a developer does code without thinking, shit happens, and I see that too many times!
A developer will not do it the correct way at the first time. It will learn with mistakes,and comparing results. For that he must be able to think!

I'm a developer for 15 years plus, and I manage a couple teams at the moment.
I did not learn from a book or school! My studies area is electronics, which I think it is really a good entrance point to development because of of the necessity of logic thinking and understanding.
I had fresh computer science engineers working for me that could not even understand how a print or echo works... Hence they are ingineers . Yes!

Learn, test, give yourself to the "cause", make mistakes. Can you understand your mistakes? No? Try again then!

But this is only my opinion and experience.
Have a good one. And put your best into it.
Namastê

Collapse
 
pedro2555 profile image
Pedro Rodrigues • Edited

I would suggests intro to computer science MIT opencourseware lectures on youtube

Not a book, I know, but they give exactly what your looking for. Plus they use python

Collapse
 
wavell profile image
wwatson

Well it's kind of a book. Sicp (structured interpretation of computer programming), and I'd recommend that as the best programming book ever written. But my personal favorite is the little schemer. Teaches you how to think for sure

Collapse
 
courier10pt profile image
Bob van Hoove • Edited

You can check out SICP for free. Nice to see it being mentioned.

It might be too much in depth depending on the audience :)

Collapse
 
dpashutskii profile image
Dmitrii Pashutskii

This! SICP indeed is the best programming book ever written. This book literally changes your perspective.

Collapse
 
codingarchitect profile image
Sendhil Kumar R

If you are short on time, this is a second best after SICP. Good Suggestion again.

Collapse
 
codingarchitect profile image
Sendhil Kumar R

I highly second this. Good Suggestion

Collapse
 
vingam profile image
Vincent

I used to ask myself this same question once, "how can I think like a programmer?" I actually didn't find any useful books or courses on this, just a couple of articles that hepled me a bit, I started from them, then on my own.

If you're interested:

Hope you find them at least a bit useful.

Collapse
 
humzakhan profile image
Humza K.

I was in the exact same position when I was learning to program, and I was glad someone game be a wonderful piece of advice. The only way you can force yourself to think programmatically is actually by writing code. Pick a project, and start working on it. Then look into ways you can improve your overall architecture of the application, get feedback, make it public. Fix the vulnerabilities and flaws.

You can always pick a random book and start learning, but our brains aren't designed to retain theoretical information just by reading it. We LEARN BY EXPERIENCE. Until or unless you experience it firsthand, you will never retain that piece of information in your mind. I went through countless videos, books, articles and so on, but I only remember the things I learned AND applied.

You first few projects will suck for sure, but as you proceed, you will see for yourself that you are getting better day by day, all by the power of trial and error. Take this approach and you will good about it later on. I know this because I do.

Collapse
 
odonacer profile image
Roman Bardachev • Edited

You can try to google for articles like “don’t learn how to code, learn how to think”, there I think you would find answers. Also, take a look at edx’s CS50 courses - they have courses for Webdev and mobile dev. There’s good explanations how things are built, so understanding how to develop and think like a dev should be obtained after watching those courses.

Collapse
 
mazyvan profile image
Iván Sánchez

One of my favorites by far is Clean Code by Robert C. Martin. It's not about data structures or algorithms but definitely is about writing poetry. It theach you how to write beautiful code that it's not only readable but also scalable.
His author is one of the impulsors of agile. He and personalities like Martin Fowler, Kent Beck, Michael Feathers or Dave Thomas are the heroes that made and/or populated the software development process and practices that lets the industry moves fast but with confidence.
At the end of the day there's one editorial that you really need to know. It's name Addison-wesley. Ones of the best books in the field are written under that publisher

Collapse
 
buinauskas profile image
Evaldas Buinauskas

I recently read The Art of Unit Testing. Really useful and helps to understand importance of automated testing and some design principles.

Collapse
 
nathanbq profile image
Jonathan Bohorquez

Hey there Roman, I think that what you're looking for is that scenario where you as a software engineer or developer feel comfortable in the way you approach to problems, That scenario is full of many variables and those variables are different according to the people who is seeing the problem, but sometimes there are some basic useful advises:

1) Understand or domain the basic of what your doing (programming, solving a problems, developing an Algorithm etc)
2) Read and isolate those errors that might be causing you troubles in your labor in order to fix them.
3) Know when to stand up and give yourself a time for breath and relax.

pd: this is not a book, or youtube video or tutorial, but I hope it might be useful to you. Cheers and keep coding, that is what make us develop that "Thinking like an engineer or programmer".

Collapse
 
alexgwartney profile image
Alex Gwartney

Honestly you really can’t learn how to think in a specific way. You can defiantly learn from books on how to utilize and build things with a certain language. But in order to learn how to thin like a programmer you just need to build stuff. And evrey thing else will start falling into place. Because you will be able to start to learn how to break problems down and structure the program ect. So you might want to look at as what is it you want to program. And what language do you want to program in and then take it from there.

Collapse
 
rommik profile image
Roman Mikhailov

Of course it matches the name of my question, but can you elaborate why this book is the best answer?:)

Collapse
 
iam_timsmith profile image
Tim Smith

I agree with some of the things that have already been suggested such as code a lot and checking out other people's tutorials. In addition, I'd add learn to read documentation. A lot of times tutorials won't use best practices because they are still learning the subject too or they're looking for an easy way to set something up for the tutorial.

Learning how to read the official documentation for the language/framework/tool will go a long way to teach you how the tool should be used and what the best practices are when using it. It can also put you miles ahead in terms of how to do something with the tool than someone who has to sift through several mediocre tutorials.

Collapse
 
mrlarson2007 profile image
Michael Larson

The first part of my answer is why focus on "thinking like a programmer"? I think the reason why we all became programmers is because we love to build things and solve problems.

So if we look at it from that angle what will help us do this? The first key is understanding any computer language is really made up of only three things: sequence, selection, and iteration. Sequence is the idea that our code instructions execute in order they are written in code. Selection are the handy if statements we use everywhere. Iteration is loops. These are our building blocks.

Our tools to put it all together? One I love is TDD. I think this way of working helps you because you focus on little pieces at a time. One important lesson any dev needs to learn when starting out, don't over engineer things! Also the idea is we try to come up with the simplest way of solving the problem first then try to optimize when we see bottle necks. The other tools are learning design patterns enough to know to at least look at them when you see certain problems. Anther good idea is look at some of the classic computer science agolthrims. And also the books everyone is suggesting on writing code that is easy to understand and maintain over the long term.

Collapse
 
cheetah100 profile image
Peter Harrison

"Stop talking about how to be a good man and be one" - Marcus Aurelius.

This is getting a bit repetitive, but there is no way to short cut coding experience. First you need to learn the basic concepts until it becomes second nature. Once you have the foundations you can begin to exercise these skills in developing real systems.

Passive learning is not nearly as powerful as active learning where you experience feedback. The feedback process reinforces neurological pathways, which is the definition of learning.

This feels a little like the ten year old asking me what books to read to quickly become a black belt; first you learn the basics. Then you practice. Then you practice some more.