About Coding

Coding versus Programming

This web site includes tutorials and examples of many computer languages. Some computer languages are "programming" languages, while others are not.

C, C++, Python, and PHP, for example, are all "programming" languages. HTML and CSS, on the other hand, are not programming languages, but they are computer languages. In other words, all programming languages are computer languages, but not all computer languages are programming languages. As "languages" they have "syntax" , that is, rules that should/must be followed when writing the language (code) to make the program work - or work as intended.

Simply put, computer programs are instructions used by a computer to perform a task. They can be created by anyone in any of dozens of popular computer programming languages. Those who create computer programs, also known as computer software, are often referred to as: computer programmers, software engineers, or software developers. However, individuals in many other professions also create computer programs, e.g. statisticians, CNC operators, network administrators, etc. There is a fascinating article on computer code at this web site: https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

However, languages such as HTML and CSS lack the higher-level programming logic constructs and features that actual programming languages possess, e.g. math operations, decision statements, looping statements, arrays, functions, etc.

HTML is "Markup" Language (HyperText Markup Language) used to markup text to indicate how it should be displayed on a web page, i.e. paragraphs, headings, lists, etc. CSS (Cascading Style Sheets) is a language used to format and layout the content on web page, i.e. font color, font size, margins, etc. Thus, when one creates HTML and CSS files, they are "coding" (i.e. writing instructions), but not "prorgamming". The HTML and CSS are both interpreted language that are run by the web browser. C and C++ programs, on the other hand, are compiled on a specific operating system and then run by the operating system.

Computer Files

In computer programming, there are two common file types one should be familiar with.

  • Source file
  • Executable file

The source file, or source code, is the file that contains the programming source code that the programmer coded/created. The file extension (e.g. .py, .php, .c, .java, etc.) to the file typically indicates what programming language the code is. Examples include:

  • salary_report.py - source code file for a program written in Python
  • salary_report.c - source code file for a program written in C
  • salary_report.cpp - source code file for a program written in C++
  • salary_report.php - source code file for a program written in PHP
  • salary_report.bat - source code file for a program written in MS-DOS batch
  • salary_report.java - source code file for a program written in Java

It is important to note that none of the filenames above: contained a space, started with a number, or had uppercase in this. These conventions are strongly recommended. Source code files are ASCII pure text files (i.e. can be opened and read by any text editor) versus unreadable machine language.

If a programming language is an interpreted language, the source code is run directly by the interpreter. For example, PHP source code is run directly by the web server and Python source code is run by the Python interpreter software. HTML and CSS are computer languages (but not programming languages) run (interpreted) by the web browser.

C and C++, on the other hand, are compiled languages. The source code cannot be run in compiled languages. The source code must be compiled into executable code (unreadable binary/machine language), which the operating system then runs. This typically also results in interpreted language being platform-independent, and compiled languages being platform-dependent (OS-specific). Thus, one would compile the file salary_report.c on a Windows computer, which would result in the file salary_report.exe being created, which is an executable file that can be run by the user and Windows.

Common Features in Programming Languages

There are many "types" of programming languages. These are discussed in the "Types" section of this site. Two of the most common types are "procedural" and "object-oriented". There are many common features to these types of programming languages. Learning these common features regardless of the language is said to be learning the "logic" of programming, which can then be applied to most other languages. At that point, only the syntax is different. Learning "logic" can be thought of as learning the fundamentals, or big picture and the syntax is the details.

Procedural languages

  • Variables and data types
  • Arithmetic/math
  • Decisions
  • Loops
  • Functions
  • Arrays
  • Pointers

Object-Oriented languages

  • Objects
  • Method
  • Classes
  • Inheritance

IPO Model

In very broad terms, the purpose of computer software is often described using the IPO model. stands for Input, Process, and Output. The IPO model is used in systems analysis, software engineering, and to describe many systems that make up the world. A system, be it c computer hardware system, computer software program, the earth we live on, the human body, or a corporate organization has inputs, processes, and outputs.

A computer program, for example, may ask an end-user for input, such as the semester/term a student wants to register for. The computer program will then process this input by searching a database for courses that match this search criteria. And finally, the program will output the search results to the user.

This IPO process is facilitated through a combination of computer software and hardware. Input is obtained from users via devices such as the keyboard, mouse, microphone, or a touchscreen monitor or from the computer via files. The processes are performed by the computer central processing unit (CPU) and may include mathematical calculations, decisions, searching, sorting, and reading and writing data. Output is often delivered via monitors, speakers, and printers.

Visual of IPO Model

IPO Model

Below are additional examples of how the IPO model related to creating computer programs:

Input(s) Process(es) Output(s)
Gross pay
Tax rate
Mathametical calculatons Net pay
Product description entered into text box Database query Products matching search displayed on web page
Loan amount
Number of years of loan
Interest rate
Mathametical calculatons Monthly payment
Use of arrow keys Game logic and AI: game collision detection, etc. Game character moves ahead in room
Coins/dollar bill
Product choice
Vending machine logic: correct change, etc. Vending machine product (e.g. candy bar) dispensed
Visual sensors Autonomous vehicle logic Vehicles drives autonomously
Voice input into Android smartphone Google search input box Google voice-to-text and search engine processing Google web results displayed