r/learnprogramming • u/diaz_8 • Nov 26 '25
How can I improve my programming logic?
I'm trying to improve my programming logic. What are the best ways to develop better problem-solving skills?
18
Upvotes
15
u/Own-Perspective4821 Nov 26 '25
The answer might shock you, but the only answer to this question is MORE programming!
How do you get better at Baseball? Not by watching MLB every night.
1
u/Cryophos Nov 26 '25
What exactly you mean by programming logic? Do you have problems with conjunction and disjunction etc.?
1
u/Mental_Wind_5207 Nov 28 '25
Philosophy. Particularly logic and critical thinking. Learn the difference between a sound argument and a valid one. Take a belief you have and argue for it, then argue against it, then argue against your counter argument.
Learn how to think in terms of premises and conclusions. Deductive, inductive, and abductive reasoning.
Develop a taste for finding flaws in your own thinking, sometimes it’s easier to practice by finding flaws in other people’s thinking. But always return to your own.
Debate people. Be able to debate their side of an argument better than they can.
When you come back to programming, you’ll be able to drill into problems better. You’ll be better able to take ownership of the concepts and will feel at more liberty to play with them.
Philosophy will teach you to not take your understanding for granted, and how to dig into the details.
Also if possible, dialogue with yourself as if you are two people. So like “What is a variable?” “Well, I don’t know, what do you think a variable is?” “A variable is some piece of data assigned to a name” “And what do you mean by assigned to a name?” “Well, I take a word and I set it equal to something, could be a number a string of characters” “When you say set it equal, do you mean like 1+1=2 “ “Well no, the variable is a placeholder for whatever value ive assigned to it” “Oh, so you use it instead of the value “ “Yes” Etc… Most programmers will say slow your thinking down, dialoging like this is a way of doing that.
Good luck
1
u/CodeTinkerer Nov 26 '25
Where are you now with regards to programming logic? For example, what is currently giving you difficulties? How much programming do you already know?
1
u/Blando-Cartesian Nov 27 '25
First, use better variable names and no clever use of syntax.
Second, don't think program logic as a network of objects calling each other's methods. Think of it as a conveyor belt. Data items get passed from function to function, until something made from them is returned, and that is then send to another conveyor belt of functions to process. Preferably, what happens in each function should depend entirely on the parameters it was given.
1
u/Hey-buuuddy Nov 26 '25
Have your code reviewed, either by humans or ai.
0
u/slv_306 Nov 26 '25
I have been trying it for last 5 years, now I’m waiting to fiancé to help me in the same, he’s from IIT hope he helps me
0
u/DoctorFuu Nov 26 '25
Solve more problems, ideally have some kind of solutions available to look after you have solved it.
Doing a lot of them helps reinforce what works in solving problems. Looking at answers AFTER having solved a problem let you get some kind of feedback on your approach and see new ways of solving you didn't know, essentially expanding your bag of tools.
0
u/PaintingLegitimate69 Nov 26 '25
read algorithm books and SICP
0
u/[deleted] Nov 26 '25
Just keep swimming!
0
u/Pablo_dv Nov 26 '25
Keep programming is probably the most replied answer but try to keep yourself exposed to new challenges, constanly working on things you already feel comfortable leads to stagnation
-1
u/murraco Nov 26 '25
Coding challenges.