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.

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.