THE MEANING OF COMPUTER PROGRAMMING

THE MEANING OF COMPUTER PROGRAMMING

 

Programming means writing coded instructions or programs to instruct a computer or other devices to perform specific tasks automatically. The computer programs written by the programmers are often known as software .Various software exist today, among them are desktop operating system, Internet browsers, spreadsheet, word processing software, accounting software, photo and video editing software, gaming software, mobile apps, robotic software and more. In order to create a computer program, we need to use a programming language. The earliest programming language is called machine language which uses the binary code(comprises 0 and 1) to communicate with the computer. However, the machine language is extremely difficult to learn . Fortunately , scientists have invented some high-level programming languages that are much easier to master. Among the high-level programming languages are Java, JavaScript, C, C++, c# and Visual Basic.

CLASSIFICATIONS OF PROGRAMMING LANGUAGES

Concepts
Different languages have different purposes, so it makes sense to talk about different kinds, or types, of languages. Some types are:
• Machine languages, that are interpreted directly in hardware
• Assembly languages, that are thin wrappers over a corresponding machine language
• High-level languages, that are anything machine-independent
• System languages, that are designed for writing low-level tasks, like memory and process management
• Scripting languages, that are generally extremely high-level and powerful
• Domain-specific languages, that are used in highly special-purpose areas only
• Visual languages, that are non-text based
• Esoteric languages, that are not really intended to be used, but are very interesting, funny, or educational in some way
These types are not mutually exclusive: Perl is both high-level and scripting; C is considered both high-level and system.
Other types people have identified: Toy, Educational, Very High-Level, Compiled, Interpreted, Free-Form, Curly Brace, Applicative, Von Neumann, Expression-Oriented, Persistent, Concurrent, Glue, Intermediate, Quantum, Hybrid. SeeWikipedia’s category page on programming language classification.

MACHINE CODE

Most computers work by executing stored programs in a fetch-execute cycle. Machine code generally features:
• Registers to store values and intermediate results
• Very low-level machine instructions (add, sub, div, sqrt)
• Labels and conditional jumps to express control flow
• A lack of memory management support — programmers do that themselves
Machine code is usually written in hex. Here’s an example for the Intel 64 architecture:
89 F8 A9 01 00 00 00 75 06 6B C0 03 FF C0 C3 C1 E0 02 83 E8 03 C3
Can you tell what it does?

ASSEMBLY LANGUAGE

An assembly language is an encoding of machine code into something more readable. It assigns human-readable labels (or names) to storage locations, jump targets, and subroutine starting addresses, but doesn’t really go too far beyond that. Here’s the function from above on the Intel 64 architecture using the GAS assembly language:
.globl f .text
f: mov %edi, %eax # Put first parameter into eax register
test $1, %eax # Examine least significant bit
jnz odd # If it's not a zero, jump to odd
imul $3, %eax # It's even, so multiply it by 3
inc %eax # and add 1
ret # and return it
odd: shl $2, %eax # It's odd, so multiply by 4
sub $3, %eax # and subtract 3
ret # and return it
And here’s the same function, written for the SPARC:
.global f
f: andcc %o0, 1, %g0
bne .L1 sll %o0, 2, %g2
sll %o0, 1, %g2
add %g2, %o0, %g2
b .L2
add %g2, 1, %o0
.L1: add %g2, -3, %o0
.L2:
retl
nop

HIGH-LEVEL LANGUAGES

A high-level language gets away from all the constraints of a particular machine. HLLs have features such as:
• Names for almost everything: variables, types, subroutines, constants, modules
• Complex expressions (e.g. 2 * (y^5) >= 88 && sqrt(4.8) / 2 % 3 == 9)
• Control structures (conditionals, switches, loops)
• Composite types (arrays, structs)
• Type declarations
• Type checking
• Easy, often implicit, ways to manage global, local and heap storage
• Subroutines with their own private scope
• Abstract data types, modules, packages, classes
• Exceptions
The previous example looks like this in Fortran 77 (note how the code begins in column 7 or beyond):
INTEGER FUNCTION F(N)
INTEGER N
IF (MOD(N, 2) .EQ. 0) THEN
F = 3 * N + 1
ELSE
F = 4 * N - 3
END IF
RETURN
END
and like this in Fortran 90 (where the column requirements were finally removed):
integer function f (n)
implicit none
integer, intent(in) :: n
if (mod(n, 2) == 0) then
f = 3 * n + 1
else
f = 4 * n - 3
end if
end function f
and like this in Ada:
function F (N: Integer) return Integer is
begin
if N mod 2 = 0 then
return 3 * N + 1;
else
return 4 * N - 3;
end if;
end F;
and like this in C and C++:
int f(const int n) {
return (n % 2 == 0) ? 3 * n + 1 : 4 * n - 3;
}
and like this in Java and C#:
class ThingThatHoldsTheFunctionUsedInTheExampleOnThisPage {
public static int f(int n) {
return (n % 2 == 0) ? 3 * n + 1 : 4 * n - 3;
}
}
and like this in Scala:
def f(n: Int) = if (n % 2 == 0) 3 * n + 1 else 4 * n - 3;
and like this in Kotlin:
fun f(n: Int) = if (n % 2 == 0) 3 * n + 1 else 4 * n - 3
and like this in JavaScript:
function f(n) {
return (n % 2 === 0) ? 3 * n + 1 : 4 * n - 3;
}
and like this in CoffeeScript:
f = (n) -> if n % 2 == 0 then 3 * n - 1 else 4 * n + 3
and like this in Smalltalk:
f ^self % 2 = 0 ifTrue:[3 * self + 1] ifFalse:[4 * self - 3]
and like this in Standard ML:
fun f n = if n mod 2 = 0 then 3 * n + 1 else 4 * n - 3
and like this in Elm:
f n = if n % 2 == 0 then 3 * n + 1 else 4 * n - 3
and like this in Haskell (thanks @kaftoot):
f n | even(n) = 3 * n + 1 | otherwise = 4 * n - 3
and like this in Julia (yes, 3n is “three times n”):
f(n) = iseven(n) ? 3n+1 : 4n-3
and like this in Lisp:
(defun f (n)
(if (= (mod n 2) 0)
(+ (* 3 n) 1)
(- (* 4 n) 3)))
and like this in Clojure:
(defn f [n]
(if (= (mod n 2) 0)
(+ (* 3 n) 1)
(- (* 4 n) 3)))
and like this in Prolog:
f(N, X) :- 0 is mod(N, 2), X is 3 * N + 1.
f(N, X) :- 1 is mod(N, 2), X is 4 * N - 3.
and like this in Erlang:
f(N) when (N band 1) == 0 -> 3 * N + 1;
f(N) -> 4 * N - 3.
and like this in Perl:
sub f {
my $n = shift;
$n % 2 == 0 ? 3 * $n + 1 : 4 * $n - 3;
}
and like this in Python:
def f(n):
return 3 * n + 1 if n % 2 == 0 else 4 * n - 3
and like this in Ruby:
def f(n)
n % 2 == 0 ? 3 * n + 1 : 4 * n - 3;
end
and like this in Go:
func f(n int) int {
if n % 2 == 0 {
return 3 * n + 1
} else {
return 4 * n - 3
}
}
and like this in Rust:
fn f(n: int) -> int {
return if n % 2 == 0 {3 * n + 1} else {4 * n - 3}
}
and like this in Swift:
func f(n: Int) -> Int {
return n % 2 == 0 ? 3 * n + 1 : 4 * n - 3
}
and like this in K:
f:{:[x!2;(4*x)-3;1+3*x]}
Exercise: Which of these languages required that variables or functions be declared with types and which did not?
Exercise: Implement this function in PHP, Objective C, Ceylon, D, and Mercury.

SYSTEM LANGUAGES

System programming languages differ from application programming languages in that they are more concerned with managing a computer system rather than solving general problems in health care, game playing, or finance. In a system langauge, the programmer, not the runtime system, is generally responsible for:
• Memory management
• Process management
• Data transfer
• Caches
• Device drivers
• Directly interfacing with the operating system

SCRIPTING LANGUAGES

Scripting languages are used for wiring together systems and applications at a very high level. They are almost always extremely expressive (they do a lot with very little code) and usually dynamic (meaning the compiler does very little, while the run-time system does almost everything).

ESOTERIC LANGUAGES

An esoteric language is one not intended to be taken seriously. They can be jokes, near-minimalistic, or despotic (purposely obfuscated or non-deterministic).
See Wikipedia’s article on esoteric languages.
Exercise: Implement the function above in False, Brainfuck, Befunge, Malbolge, Kipple, and reMorse.

OUSTERHOUT’S DICHOTOMY

John Ousterhout once claimed that programming languages roughly fall into two types, which he called scripting and system languages. You can read about this idea at Wikipedia. Then read this two-part article (Part 1, Part 2) on the dichotomy and on languages that seem to reject it.

COMPUTER PROGRAMMING LANGUAGE TRANSLATORS

Translators, compilers, interpreters and assemblers are all software programming tools that convert code into another type of code, but each term has specific meaning. All of the above work in some way towards getting a high-level programming language translated into machine code that the central processing unit (CPU) can understand. Examples of CPUs include those made by Intel (e.g., x86), AMD (e.g., Athlon APU), NXP (e.g., PowerPC), and many others. It’s important to note that all translators, compilers, interpreters and assemblers are programs themselves.

TRANSLATORS

The most general term for a software code converting tool is “translator.” A translator, in software programming terms, is a generic term that could refer to a compiler, assembler, or interpreter; anything that converts higher level code into another high-level code (e.g., Basic, C++, Fortran, Java) or lower-level (i.e., a language that the processor can understand), such as assembly language or machine code. If you don’t know what the tool actually does other than that it accomplishes some level of code conversion to a specific target language, then you can safely call it a translator.

COMPILERS

Compilers convert high-level language code to machine (object) code in one session. Compilers can take a while, because they have to translate high-level code to lower-level machine language all at once and then save the executable object code to memory. A compiler creates machine code that runs on a processor with a specific Instruction Set Architecture (ISA), which is processor-dependent. For example, you cannot compile code for an x86 and run it on a MIPS architecture without a special compiler. Compilers are also platform-dependent. That is, a compiler can convert C++, for example, to machine code that’s targeted at a platform that is running the Linux OS. A cross-compiler, however, can generate code for a platform other than the one it runs on itself. A cross-compiler running on a Windows machine, for instance, could generate code that runs on a specific Windows operating system or a Linux (operating system) platform. Source-to-source compilers translate one program, or code, to another of a different language (e.g., from Java to C). Choosing a compiler then, means that first you need to know the ISA, operating system, and the programming language that you plan to use. Compilers often come as a package with other tools, and each processor manufacturer will have at least one compiler or a package of software development tools (that includes a compiler). Often the software tools (including compiler) are free; after all, a CPU is completely useless without software to run on it. Compilers will report errors after compiling has finished.

INTERPRETERS

Another way to get code to run on your processor is to use an interpreter, which is not the same as a compiler. An interpreter translates code like a compiler but reads the code and immediately executes on that code, and therefore is initially faster than a compiler. Thus, interpreters are often used in software development tools as debugging tools, as they can execute a single in of code at a time. Compilers translate code all at once and the processor then executes upon the machine language that the compiler produced. If changes are made to the code after compilation, the changed code will need to be compiled and added to the compiled code (or perhaps the entire program will need to be re-compiled.) But an interpreter, although skipping the step of compilation of the entire program to start, is much slower to execute than the same program that’s been completely compiled. Interpreters, however, have usefulness in areas where speed doesn’t matter (e.g., debugging and training) and it is possible to take the entire interpreter and use it on another ISA, which makes it more portable than a compiler when working between hardware architectures. There are several types of interpreters: the syntax-directed interpreter (i.e., the Abstract Syntax Tree (AST) interpreter), bytecode interpreter, and threaded interpreter (not to be confused with concurrent processing threads), Just-in-Time (a kind of hybrid interpreter/compiler), and a few others. Instructions on how to build an interpreter can be found on the web.[i] Some examples of programming languages that use interpreters are Python, Ruby, Perl, and PHP.

ASSEMBLERS

An assembler translates a program written in assembly language into machine language and is effectively a compiler for the assembly language, but can also be used interactively like an interpreter. Assembly language is a low-level programming language. Low-level programming languages are less like human language in that they are more difficult to understand at a glance; you have to study assembly code carefully in order to follow the intent of execution and in most cases, assembly code has many more lines of code to represent the same functions being executed as a higher-level language. An assembler converts assembly language code into machine code (also known as object code), an even lower-level language that the processor can directly understand. Assembly language code is more often used with 8-bit processors and becomes increasingly unwieldy as the processor’s instruction set path becomes wider (e.g., 16-bit, 32-bit, and 64-bit). It is not impossible for people to read machine code, the strings of ones and zeros that digital devices (including processors) use to communicate, but it’s likely only read by people in cases of computer forensics or brute-force hacking. Assembly language is the next level up from machine code, and is quite useful in extreme cases of debugging code to determine exactly what’s going on in a problematic execution, for instance. Sometimes compilers will “optimize” code in unforeseen ways that affect outcomes to the bafflement of the developer or programmer such that it’s necessary to carefully follow the step-by-step action of the processor in assembly code, much like a hunter tracking prey or a detective following clues.

SOFTWARE DEVELOPMENT LIFE CYCLE

software development life cycle is a series of stage in software engineering to develope proposed software application such as;
1.Communication
2.Requirement Gathering
3.Feasibility Study
4.System Analysis
5.Software Design
6.Coding
7.Testing
8.Integration
9.Implementation
10.Operations And Maintenance
11.Disposition

QUALITIES OF A GOOD PROGRAM

The following are the qualities of a good program:
a. Reliability :how often the result of the program is correct
b. Robustness :how well a program anticipates problem due to error
c. Usability :how easy a user can use the program, this is also called user friendly
d. Portability: the ability of a program to run on different operating systems or device without modifications.
e. Maintainability: the ease with which the program can be modified by present or future developers.
f. Efficiency /performance :the amount of system resources a program consumes (processor time, memory space)
The above Qualities are also called PERFORMANCE METRICS of software.

TOOLS FOR PROGRAMMING

The following tools are required for programming;
1. A computer system.
2. Text editor: where we write and save our codes e. g Notepad, sublime text, atom, Dreamweaver and others.
3. A translator (compiler, interpreter and assembler) for translating and testing the codes.
For a programming language like visual basic, the text editor and the translators are integrated into one tool called integrated development environment (IDE).
Other popular IDEs are JavaBeans and Eclipse

LEVERAGING YOUR PROGRAMMING SKILS

The following steps can help a new programmer to improve on his or her programming skills.
1. Practicing with examples in books.
2. Searching the internet.
3. Belonging to programming communities like www.msdn.com, www.soucecode.net, www.sourceforge.net, www.w3c.com, www.stackflow.com etc.

WHAT IS VISUAL BASIC?

In 2002, Microsoft released Visual Basic.NET(VB.NET) to replace Visual Basic 6. Thereafter, Microsoft declared VB6 a legacy programming language in 2008. Fortunately, Microsoft still provides some form of support for VB6. VB.NET is a fully object-oriented programming language implemented in the .NET Framework. It was created to cater for the development of the web as well as mobile applications. However, many developers still favor Visual Basic 6.0 over its successor Visual Basic.NET.

WHAT PROGRAMS CAN YOU CREATE WITH VISUAL BASIC 6?

In VB 6, you can create any program depending on your objective. For math teachers, you can create mathematical programs such as Geometric Progression, Quadratic Equation Solver, Simultaneous Equation Solver ,Prime Number Tester, Factors Finder, Quadratic Function Graph Plotter and so on. For science teachers, you can create simulation programs such as Projectile, Simple Harmonic Motion, Star War etc. If you are in business, you can also create business applications such as inventory management system , Amortization Calculator , investments calculator, point-of-sale system, payroll system, accounting program and more to help manage your business and increase productivity. For those of you who like games , you can create programs such as slot machine, reversi, tic tac toe and more. Besides, you can create multimedia programs such as Smart Audio Player, Multimedia Player and more. Indeed, there is no limit to what program you can create ! We offer many sample codes in our tutorial.

THE VISUAL BASIC 6 INTEGRATED DEVELOPMENT ENVIRONMENT

Before you can write programs in VB 6, you need to install Visual Basic 6 compiler on your computer. You can purchase a copy of Microsoft Visual Basic 6.0 Learning Edition or Microsoft Visual Basic Professional Edition from Amazon.com, both are vb6 compilers. Besides, you can also buy it from eBay at Microsoft Visual Basic 6.0 6 Professional PRO MSDN Library Manual Service Pack. If you have already installed Microsoft Office in your PC or laptop, you can also use the built-in Visual Basic Application in Excel to start creating Visual Basic programs without having to spend extra cash to buy the VB6 compiler.
You can also install VB6 on Windows 10 but you need to follow certain steps otherwise the installation will fail. First, you need to run setup as administrator. Next, you need to use custom installation. Clear the checkbox for Data Access. If you don't, set up will hang at the end of the installation. Finally, click next and wait for the installation to complete. For complete instructions, please follow this link Install VB6 on Windows 10
After installing the vb6 compiler, the icon will appear on your desktop or in your programs menu. Click on the icon to launch the VB6 compiler. On start up,
New Project Dialog
You can choose to either start a new project, open an existing project or select a list of recently opened programs. A project is a collection of files that make up your application. There are various types of applications that we could create, however, we shall concentrate on creating Standard EXE programs (EXE means executable). Before you begin, you must think of an application that preferably have commercial ,educational or recreational value. Next, click on the Standard EXE icon to go into the actual Visual Basic 6 programming environment.
When you start a new Visual Basic 6 Standard EXE project, you will be presented with the Visual Basic 6 Integrated Development Environment (IDE). The Visual Basic 6 Integrated Programming Environment is shown in Figure 1.2. It consists of the toolbox, the form, the project explorer and the properties window.
VB6 Programming Environment
The Form is the primary building block of a Visual Basic 6 application. A Visual Basic 6 application can actually comprise many forms, but we shall focus on developing an application with one form first. We will learn how to develop applications with multiple forms later. Before you proceed to build the application, it is a good practice to save the project first. You can save the project by selecting Save Project from the File menu, assign a name to your project and save it in a certain folder. You shall now proceed to learn Visual Basic programming from the next lesson onwards.











frank
frank

This is a short biography of the post author. Maecenas nec odio et ante tincidunt tempus donec vitae sapien ut libero venenatis faucibus nullam quis ante maecenas nec odio et ante tincidunt tempus donec.

No comments:

Post a Comment

read