Part 7: Using Clear Instructions of Computer Programming Techniques

Computer Programming Techniques

Using Clear Instructions

As you know, computer does not have intelligence of its own; it simply follows the instructions given by the user. Instructions are the building blocks of a computer program, and hence a software. Giving clear instructions is crucial to building a successful program. As a programmer or software developer, you should get into the habit of writing clear instructions. Here are two ways to do that.

Clarity of Expressions

Expression in a program is a sequence of operators and operands to do an arithmetic or logical computation. Here are some examples of valid expressions −

  • Comparing two values
  • Defining a variable, object or class
  • Arithmetic calculations using one or more variables
  • Retrieving data from database
  • Updating values in database

Writing unambiguous expressions is a skill that must be developed by every programmer. Here are some points to be kept in mind while writing such expressions −

Unambiguous Result

Evaluation of the expression must give one clear cut result. For example, unary operators should be used with caution.

Avoid Complex Expressions

Do not try to achieve many things in a single expression. Break into two or more expressions the moment things start getting complicated.

Simplicity of Instructions

It’s not just for computers that you need to write clear instructions. Any one reading the program later (even you yourself!!) should be able to understand what the instruction is trying to achieve. It is very common for programmers not to get a hang of their own programs when they revisit it after some time has passed. This indicates that maintenance and modification of such programs would be quite difficult.

Writing simple instructions helps in avoiding this problem. Here are some tips to write simple instructions −

  • Avoid clever instructions− Clever instructions might not look that clever later if no one is able to understand it properly.
  • One instruction per task− Trying to do more than one thing at a time complicates instructions.
  • Use standards− Every language has its standards, follow them. Remember you are not working alone on the project; follow project standards and guidelines for coding.

 

0 Comments

You may find interest following article

Chapter 4 Relational Algebra

Relational Algebra The part of mathematics in which letters and other general symbols are used to represent numbers and quantities in formula and equations. Ex: (x + y) · z = (x · z) + (y · z). The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases. Relational algebra...

Chapter 3 Components of the Database System Environment

Components of the Database System Environment There are five major components in the database system environment and their interrelationships are. Hardware Software Data Users Procedures Hardware:  The hardware is the actual computer system used for keeping and accessing the database. Conventional DBMS hardware consists of secondary storage devices, usually...

Chapter 2: Database Languages and their information

Database Languages A DBMS must provide appropriate languages and interfaces for each category of users to express database queries and updates. Database Languages are used to create and maintain database on computer. There are large numbers of database languages like Oracle, MySQL, MS Access, dBase, FoxPro etc. Database Languages: Refers to the languages used to...

Database basic overview

What is DBMS? A Database Management System (DBMS) is a collection of interrelated data and a set of programs to access those data. Database management systems (DBMS) are computer software applications that interact with the user, other applications, and the database itself to capture and analyze data. Purpose of Database Systems The collection of data, usually...

Laravel – Scopes (3 Easy Steps)

Scoping is one of the superpowers that eloquent grants to developers when querying a model. Scopes allow developers to add constraints to queries for a given model. In simple terms laravel scope is just a query, a query to make the code shorter and faster. We can create custom query with relation or anything with scopes. In any admin project we need to get data...