Home > Programming > 5 Tips on improving Programming Logic

5 Tips on improving Programming Logic

A lot of colleagues, friends and strangers (that I meet in meetups, etc) have asked me to explain how can they improve their programming logic.

Though programming is mainly associated with the field of Computer Science, but writing good and optimized code is mainly an art. Like all art forms requires tremendous patience and rigorous practice, building gray cells for programming logic is not much different.

I present this post/article to you on how you could too improve your programming logic.

Tip 1: Learn the language ‘C’

You might be an expert .NET, Java or PHP developer, but I would recommend that you MUST learn ‘C. We all know why ‘C’ is the most powerful programming language, but I am not recommending learning ‘C’ to you because of its power in programming.

‘C’ offers you a structured style of programming. You have one file with the main() method and the execution begins from there and the execution flow proceeds as you have directed it to.

The main advantage in ‘C’ is that it allows you to play around with memory directly. This I believe is very important if you need to understand how data is passed from one memory block to another. The reason is that you start to visualize in your minds eye how data moves in your program.

The next step is to develop programs that will help you improve your logic.




Tip 2: Develop programs that test your mind skillsEver heard of the Fibonacci series?

Ever built a program that will allow the user to type his/her name and allow to bounce off that name on the screen from one corner to another like a ball?

Ever thought of creating a library for a Menu Bar system?

All these are examples of programs that you can develop to improve your mind and programming skills.

I remember the time I was at college and I would spends nights after nights to build my own library for screen interface for menu bars, windows, text fields, etc. In a UNIX box I would use the ncurses library and build it. I would then try and replicate the same in Windows using the conio.h file and some assembly code.

Try to develop as many programs as possible in ‘C’, this will help you improve your programming logic.

Following are some programs that I can help you with:

  1. Write a program (WAP) to find the max, min, average and total of numbers entered by the user
  2. WAP to accept a string from the user and find the number of vowels and the vowels that got repeated the most.
  3. WAP to accept an array of numbers and sort the same using Bubble Sort Algorithm.
  4. WAP to accept a string from the user and print all its permutations and combinations.
  5. WAP to accept to accept a number from the user and test if it is a Fibonacci number or not.

I can go on and on with such questions.

Tip 3: Locate code and try to understand why it was written that way

Use the internet or college library to locate code written by another developer. Try to understand why it was written that way and understand it completely. Once you have understood why it was written they way it is written, check to see if you could improve that logic.

The main objective of this exercise is to get your brain thinking.




Tip 4: Solve logic puzzlesCheck your local newspaper. One section of your newspaper will be filled with series of logic puzzles and riddles. Try solving them. Don’t get disheartened if you can’t solve them or take a long time to solve them. Remember that you are in the learning and improving stage. Things will be slow, but you will make progress.Your brain will be trained to think differently with every puzzle that you try to solve. This is because now you know a new method of solving. You could apply the same thinking pattern to your programs as well.

As a standard prescription, I would prescribe solving Suduku puzzles. Will help you improve your logic, concentration and skills of grouping and organizing.

Tip 5: Help other people build logic

Once you start feeling confident about yourself and your logic capabilities, you should immediately start helping people. Subscribe to a forum and start helping people there. The benefit of helping people on forums is that you get to learn new problems that people face. This immensely adds to your knowledge. Just imagine the power you would have once you start to learn problems faced by other people and how you or someone else resolved it.

I have seen friends following this advice but shying at the last moment. Why? Because they don’t want to be ridiculed in the forum. Don’t be scared of other people ridiculing you. Look at it as a learning experience. People who ridicule you would be the one’s with more experience… and learning from people who are experienced is no harm at all.

I hope this article was helpful to you.

As a continuation to this post, I am planning to post questions in ‘C’ with solutions. You can subscribe to my blog to receive updates as these posts go live.

Till then, happy logic building :)

Related Posts On Programming

  1. Recharge your Programming Batteries
  2. Ideas on Debugging your Live Website
  3. Why Should every programmer upgrade knowledge
  4. 6 Billionaire College Dropouts
Categories: Programming Tags:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sunilb/www.sunilb.com/wp-content/themes/inove/templates/header.php:30) in /home/sunilb/www.sunilb.com/wp-content/plugins/mycaptcha/MyCaptcha.php on line 41

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sunilb/www.sunilb.com/wp-content/themes/inove/templates/header.php:30) in /home/sunilb/www.sunilb.com/wp-content/plugins/mycaptcha/MyCaptcha.php on line 41
  1. naresh
    March 14th, 2008 at 10:24 | #1

    Hi this article is very good
    Ofter reading this I understand what I want do for logical programming .
    Please send post questions in ‘C’ with solutions for my mail id for Practice

    Thank you

    Regards
    naresh

  2. stronghold
    April 15th, 2008 at 16:20 | #2

    Very useful information :) I see there are realy good tips. I am going to use some of them

  3. Stronghold
    April 17th, 2008 at 02:57 | #3

    Good thread, i like these tips, its looks that i knew just small part.

  4. April 23rd, 2008 at 17:33 | #4

    Great thread! , i like these tips, its looks that i knew just small part of it.

  5. Jobs
    April 26th, 2008 at 14:10 | #5

    Great thread! , i like these tips, its looks that i knew just small part of it.

  6. kalyan
    May 5th, 2008 at 18:11 | #6

    This is really good one. Every programmer should know these type of Tips.

  7. M.S.Reddy
    May 14th, 2008 at 18:20 | #7

    This information is really good,untill i read this post i felt good programming depends only individual capablity but after being through this post,its clear it depends upon how much an individual practices to develope logic.Thank you ,its good work

  8. Sarfaraz
    June 29th, 2008 at 22:37 | #8

    Hi sir
    5 Tips on improving Programming Logic is excellent. It has actually shown me the right direction to develop my logic for programming.
    It is indeed very very useful.
    Please send post questions in ‘C’ with solutions on my mail id for Practice
    Regards
    Sarfaraz

  9. kuks
    August 1st, 2008 at 12:56 | #9

    that is of great help. I never followed these rules in my college days and now i’m facing many problems.

  10. Devendra
    September 15th, 2008 at 16:02 | #10

    Hi Sir

    5 tips is very useful to improve logic.if any body fallow
    these tips.

    Regards.
    Devendra Gour

  11. venkat
    September 27th, 2008 at 09:07 | #11

    Hai
    this is venkat and i’m new one to php programming.

    i seen above articles about 5 tips for improving php.

    its really good and more helpful for us

    kindly request for send some program logic with solution through my emailid

    thanks

  12. manikandan
    October 4th, 2008 at 21:36 | #12

    This is very good stuff

    Practice make perfect

    No Pain No Gain

  13. Mavrik
    October 12th, 2008 at 15:45 | #13

    very useful article, these tips makes you think out of the box. would you be able to email me some more ‘C’ questions with the solutions.
    Thanx alot

  14. student
    October 14th, 2008 at 16:18 | #14

    Pls send questions on simple logic programming in C with solutions for my mail id since I am a beginner.

  15. FAIYAZ
    October 15th, 2008 at 12:30 | #15

    thank u for giving tips,

  16. Raj
    December 3rd, 2008 at 11:20 | #16

    Its great article, these tips are simply superb and excellent. Pls send questions on simple logic programming with solutions.
    Thank u

  17. December 7th, 2008 at 19:58 | #17

    Hello sir,
    This information is really Superb for me.I hope it will helpful for others like me.can we practice on C# of c logics. or programs . please send me answer above questions.
    Thanks a lot!

  18. hashim ali
    December 7th, 2008 at 23:29 | #18

    it was nice suggetion but how to refine your self effectively and quickly if possible,which books to study etc ???

  19. hary nair
    December 18th, 2008 at 10:13 | #19

    Sir,

    Your 5tips are excellent.Its really helpfull.i am going to practise all those examples you are given here.it will be helpfull for me if you can send some more C questions to my email ID.

    Regards,
    Hary Nair

  20. Shobhit
    December 20th, 2008 at 10:33 | #20

    hi…..
    well i’m past the stage of the questions u have given here but i’m eager to learn more and wish to increase my level of logic…..
    can u tell me any website from which i can get such problems which help me grow my programming logic??
    or if u can personally send me the problems on my id
    i’d be grateful to u….

    thanks
    Shobhit Khinvasara

  21. N.Tripathy
    February 5th, 2009 at 12:43 | #21

    Hi
    This article is really great.Thanks.

  22. sailajareddy
    March 6th, 2009 at 21:09 | #22

    hi.this is an excellent article.
    every one should follow this typeof tips…………….

  23. shamily
    March 6th, 2009 at 21:11 | #23

    hi,
    sir
    this article is very impressive for giving me this type of messages i thankful to u

  24. sailajareddy
    March 6th, 2009 at 21:13 | #24

    hi.
    this is an excellent article.
    every one should follow this tips…………………………

  25. March 6th, 2009 at 21:17 | #25

    the given tips are usefull somany people.it is very good to improve communicationskills.

    thank you …..

  26. shamily
    March 6th, 2009 at 21:18 | #26

    hi..
    sir
    by seeing this article i have impressed alot for giving this type of messages i am thankful 2 u

  27. April 4th, 2009 at 22:04 | #27

    Hi….

    I just want to ask a question frm you…..you are emphacizing on C language. Is “C” necessary??? Cant we beautify our programming by using C++ language rather than C???

  28. April 16th, 2009 at 21:35 | #28

    Sunil i went through your site and i felt that you could give me some guidance. I am a beginner in programming. Somehow the codes dont inspire me at all… I also went through your article “how to improve logic for programing” but that was not enough… I am very tensed as I would graduate after 2 yrs and i know nothing.. what do I do..?

  29. md chand
    April 24th, 2009 at 11:49 | #29

    Really this thret is change my way of thinking and got some new method for improving my skill
    please send me some question in on my mail
    Thank u
    Regards
    MD.CHAND SHAHEER

  30. ssv
    June 1st, 2009 at 12:52 | #30

    thanks for the tips.
    i need some programs on realtime applications with solutions wouid u please send it for me………..

    • admin
      June 4th, 2009 at 15:23 | #31

      Hi,

      Can you please let me know the real time applications that you require?

      Regards,
      Suniil

  31. June 8th, 2009 at 20:46 | #32

    hi
    it was really helpfult and very encouraging one.so i hope this will remain and modify

  32. June 8th, 2009 at 20:49 | #33

    dear sir
    thanks for great job,it is good to see like this for the student and every learner.
    it gives me new idean to develope my logic.so once i want to thank you.

  33. Netman
    June 18th, 2009 at 16:57 | #34

    This is an awesome thread. Thanks for keeping it so simple. I am glad I saw this post.

  34. irshan
    July 2nd, 2009 at 17:37 | #35

    dear sir
    first of all i would like to introduce myself……..my name irshan…..and i am a student of bca final year….

    thanks for great job,it is good to see like this for the student and every learner.
    it gives me new idea to develope my logic.so once i want to thank you.

  35. KiKo
    July 23rd, 2009 at 06:52 | #36

    this one is excellent, i will try this..i want to be a well known programmer… thumbs up for you brotha…

    .kiko.

  36. Harsh
    July 27th, 2009 at 10:09 | #37

    Hello,

    Thank you so much for such a wonderful article.It has really helped me in enhancing my level of logic.

    A great article indeed !!

  37. Girish Mahajan
    July 29th, 2009 at 20:42 | #38

    very nice explaining, This will really help me boost my programming logic…. Thanks sir.

  38. Jb Comp scientists
    August 27th, 2009 at 10:44 | #39

    This is a good article. +1

  39. October 5th, 2009 at 23:41 | #40

    i know that logical progarming is very essential man.But since im a bigner so it take me much time to write a complete code and debuging also sometimes becomes a good issue for me

  40. Swarupjyoti Ghosh
    October 23rd, 2009 at 07:06 | #41

    I think following two points helps someone to improve logic.
    a. Use different logic to solve a single problem.
    b. If you know how to play chess, solve chess problems.

  41. Yuvraj
    November 6th, 2009 at 11:40 | #42

    it an very good usefull think to improve my logic.
    thanks
    sir,
    i want practice question on c..
    i am waiting ..?

  42. swati
    November 11th, 2009 at 19:28 | #43

    Its a very good article . Which will help to all programmer to improve there logic

  43. manidhar
    November 21st, 2009 at 23:06 | #44

    Nice one thank you.. :)
    I want to be good with programming..
    So, i’ll try to follow all the steps above..

  44. Ashish Pandya
    December 9th, 2009 at 16:00 | #45

    Good 1.An eye opening session.I m very thankful to u Sir for u guiding me on C and logic building techniques.I have start implementing few suggestions.
    Hope to get few more…… :)

  45. Pranav
    December 16th, 2009 at 13:18 | #46

    hii der…its was really good article..
    hope ill would follow as u’ve mentioned n will try to improve my logic……

  46. Sony
    January 11th, 2010 at 09:57 | #47

    This is a very good article. simple things but it is usefull.

  47. parvathy
    January 17th, 2010 at 16:09 | #48

    This article is good.Also please send me the c quest with solutions.

  48. Nirmit Patel
    January 18th, 2010 at 23:20 | #49

    Hi

    this article is very nice and defiantly help the people new in this field. Thank You very much

  49. January 22nd, 2010 at 23:25 | #50

    Really all the tips are very practical!

  50. sab
    January 29th, 2010 at 17:52 | #51

    hi
    this inf is very useful for begineers.
    thank u

  51. sonali
    January 29th, 2010 at 19:13 | #52

    Site is veri nice and really very helpful for now student in PHP.

  52. elitehacker
    January 30th, 2010 at 13:02 | #53

    Thank you
    This post was really helpful

  53. February 1st, 2010 at 22:20 | #54

    Really usefull….

  54. February 4th, 2010 at 16:52 | #55

    This article definitely help programmer to build up/strong their logic. Carry on dude… all the best :)

  55. shakthi
    February 25th, 2010 at 16:46 | #56

    This is very usefull for beginners.
    thank you

  56. Anurag
    February 25th, 2010 at 17:43 | #57

    hiii,,this Article was very effective to develop a logic..i suggest dat every one should go through thiss article….

  57. Bhanwar Pratap Singh
    February 27th, 2010 at 18:43 | #58

    Hello, This article is very useful for us because some time beginners programmer very fer estated about his programming logics.I am also one of them.So I am very thankful to your advice…….Keep It up…….and again THANKS

  58. SHWETA
    March 1st, 2010 at 14:36 | #59

    It is very fine thank u

  59. Ranjana
    March 2nd, 2010 at 12:56 | #60

    Nice!!!!!

    Thanks for the info.

  60. March 4th, 2010 at 17:37 | #61

    Yes puzzle solving definitely help you to become a good & efficient coder.

  61. March 8th, 2010 at 02:20 | #62

    you are the greatest blogger ever…!

    Keep it up…!

  62. Rian
    March 17th, 2010 at 22:05 | #63

    Very inspiring and useful. Thank you :)

  63. Hemang Rami
    March 27th, 2010 at 02:42 | #64

    thank you. I was just lost my temper due to failing to create codes for certain stuff.
    Your this article will provide enough confidence and the make me able to define certain logical tricks…
    Thank You.

  64. March 27th, 2010 at 18:51 | #65

    good job….

    Thank you the useful source and post.

  65. madhukar
    February 2nd, 2012 at 04:19 | #66

    hi thanks to useful tips and post

  66. MAYUR
    February 3rd, 2012 at 04:08 | #67

    this artical is realy very good bcoz, o get an idea to improve my logic …..

  67. Manikandan
    February 4th, 2012 at 06:34 | #68

    Hi, you provide good article to start thinking about logical section,for the beginners its should be very helpful.

    Thanks For you Wonderful post!

  68. Shivani
    February 5th, 2012 at 06:25 | #69

    Hey, these tips are very useful. plz send me “C language ” questions on my mail id. thanks

  1. October 31st, 2007 at 22:18 | #1
  2. January 1st, 2008 at 22:58 | #2
Enter this code to leave comment (Sorry, but bots get me crazy :) )