Source code

Computer program code is a text written in any of the programming languages. It is first of all meant to be written and edited by a human. Computer program code is also called source code or software source text.

Source code is transformed into executable processor instructions prior to being executed by a compiler or is directly executed by an interpreter of a programming language.

When writing computer program code, it's important that you stick to the following rules:

  • the code must be readable and comprehensible;
  • it must be easy to modify and debug;
  • there must be as few compiler warnings as possible for this code.

It's first of all humans who need code formatting and accurate editing. The compiler can easily figure out a text like this:

int foo(int N)
{int i=0;for(int y=0;y<N;y++){i+=y*y;}return i;}

But you agree that a human will find it hard to understand what exactly the program does, don't you? And here is a code that does quite the same thing, while being edited in a proper way:

int Sum(int N)
{
  int sum = 0;
  for (int i = 0; i < N; i++)
  {
    sum += i * i;
  }
  return sum;
}

When a software product is being developed by several developers, it's a good practice to follow a single coding standard to make the code clear to others. It will significantly simplify computer program code development and maintenance.

References


Bugs Found

Checked Projects
414
Collected Errors
14 218
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept