r/learnprogramming • u/Beneficial_Display76 • 12d ago
Programming help
How to think logically? For example - for programming we need logical and problem solving skills ? How do I develop it ? I do not want to learn only syntax or memorizing it
3
u/Blissextus 12d ago
Learn Pseudocode.
Problem solving typically involves layout out a solution in a "step by step" fashion until the problem no longer exists. This is where Pseudocode come into play. Pseudocode offers to lay out a solution step-by-step, in human readable words, charts, and/or diagrams until the solution is solved. Then translate that solution over to code.
3
u/MyNameIsRichardCS54 12d ago
If you're stuck, break the problem down into a series of smaller problems and solve them. It gets easier with practice.
1
u/waffleassembly 12d ago
I took logic in college and it helps. There must be some equivelence somewhere on the internet. Unfortunately there are no serious logic courses on Khan
1
u/somethingshiney 12d ago
Syntax is part of the journey to develop logical code construction. It's not two independent silos. Generally, syntax is like addition. It's a fundamental concept, a tool in the arithmetic toolbelt. Your question sounds like you can barely count. Pick a language, learn the basic things like: arithmetics, data types, declaring and instantialising. Do some data manipulation. The logic part comes through when you stop fighting with the language syntax
1
u/BotSlamminDayNNight 12d ago
flowcharting is a good language-less and syntax-less logic exercise. learn the uml patterns, with focus on activity diagrams. pure logic.
1
1
u/DrShocker 12d ago
Just solve more problems. In high school my friends and I solved every problem on codingbat just because we could. 🤷
1
1
1
u/Revolutionary_Log673 12d ago
My professor made us do pseudo code and write down every step that was the basic thing I learnt and then never forgot
1
u/RyanDubois43 12d ago
Work through at least 50 small problems on LeetCode or HackerRank, even the easy ones force you to break a problem into steps. Syntax gets easier after, but the logic comes from repetition like this.
10
u/aqua_regis 12d ago
Oh, the daily "How to I improve my logic" post. Bit late today.
You should and could have searched the subreddit. There are more than enough similar posts - even in the past 48 hours.
You need to solve problems to train your problem solving skills. Tutorials are not going to teach you such skills.
There are already more than enough similar posts. Below are some of them:
https://redd.it/1r74ayc
https://redd.it/1r6qujh
https://redd.it/1r6qfap
https://redd.it/1qdfc9k
https://old.reddit.com/r/learnprogramming/comments/1pmzjoe/how_do_you_learn_programming/nu4ufej/
https://redd.it/1pmzjoe
https://redd.it/1p7bv8a
https://redd.it/1oynnlv
https://redd.it/1ouvtzo
https://redd.it/1opcu7j
https://redd.it/1on6g8o
https://redd.it/1ofe87j
And finally, some book suggestions:
"Think Like A Programmer" by V. Anton Spraul
"The Pragmatic Programmer" by Andrew Hunt and David Thomas
"Structure and Interpretation of Computer Programs" (SICP) by Ableton, Sussman, Sussman
"Code: The Hidden Language of Computer Hardware and Software" by Charles Petzold
Last, a great practice site: https://exercism.org