DEV Community

Cover image for how to learn progamming logic
Ameen Akbar
Ameen Akbar

Posted on

how to learn progamming logic

Top comments (2)

Collapse
 
prsaya profile image
Prasad Saya

When I started learning programming, one of the tools I used (or rather learned to use) was flow charting. Along with pseudo-code these make a good beginners logic development methods.

I still use these two methods to do my work.

I recollect my first flowcharts were like "How do you print all even numbers from 1 to 10", "Print the sum of all odd numbers from 0 to 100", and there were problems like generating Fibonacci sequence, factorial of number, etc.

Programming problems can be easily developed or understood using flowcharts and pseudo-code.

Collapse
 
khalilsaboor profile image
Khalil Saboor

A good way of starting to learn programming logic aka business logic (especially if you know the basic of programming. If not then watch a YT course on your fav language!) is to increase your ability to design or mapped out logic.

Using a pen/paper or a design software, consider creating diagrams of your personal projects and work your way from class diagram, to flow diagram and then up to process and Entity diagrams. If you're in school or working with others. Consider creating diagram and getting feedback from your team on if your diagrams make sense or is this diagram similar to the code we are writing.

After a while you should get an idea of what's going on and context of logic being used for what use case.

Another hands on approach is running code in debug mode. It can help a lot because you see the code going step by step changing data or stepping into new methods that contain logic. if you are coding in python, consider using a site like python tutor to see the code being step into different logics.

For creating diagrams online - mermaid.js has been helpful because I'm not overwhelm with the different shapes or lines styles of other software. The examples online can be very helpful for understanding best practices.