How can I improve my logical and mathematical think to be better programmer?

Solve mathematical problems. This can be a good source : Brilliant | Excel in math and science.

Another website is this: HackerRank

Try out different languages.

Strive to do the basics very well. Continue doing it until “basic” leads you to think that “finding the number of paths in an hypergraphe using each node once” is trivial.

Don’t fear vocabulary. Admit you don’t know and Google it / look it up.

Know how you think, study or at least consume material about psychology.

This is a good starter : List of cognitive biases

This can be fun : piaget tasks - YouTube

Here is some good things to relax & lea

Solve mathematical problems. This can be a good source : Brilliant | Excel in math and science.

Another website is this: HackerRank

Try out different languages.

Strive to do the basics very well. Continue doing it until “basic” leads you to think that “finding the number of paths in an hypergraphe using each node once” is trivial.

Don’t fear vocabulary. Admit you don’t know and Google it / look it up.

Know how you think, study or at least consume material about psychology.

This is a good starter : List of cognitive biases

This can be fun : piaget tasks - YouTube

Here is some good things to relax & learn :

These are in French, maybe you will find the equivalent in English or your native language:

Oh, and by no means discard a topic too easy for you or that you already know.

Lot of people can add together 15 and 17 but don’t understand this:

xi+yi=(xi+yi)∑xi+∑yi=∑(xi+yi)

Though they will do :

10+10+5+7=20+12=3310+10+5+7=20+12=33

The process is really dead simple.

And least but last, don’t “force” it. Enjoy and don’t bother to retain. You will be exposed enough to naturally hold it. It will last far longer and your comprehension will be far better.

On mobile, I play few games:

On PC, I play these:

I can give you a 100% guarantee that if you become good at these, then you will be a far better developer :-)

I learned BPMN and UML 2 and still learn bits too.


If you repeat the same thing over and over, your brain will rewire to be more efficient at doing a specific task. This may lead to some deformations of your reality.

If you do various tasks, your brain will mostly keep its plasticity. What will be more efficient is the intrinsic properties of problem solving. You will become better at finding patterns, avoiding common pitfalls (biases), being critic.

And yes, watching a Youtube video can be as beneficial than stretching your brain in any of the game above.

Be exposed to new stuff regularly.

Some people will find me crazy, but most of them wouldn’t be able to complete or play efficiently at game shown above.

To give you an idea, I can complete this : from Simon Tatham's Portable Puzzle Collection in few seconds. And that one in one minute : from Simon Tatham's Portable Puzzle Collection etc.


What I learned from these games is to apply correctly the scientific method. When I have to hunt a bug, I do exactly the same thing than when I discover a map in Factorio etc. I look at what I have, how I can eliminate the components until the segment under test is so small I can run it in my head ! Then I do what I call “cold” debugging. Once it’s done, I write the unit test to reproduce the bug, then I correct it.
(Well, sometimes I skip the unit testing writing phase, but let’s keep it secret!)

To come back at the beginning of the answer, program in C, Java, Assembly, APL, PHP, Perl, Javascript, Haskell, Kotlin, Elm, … snups ! Even Labview if you can.

At some point, you will realize that what count are idiomes and not languages per se. And how to go from one idiome to another.

But hey, we all started by “loops” and “alternation” :-p

I think you'll get that mostly through programming itself. But anything that stimulates the mind to critical thinking can be helpful. Study philosophy. Learn to make logical arguments, rather than purely rhetorical ones. Listen to this podcast:

philosophy bites

Math is great, but a lot of programming is logic, not math per se.

“Better programmers” are people who are left-brained, and there’s no way you can force which hemisphere of your brain is dominant. If, when you see a problem you don’t also see the solution, find a different area of work. (You might make a great artist - most great programmers can’t draw a straight line - with a program that can only draw straight lines.)

anyone can become a programmer…the real catch is…

it is incredibly mind boggling and frustrating to start with. When this happens the thing that seperates the wheat from the chaff is, the wheat is still motivated to struggle on through …..wheras the chaff lose interest..

programming is a bit like a rubicks cube….those kids that can do it in 10 seconds flat…probably spend a few hours a day just playing with the thing..they are a bit obsessed with the cube ..this obsession leads to them putting in hours and hours and days and years of practice and eventually they can do it in 10 seconds some liter

anyone can become a programmer…the real catch is…

it is incredibly mind boggling and frustrating to start with. When this happens the thing that seperates the wheat from the chaff is, the wheat is still motivated to struggle on through …..wheras the chaff lose interest..

programming is a bit like a rubicks cube….those kids that can do it in 10 seconds flat…probably spend a few hours a day just playing with the thing..they are a bit obsessed with the cube ..this obsession leads to them putting in hours and hours and days and years of practice and eventually they can do it in 10 seconds some literally with their eyes shut…

but they have practiced and practiced.

then you get your mediocre programmers…those are hte kids that also loved the cube but were not obsessed with it ..but could motivate themselves to learn a few rubick algorithms every so often…until they finally cracked the cube…they can do it in a minute or so…and impress most of society who cant do it.

then you get your poor programmers…they wanted to do the cube but after practicing for a few days maybe weeks….eventually found out they would rather spend their time doing something else…and they maybe even learned how to do the cube but they never practiced and did it without help or a video…it was fun for a while ..but not really their idea of everlasting fun…they probably tell themselves and others ..they just cant get it …the reality is they cant be bothered it is just not that interesting to them..give them an xbox and they may be red hot and play all night ..give them an instrument and they may love it and be obsessed or a good book or biology chemistry..if they are obsessed then they will be good…

bottom line ..all are as capable of doing the rubick cube ..just like all are capable of programming…but when the going gets tough, will you have the patience to sit down and battle and battle and remain motivated …are they that interested .

if so they will become good programmers…if not they will maybe even get a job as a programmer,but will always be watching the clock and find their days tedious and complicated, because they really have no interest any more.

Logical thinking and problem solving skills, contrary to much public opinion and even college classes, etc. has nothing to do with how much knowledge or information is in your head it also isn’t just a trick in the way you think… it takes serious wisdom and understanding the big-picture about how things work, in reality, generally and specifically. You can’t ever get that from anyone else. The best teachers are people who guide you to discover truth. Actual teaching is becoming extinct in our society. Our schools, k-12 and even colleges are filled with “tellers” and very few actual “teachers”

Logical thinking and problem solving skills, contrary to much public opinion and even college classes, etc. has nothing to do with how much knowledge or information is in your head it also isn’t just a trick in the way you think… it takes serious wisdom and understanding the big-picture about how things work, in reality, generally and specifically. You can’t ever get that from anyone else. The best teachers are people who guide you to discover truth. Actual teaching is becoming extinct in our society. Our schools, k-12 and even colleges are filled with “tellers” and very few actual “teachers” any more.

For that reason, serious problem solving and logical thinking skills, are some of the most rare virtues around. Working in nature, where you begin to reap the cause and effects of your own labor, is one of the best habits you will ever develop. Plant a garden, learn how to build things, work with animals, work with your hands and discover for yourself how nature works and the universe operates… but then relate everything to your own life in practical application. It is a good thing to learn from others but learning is not about memorizing, it’s about discovering.

What you want to focus on is discovering principles. Principles are the most precious treasure on earth. they are always hidden beneath and in between what you think you already know. That doesn’t mean that simply working with your hands is the magic. Most people who work with their hands, still haven’t discovered principles.

Only wise and worthy mentors can help to uncover principles for you and then guide you how to discover them through your own practical experience with life. But you must be willing to do the work and discover them for yourself.

Unfortunately, even the vast majority of people who make a living helping to solve problems actually end up creating more problems than they solve because they lack the big-picture of life and reality. That only comes to a small few who have discovered that wisdom is a totally different thing than knowledge. The two are acquired in very different ways. Knowledge is based on information that can be memorized and passed from one person to another. You can stumble upon knowledge through experience but knowledge is all about “answers,” it breeds arrogance and inflated, false pride (most assumed knowledge today is not really knowledge at all but only naïve assumptions, which is really foolishness).

Wisdom on the other hand, is founded on principles. Wisdom is never contented with “answers,” because it knows there is always more…. Wisdom is entirely based on discovering better questions. Answers stop growth, questions demand and perpetuate growth… Since every piece of real truth is totally interdependent on every other truth, there is always more, better, greater improvements to make, regardless of whether you are at the bottom, top or anywhere between-of what you are trying to understand.

The great masters through time, became great masters because they never stopped learning, discovering and evolving. The only way they remain great masters is by never losing track of their leaders, mentors, masters….

Beware, however many, many today believe (and/or try to convince you) that they are wise and flaunt their money, positions, knowledge, influence, etc. Many even believe they have risen above ordinary mortals (talk about ego). But the truly wise and their followers are the ones willing to do what the masses are not willing to do… the hardest work they will ever undertake—their own self evolution. Even though difficult at first, it is only way to live with real fulfillment and genuine happiness that doesn’t fade with the lights and the music….

I have come to call, what everyone wants, but only a few have been willing to discover, the most valuable and precious treasure on earth… “The principles that birth intelligence, lead to wisdom and harness the laws of creation.”

Since you are a creator—that’s what you do, every moment of your life—create your own future reality, You can learn to create something much greater than you have done so far, regardless of how little or far you have come.

Once on that path, you will naturally see what is, over ride your ego that desperately tries to get you to find what will pacify you for the moment, so you don’t have to risk failure, and claim whatever rewards you want most. Intelligently taking those risks is the only path to wisdom and wisdom is the only environment that enables one to solve problems and see the perfect logic in the universe—and align your thoughts and behaviors with it…

There is no way to cut corners to gain wisdom—but it is the great shortcut to super success. Everything else is settle-for. You just must make the decision.

The efforts will pale by comparison to the rewards—IF you recognize and accept that it is all up to you, no one can ever come to your rescue, and then make it a life-style. There is no gimmick or tactic or trick, but once you make those commitments, the right mentors will show up and make all the difference.

Learn to love being uncomfortable, pushing yourself out of your comfort zones IN THE RIGHT DIRECTION and the world will be yours.

Let’s go catch your dreams .

Eldon Grant

Before answering I want you to solve these equations mentally, don’t write anything!

Easy write!! Great, now try this

Relatively harder than the first, but of course manageable. Good, try this!

Well, thats much more complicated than the previous ones. But for some, with some effort, manageable.

Programming and logical thinking are exactly like these equations.

You can solve the first one easily mentally. Why? Because it’s easy, and you have solved it many times before.

What about the second one? Manageable? Took a few more seconds, but solving regularly would improve your speed!

And the 3rd? A little

Before answering I want you to solve these equations mentally, don’t write anything!

Easy write!! Great, now try this

Relatively harder than the first, but of course manageable. Good, try this!

Well, thats much more complicated than the previous ones. But for some, with some effort, manageable.

Programming and logical thinking are exactly like these equations.

You can solve the first one easily mentally. Why? Because it’s easy, and you have solved it many times before.

What about the second one? Manageable? Took a few more seconds, but solving regularly would improve your speed!

And the 3rd? A little complicated, too many individual terms to remember for mental solving right! But still manageable with practice!

Being logically strong isn’t as much about increasing your IQ as it is about improving your approach towards solving the problem. And that comes only through practice. The more problems you solve at each difficulty level, the stronger you get at it.

No substitute for practice!

  • Evaluate yourself with how’s and why’s!

After finding the solution to a problem, ask yourself, How can I make it better? lesser complexity, maybe some clever method, an optimised library function - anything.

Read code written by better coders and question yourself Why have they done this! If you find something smart that they’ve done, make a note of it to utilise later.

  • Excercise

Not, just this

but also this is important!

Do activities which improve your analytical and logical reasoning.

Things like playing chess, learning a new language etc imporve your brain. Most importantly interacting with people smarter than you will give you a newer approach to problems and develop your objective thinking. Break things down!

Quoting Henry Ford, “Nothing is particularly hard if you divide it into small jobs”.

The more you exercise your brain, the mentally stronger you get!

  • Solve quality problems!

Doing 100 beginner level problems will not challenge you as much as 5 hard ones. Beginner levels may make you happy, but getting even one hard problem correct, you’ll get a strong sense of achievement and satisfaction!

Its also imperative to understand when to jump levels, take your time to MASTER each level before the jump to a higher one. Increase the complexities of the challenges you face in a timely manner.


Programming is like swimming, you can’t be a sea swimmer and conquer the tides, if you only practice in a swimming pool. Explore things and challenge yourself!

Good luck!

I think most programmers cannot share their thinking styles with non-programmers — as evidenced by the many “Just try harder” answers here. :D

The key to programming is to think as if you’re building a house. The problem with this is, most of today’s population doesn’t know how to build a house.

And instead of purchasing the bricks, you’re making them from minerals you dig out of the ground, one by one. After you’ve poured out thousands of bricks, you have to let them harden for a week. Then you have to use more cement and cement them into place for your house. You have to keep in mind the desig

I think most programmers cannot share their thinking styles with non-programmers — as evidenced by the many “Just try harder” answers here. :D

The key to programming is to think as if you’re building a house. The problem with this is, most of today’s population doesn’t know how to build a house.

And instead of purchasing the bricks, you’re making them from minerals you dig out of the ground, one by one. After you’ve poured out thousands of bricks, you have to let them harden for a week. Then you have to use more cement and cement them into place for your house. You have to keep in mind the design you want, and plan the brick laying accordingly.

Programming is much the same way. When you were pouring the bricks, you weren’t thinking of the house plans. You were thinking about how to make the best bricks possible. When programming, you don’t need to think of the entire program while working on a single function. Instead, make your functions, THEN lay them together to form the planned way you want your software to look. You have to have a vision of how your software should work at this point, just as you have a vision of how your house is going to look after the bricks harden and need to be laid down.

At any time, you can change your design plan because you’ll have the tools you need at this point. First focus on what tools you need. Then bend them to your very will.

Why can’t you solve a problem quickly despite working for 5 years as a programmer?

Probably because your work has little or nothing to do with developing skills required to solve the kind of problems you are trying to solve now.

Why can’t I write code in Perl despite doing competitive programming for multiple years and now working as a programmer for half a year already?

Because I never ever needed that knowledge and that skill. Same for you.

Why do others come with solutions quicker?

Because they have skills and knowledge you don’t have, and they got them from some direct or indirect practice and

Why can’t you solve a problem quickly despite working for 5 years as a programmer?

Probably because your work has little or nothing to do with developing skills required to solve the kind of problems you are trying to solve now.

Why can’t I write code in Perl despite doing competitive programming for multiple years and now working as a programmer for half a year already?

Because I never ever needed that knowledge and that skill. Same for you.

Why do others come with solutions quicker?

Because they have skills and knowledge you don’t have, and they got them from some direct or indirect practice and learning. Maybe they had to solve similar problems during their studies, maybe their work more often requires them to solve problems you are talking about (or problems which require similar knowledge and skills), maybe they enjoy solving challenging problems on their free time, maybe they make these problems easier by applying tricks and techniques you don’t know.

How can you improve it?

By deliberately practicing skills needed to do well on solving such problems. You may look online on how to improve at solving some specific kind of puzzles, you may start with simply practicing these puzzles on your free time, you may look for a job which is more challenging (or is challenging in a way you want it to be challenging).

Sorry, no secret magic here.

  • Code as much as possible… practice is the key…
  • Do not believe that ‘someone’ will teach you entire coding skills. It is true that lectures and teachers may help you, but at the end of the day, you have to give efforts by your own too.
    • Be the incharge of yourself. It will allow you to learn more things quickly. You have not to wait for your teacher to come on that topic.
    • Teachers can only give information, it’s all about you that how you get and learn it.
  • Work on Data structures the most.
  • Must do competitive programming on the language you are interested in.
  • Set practical specific goals and deadlines
  • Code as much as possible… practice is the key…
  • Do not believe that ‘someone’ will teach you entire coding skills. It is true that lectures and teachers may help you, but at the end of the day, you have to give efforts by your own too.
    • Be the incharge of yourself. It will allow you to learn more things quickly. You have not to wait for your teacher to come on that topic.
    • Teachers can only give information, it’s all about you that how you get and learn it.
  • Work on Data structures the most.
  • Must do competitive programming on the language you are interested in.
  • Set practical specific goals and deadlines for learning coding or to make a project.
  • Plan before coding; but planning too much before coding is also bad.
  • Endlessly research technologies without spending time actually writing code is worthless.
  • Choose a programming language that suits you. For general purposes, Python is best option. You should learn C/C++ as well, it will give you deep inside of how to code.
  • Take small steps. Don’t just try to make a big leaps, start with small coding problems and let your skills grow continuously over time.
  • Seeing someone else’s code is not a crime - if you have tried your best to solve that problem. It will definitely give your mind other dimensions of thinking how to code a problem.
  • Do not think that coding is too difficult. Once you know all basic ideas and functions, it will seem to be too easy.
    • But don’t think either that is too easy and you will learn it after some-days… Making mistakes is not a ‘crime’ but procrastination is…
  • Help others :
    • While explaining code, the concepts will be more clearer.
  • Use Google. In today’s case if you know ‘what to do ?’ - your good problem-solving skills; Google can tell you ‘How to do ?’
  • Don’t get desperate too early. At first, you might not be able to solve all problems, but have faith in yourself. Learn continuously.
  • Know the full expressive power of your language :
    • e.g., C++ has STL function libraries which gives you predefined functions with best possible complexities; e.g., algorithm, vector, string, etc.
  • Always dry-run the code or use Debugger. It will give you actual picture how your code is working.
  • And don’t waste much of your time thinking how you learn coding, just roll your sleeves up and jump in the ground to make actual efforts.

See : Why does programming look hard to me? What are the basic rules to learning a programming language?

Upvote the answer if you find it worthy …

Visit my profile for more Tech/ Programming answers : Keshav Kabra

A2A

Let me try to explain with simple example— Task is to find student whose rank is first and last in class. Before you write code, follow these steps. These will help you in resolving your problem.

  • Understand what you want to do carefully and define correct problem definition.

we can define our problem as “Find Max and Min Marks from list”

  • Break down main task into smaller tasks

Task looks easier when you devide it into smaller tasks. Here, You can break down it as--

  1. Read all student’s names and marks.
  2. Sort Students by marks in descending order
  3. Print name of student with first rank as first record f

A2A

Let me try to explain with simple example— Task is to find student whose rank is first and last in class. Before you write code, follow these steps. These will help you in resolving your problem.

  • Understand what you want to do carefully and define correct problem definition.

we can define our problem as “Find Max and Min Marks from list”

  • Break down main task into smaller tasks

Task looks easier when you devide it into smaller tasks. Here, You can break down it as--

  1. Read all student’s names and marks.
  2. Sort Students by marks in descending order
  3. Print name of student with first rank as first record from list
  4. Print name of student with last rank as last record from list

Go further and break down these task again into smaller tasks.

For Ex: Read all student’s names and marks can be break down as follow:

  1. Define data-structure or variables to hold all student’s names and marks.
  2. Define input method for reading data.
  3. Get input and validate.
  4. Add input to defined database (variable or database)
  • Always look for alternative.

There is always another way to do it. Before you proceed, check if there is any alternative way of solving problem and select simplest and easiest alternative.

For example in our case, we can solve it other way as follow :

1) Read student’s name and marks

2) Save it into database.

3) Fetch student with Max value of mark from database using database query, print as first rank

4)Fetch student with min value of mark from database using database query, print as last rank

  • Analyze

re-think on what you have decided and consider all possibilities to ensure 100% correctness.

Now, as you have list of small task, star coding. Start with simplest task.

Apply above for any programm you want write. If you still find it difficult, For few days, forget about programming and start solving logical puzzles. once you feel you are comfortable with it, come back to programming.

Luminous Learning

Starter Puzzles

Once you feel more than comfortable with solving these puzzles, come back to programming and try to follow these instructions.

Above All-- as mentioned in every answer to this question- Practice!! Any technique will not work without practice.

Actually,

Most of the "professional programming" doesn't need much of math apart from basic arithmetic and some coordinate geometry knowledge.
It is only the useless learning system which requires a good knowledge of maths. In most of the books there are questions of finding complex mathematical solutions but these thing never ever come in use in programming done in most IT firms.

You don't need maths skills to be a good developer but you do need them to be a great one.
Here is a great article about this thing -
http://www.skorks.com/2010/03/yo...


So, it means I have to be good at maths for be

Actually,

Most of the "professional programming" doesn't need much of math apart from basic arithmetic and some coordinate geometry knowledge.
It is only the useless learning system which requires a good knowledge of maths. In most of the books there are questions of finding complex mathematical solutions but these thing never ever come in use in programming done in most IT firms.

You don't need maths skills to be a good developer but you do need them to be a great one.
Here is a great article about this thing -
http://www.skorks.com/2010/03/yo...


So, it means I have to be good at maths for becoming a great developer, but how much? Actually not much.
Link to know how much math you need to know -
http://inventwithpython.com/blog...

The math taught in school has almost no use in programming. There are many things taught to us that would even not be useful in other fields.
Some years ago I had the same question. So, I began surfing all over the Internet to find something useful. This was the time I came to know about this fantastic channel - Coding Maths.



Here is the link - https://www.youtube.com/user/cod...


But hey, it's very important to practice. Just reading the above mentioned articles and watching these coding maths videos won't make you an expert.
I won't say that Practice makes a man perfect but I will say that
Right practice makes a man perfect.
School math is good for just marks. The best approach will be learning algorithms, watching these coding maths videos and practicing.


Hope it helps.


Let’s be in touch, follow me here on Quora, turn on the notifications for me and ask me about Android, Windows, Phones, Tablets, Hardware, Programming, Game Development and Tech.


Image - I am very thankful to whoever provided this image. This image doesn't belong to me. I am not the owner of this image . All rights of this image are reserved with their owner.

Read, read and read more. And argue. And debate. And read more.

Logic is not a definitive thing that can be "achieved" or "acquired" like a degree. It is a continuously evolving, never ending process that gets honed the more you use it. Humanity and Logic have always changed over the past, and despite people claiming to have a fixed idea of Logic being unchangeable - It is very abstract. Reading different perceptions and perspectives of others on logic will help you form your own version of it.

Take for example, It was illogical for us to assume the earth could ever be spherical- since if we c

Read, read and read more. And argue. And debate. And read more.

Logic is not a definitive thing that can be "achieved" or "acquired" like a degree. It is a continuously evolving, never ending process that gets honed the more you use it. Humanity and Logic have always changed over the past, and despite people claiming to have a fixed idea of Logic being unchangeable - It is very abstract. Reading different perceptions and perspectives of others on logic will help you form your own version of it.

Take for example, It was illogical for us to assume the earth could ever be spherical- since if we carried out an experiment way back then- and poured water over a small sphere, the water would simply fall off. Since the seas never "fell off", logically the earth could be anything but spherical. The concept of Gravity quite changed that Logic forever.