DEV Community


Learn Problem Solving Before Syntax!

realanitaolsen profile image Anita Olsen ・1 min read

I have spent all my time learning about syntax, variables, functions, loops, arrays and etc. I have also worked on several projects with the help from learning to code sites, and some I have also made on my own without any guidance. Lately, I came over the following quote which made me rethink the approach I have taken so far:

The biggest mistake I see new programmers make is focusing on learning syntax instead of learning how to solve problems. - V. Anton Spraul

It seems very important to learn problem solving before syntax. I had no idea. I wish somebody made me aware of this sooner. What are the advantages of learning to solve problems before learning a programming language for the first time? Is there any books out there which are good at teaching how to solve problems?


Editor guide
rhymes profile image

Hi Anita!

I have to admit that I learned both at the same time. I, without knowing it of course, viewed the programming language syntax as a way to express problem solving. One thing they sometimes do in classes is to use pseudo code as a way to express solutions to those problem. Or you can use plain enligsh (or any other language that suits you) as a tool.

What I'm trying to say is that, even if I agree with the quote, not everybody is the same and you can hone your skills at problem solving and pick up a language at the same time.

Python was what clicked the most for me back in the days, especially because it didn't have too much syntax to learn in the first place.

I can suggest two books that really stuck with me:

  • The Pragmatic Programmer: it was written in 1999 , ages ago but I think it's still valid today. Written by the duo that contributed to spreading Ruby to the western masses in the early 2000s.

  • Getting Real: this is not strictly about solving problems but it's a collection of essays on how web development works, a book of ideas as they call it. Among the authors there's the inventor of Ruby on Rails and other successful entrepreneurs.

scottishross profile image
Ross Henderson

You're absolutely correct that Problem Solving is a skill that should be at least understood before you can really dive into the world of development. I know when I was learning SQL from a big book that we have in the office, one of the first examples of a SELECT query was:

select product_name, stock_level * product_cost as total from stock

And to clarify this statement, the author suggests to write it out in English like this:

"I want to get the total cost of all of the product's that we have in stock".

I suddenly understood what I needed to do. As simple as that query is, in my head I knew exactly what I wanted so I knew how to find it.

lysofdev profile image
Esteban Hernández

I totally agree with you. Problem solving and a "programmer" mind set is more important than the specific syntax of any language. However, how are we to learn the first without the latter? One of the things that makes programming so much fun is the fact that you learn by doing, especially at the early stages when most topics will seem too abstract unless a concrete, code example demonstrates it.

My first programming language was Java which probably made it harder than it had to be. I learned Python a few months later thinking I'd be spending another three to four months just figuring out what was happening only to discover that most knowledge is transferred and syntax is easy to debug.

Anyway, I recommend "Grokking the Algorithm" and "Cracking the Code Interview" for books on problem solving. Both of them follow a similar format of giving you a light background on theory and then discussing strategy on a high level for the most common scenarios we face in development. They're great as a primer before reading more theoretical and mathematical tomes.

lkreimann profile image
Lea Reimann 🦄

Hi Anita,

I have Think Like a Programmer by V. Anton Spraul in my ebook library. Haven't read it yet but will try to read it as soon as I can, because I often face programming problems I can't really break down into solvable bits..

johnnytwowheels profile image

As an extension of this discussion, I'm contemplating the relationship between curiosity and problem solving. Does a relationship exist? Is one or the other causal or correlative? I cannot remember a time in my life when I wasn't curious or when I did not enjoy problem solving. It seems in my own life that coding was just an outworking of curiosity and problem solving. Most people I've met in the IT world seem to have these traits and they show in all areas of their life. I've run into a few folks that want to get into computers/programming but seem to lack these traits and I honestly don't know what to say or do for them. Can curiosity be developed, jump started, nurtured? So, Anita, to your point, I do think we could help people entering this field of study by letting them know that programming, and indeed most of IT is about problem solving. If one is not given to problem solving, coding might not be a rewarding pursuit. I'd like to hear other's thoughts on this.

chustedde profile image

Natural curiosity is definitely a common trait among IT people, regardless of role. Plenty of non-IT people always ask us, "How did you become so good at x?" or "How did you learn to use y?" and the answer is usually "I just poked around until I figured it out." This is usually not the answer non-IT people want to hear.

In my personal experience, the best way to help nurture curiosity in people like that (who do not naturally want to take everything apart, find all the settings, and press all the buttons) is to reassure them that they won't break anything, even if it means setting up some sort of sandbox environment for learning. Taking away that fear of ruining things is often the first step toward curiosity-based learning.

tchaflich profile image
Thomas C. Haflich

How I learned problem solving was finding some problems to solve.

Working on practice stuff and tutorials that have everything laid out for you isn't very compelling. Find a small pet project of your own - just make up something that sounds cool, doesn't have to be useful - and smash at it until it does what you want. Google everything you have questions about.

If you're looking to stretch your brain a little, I'd look for logic puzzles. A book recommendation I have here is The Lady or the Tiger? and Other Logic Puzzles by Raymond Smullyan. It was the first books of its type that I read and does its job well. It's not computing problems, but logic and mathematics are closely related enough that I can recommend this genre with confidence.

adam_cyclones profile image
Adam Crockett

I wish I could solve the problem of learning Rust Lang syntax.

rafaelassumpcao profile image
Rafael Assumpção

I bet if you read this entire book, you will fully grasp rust syntax. =)

kyleljohnson profile image
Kyle Johnson

Bingo! You are dead on. Programming is 90% logic! The other 10% is a mixture of syntax and other.