How you can improving your Programming Logic

Programmer is like an artist I think. Though programming is mainly associated with the field of Computer Science, but writing good and optimized code is mainly an art. So, Like all art forms programming also requires tremendous patience and rigorous practice. Some tips given below to improving 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 skills Ever 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 puzzles Check 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.

Advertisements

10 Responses

  1. I think I was searching ‘Programming Logic Questions’ on google and ended up at your site.

    Good points.

    One more to add
    – You should be aware of what you are doing. I have seen many times that people just use algorithms or others’s code to achieve what they need. This leaves them with illusions of their capability.

    For example, most guys who knows how to use some programming language can sort a list of numbers given the problem. But you ask them to sort the same numbers without using language’s inbuilt sort function, they will be stuck.

    For complicated function call or api call, maybe it is acceptable, but for basic operations , a programmer must know how the libraries they use work.

    Also, programming in the end is about solving a problem within a given context, and if you are not gifted with that skill, you cannot become a good programmer no matter how well you know the Language. You can of-course work hard to gain competence in problem solving, but without the natural inclinations or life long experience it will be very hard. There is a reason why everybody cannot produce a great novel, although everybody knows how to read and write the language.

  2. sir,
    the points ur said r good and i want to say one more point to the developers please go on from the initial stage of the problem first analyse the problem and carry on…

  3. Have been so much frustrated because of not being able to cop up with the class as the polish teacher is going more and mroe advance day by day in programming. I was off the track.

    Khub bhalo suggestions, simple and reliable. But, the problem is at making sure following them properly.

    Onek DonnoBad.
    Gufran,cou, finland.

  4. very good pt. taken, even i was looking for the same posts, i got here, am graduate in computer science and i have conceptual knowledge of things to be done, but forming that conceptual part into logics and keywords (trying in php) is really nudging my brain , every time i stuck after 4 lines.:)

    don’t know but trying hard to build logic…thx……….guys

  5. It’s great !! Thank you

  6. fabulious,point given by this article.basically i m beginers of c language.but it can help me,,,,

  7. very nice

  8. good practical

  9. good points…. m a beginner in programming and get disheartened when not able to build the logic… m trying very hard to improve my programming skills…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: