The right way to learn programming


                Learn the programming in the right way

True: you can not learn C programming in one day. If you try to learn a lot of C programming then you may have difficulty understanding important concepts.

If you start learning the syntax and just starting to code in C programming, then your code will do a lot better. But the correct methodology does not end up learning your C programming.


Examples should not be read only. It will run on your system.
This blog has dozens of examples that will help you understand C programming. However, if you read these programs just like reading the Nobel Prize without having to run on your system, then you are wrong.

If you want to know the new features of programming, try writing code related to that feature. We encourage you to try and run our examples.

Once you understand the programs, change them and try to create something new. Because this is the whole process of learning programming.


Learn how to use debugging tools
Debugging tool or debugger is a software that allows the programmer to stop the program at any point and helps in correcting the error. IDE has debugging tools by default.

If you have bugs in your program, you can stop the program at any point by using the debugger instead of searching the bug from the start and can find the value of the variable to detect the bug.

It is very important to know how to use debugger and every programmer should know it.


Learn the characteristics according to the purpose of use
Think of the situation: It is possible to solve through a problem array. It is also possible to solve it with the structure. Technically both methods are correct. Which one do you use?

You need to have good knowledge about using array and structure to answer this question.

If you switch from another programming language such as C # to C language. Then you will not want to write the code of C # style C program.


Join the C community
When you can write general C programs, join the online community and forum to do even better things. When you get into trouble, if you want help to solve it, they will help you solve the problem.

Irecommand you to join the following community:

C programming Google forums - a forum site for beginners
Codechef - A huge community of programmers. Where you can practice questions and ask questions.
StackOverflow - Many popular programming questions-answers sites.
Always use the best method for programming
Writing code in a good way is an unwritten document that increases the quality of the software and time for development is also saved.

The following programming practices are valid for all programs and some are only valid for C programming

Format the corresponding code

There are no matter how many spaces you are using in C programming. But that does not mean that you use the space where you are going. Always use code indentation (indentetion) so that the code can be easily understood.

Use one line for each statement.

What's wrong with the code below?

int count; float squareRoot = 10.0; printf ("Square root =% f", squareRoot);
Actually there is no mistake in the above code. But it's not a good way to code.

int count;
float squareRoot = 10.0;
printf ("Square root =% f", squareRoot);
The purpose of the code written above is to easily understand if someone sees the code.


Use consistent and customized names

Name the variable and function name in line with the work.

int a, b;
Here, I do not understand anything about the two variables a and b and what they have been used for. Instead, put a meaningful name below.

int counter, power;
Also follow some names of the names. For example:

int base_number, powerNumber;
In order to separate more than one word, both the underscores and the case of the camel are used. However, use any one without using both methods in the same program.


Get used to comments

Components are part of the comment code and compilers avoid it.

You can briefly explain what you want to do through your program. It will help the programmer follow your code very easily.

Using double slash (//) you can comment single line in C programming.

Use Slash-Asterisk (/ *) ... for the multi-line commentary ... Asterisk-slash (* /).


// my first program
/ * Input and output
 For stdio.h attached
Has been * /

#include <stdio.h>
int main ()
    {
      printf ("Hello, World! \ n"); // Hello on the screen, World! Appear
      return 0;
}
"It is the same thing as commenting in the code and cleaning the regular bathroom. You never want to do it. But if you do, then your relatives will also be very glad to use it. "

- Ryan Campbell


If you're a brand new one, then it's a great language to start learning programming. And if you are a professional programmer and the schedule is very tight, you can learn it during your leisure. It will definitely make your programming basics even stronger.

Post a Comment

0 Comments