DEV Community

Cover image for How I Learnt Logic Building in Programming! - 5 Tips To Build & Improve Programming Logic

How I Learnt Logic Building in Programming! - 5 Tips To Build & Improve Programming Logic

Muhammad Maaz Shakeel on June 26, 2021

Tip #1: Divide & Conquer Always divide the problem into different parts. For Example This is a C code that just input for a num...
Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

Regarding tip #2 - comments should only be put in code if what the code is doing is not obvious, or some explanation is needed. Most well-written code is self explanatory and requires few, if any comments. The comments in your example are almost entirely superfluous

Also, a tip when sharing code samples on Dev - put the name of the language after the opening three backticks on the codeblock and you will get code highlighting

Collapse
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Is there any improvements should change in my post?

Collapse
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Thank you for the tip. ☺️

Collapse
 
codewithmaaz profile image
Muhammad Maaz Shakeel

So, How are we going to improve Tip number 2?

Collapse
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Thank you for telling me.😊

Collapse
 
pazka profile image
Alexandre Weisser • Edited

Hey, he took the time to explain to you what he thought should be improved with a very detailed comment.

He doesn't have an obligation to answer you if you ask for more details.

If you read carefully its comment, you should see right away what you should improve in your post, a tip : Rewrite tip #2 with correct advices.

If you want more details, you can check the book "Clean Code". Especially the part about comments.

Also the series of increasingly aggressive answers make for a toxic communication, and you should cut that from you behaviour if you want to involve more deeply in collaborating with other. As a self taught developer, this should be your priority.

Have a nice day.

Thread Thread
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Have a nice day too.

Thread Thread
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Is it better now?

Thread Thread
 
pazka profile image
Alexandre Weisser

Yes

Thread Thread
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Thank you 😊

Collapse
 
mdcoder100 profile image
Moeez Bodla

Help Full! Thanks for sharing.

Collapse
 
codewithmaaz profile image
Muhammad Maaz Shakeel

Thank you 😊