140 likes | 348 Views
Programming Concepts and Languages. Chapter 12 – Computers: Understanding Technology, 3 rd edition. Terminology. A program is a set of instructions telling a computer how to perform a task The program is written in a programming language
E N D
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3rd edition November 17. 2008
Terminology • A program is a set of instructions telling a computer how to perform a task • The program is written in a programming language • The programming language instructions are referred to as source code and the act of writing source code as coding November 17. 2008
Programming Languages • Fewer words and symbols and simpler syntax than natural language • Can either be low-level or high-level • Elements are variables, executable statements, decision statements, looping • Algorithm (complete list of steps for solving a problem) often written in pseudocode (high level language meant to describe steps) and then programmer writes in programming language November 17. 2008
Reusable Code • Certain problems or tasks recur in programming so it is desirable to avoid “reinventing the wheel” when this occurs • Subroutine or function to do certain tasks – the idea is that one needs to understand what inputs it needs and what outputs it produces but not how it works November 17. 2008
Program Execution • Some computer languages require a compiler, a computer program which translates the programming language source code into machine code • Other languages are executed via interpreters November 17. 2008
Documentation Tools • Flowcharts – Visual representation of algorithm – different shaped boxes are used for different types of statements (e.g. process, decision, data input/output) • Comments – Messages in programs that explain source code to later readers November 17. 2008
Programming Errors • Syntax errors • Logic errors • Runtime errors November 17. 2008
Programming Languages • Assembly languages – uses symbols and words to represent elements of machine language – 1 assembly language statement generally produces 1 machine code statement • COBOL (1960) – business applications language • RPG – Report Program Generator (IBM AS/400 mainframe) November 17. 2008
Programming Languages (cont.) • FORTRAN (1957) – dominated math and scientific programming • BASIC – interpreted language, originally developed as teaching tool • Visual Basic (VB) – language of choice for developing software prototypes • Visual Basic.Net (ITP 112, ITP 212) • C (ITP 130, ITP 230) – elements of both BASIC and assembly language, runs fast November 17. 2008
Programming Languages (cont.) • C++ (ITP 132, ITP 232) - superset of C • C# (ITP 136) - derived from C++ and Java • Java – (ITP 120, ITP 220, ITP 246) - cross-platform flexibility; when used in web pages, called applets, but this is rarely done now; web use is primarily server-side November 17. 2008
Scripting Languages • JavaScript (ITD 210, ITP 140, ITP 225) • VBScript • Perl November 17. 2008
Markup Languages • HTML – Hypertext Markup Language (ITD 110) • XHTML – Extensible Hypertext Markup Language • XML – Extensible Markup Languages • WML – Wireless Markup Language November 17. 2008