Hey everyone I was wondering if anyone had any tips or methods for me to better my programming in C. I know I have to practice problems from my book but are there any other ways to better my code writing skrills :D
thank you.

Edited 5 Years Ago by Prisms: n/a

Looking back on your code, #1 is stop using TABs to indent. Use 4 SPACEs. Your IDE can be set to convert TABs to SPACEs. And be more consistent with your indentation. See this.

Also, before you even touch the computer, design the program in pieces on paper. Take each step needed in the program and break them down into smaller and smaller pieces. Once you get them small enough, program one main piece at a time. Test. Correct. Test again. When it works, add another piece.

For example, what's your input look like? How do you input that data? Where does it get stored? Do you have to convert it? How? Program it. Test it. Make sure it works.

Do not write the entire program and try to compile. You'll spend an hour typing it in and hours trying to figure out what's wrong. Rather spend the hour at your desk. Then spend minutes typing in a piece, and minutes testing to get it right. Then another few minutes typing in and another couple minutes getting that right.

hey nice tips for programming.

I used to start directly with coding and spend a lot of time on simple simple programs.

After that I come to know that it is better to do it on paper first.

So, If you are new to any language or code you are going to modify
first trace it on paper, it helps a lot and reduce time to solve the problem.

In addition to the methods described above I find that reading other code is terribly beneficial. Find a medium sized project on sourceforge or github and just get familiar with the way other people write code: what's good, what's not. The more exposure you have the more base you will have when forming your own opinions.

This article has been dead for over six months. Start a new discussion instead.