Introduction By: Dr. Javad Razjouyan. Programming Languages.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Chapter 2: Algorithm Discovery and Design
Three types of computer languages
CMT1000: Introduction to Programming Ed Currie Lecture 2A: Pizza.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter 1 Introduction to Computers, Programs,
CHAPTER 1: INTORDUCTION TO C LANGUAGE
 2000 Prentice Hall, Inc. All rights reserved. 1 Introduction to Computers and C Programming Outline Introduction What Is a Computer? Computer Organization.
Concept of Computer Programming November 2, 2011.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANCI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Introduction to Computer Programming itc-314
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
Programming Design Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
COMPSCI 174- Introduction to C++ Class hour Section 01: MWF 9:55am – 10:45am. Hyer Hall 210.
Algorithms and Programming
Invitation to Computer Science, Java Version, Second Edition.
Introduction to Programming ICS2O Findlay. Learning Goals  We will learn  The definitions of a computer, program and programming language.  The different.
Computer Programming I An Introduction to the art and science of programming with C++
Computer Engineering 1 nd Semester Dr. Rabie A. Ramadan 1.
Programming With C.
1 Computers Can’t Cook! Programming Methodology Girls Engaged in Math and Science, June 2012 Bri Chapman.
The Algorithmic Model. What is Computer Science What is Programming Algorithms –Definition –Properties of Good Algorithms –Describing Algorithms –Examples.
Introduction to C++ Programming Language
King Saud University College of applied studies and community services CSC 1101 Computer Programming I Lecture 2.
Software – Applications software and programming languages.
Introduction to Programming Lecture No. 1. Books  Deitel & Deitel :– C++ How to Program  Kernighan and Ritchie:- The C Programming Language.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
History of UNIX a short version CSCI 333 August 31, 2011.
C Language: Introduction
Program & Programming Languages. Introduction to Programming Programming is the process of writing a computer program in a language that the computer.
The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction.
C programming language was developed in the seventies by a group of at the Bell Telephone lab. The C language was the outline of two earlier languages.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
Software Development. Software Development Loop Design  Programmers need a solid foundation before they start coding anything  Understand the task.
Computer Engineering 2 nd Semester Dr. Rabie A. Ramadan 2.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 1: Introduction.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet and the World Wide Web Outline 1.1Introduction 1.2What.
Programming Fundamentals Lecture No. 2. Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language.
CISC and RISC 12/25/ What is CISC? acronym for Complex Instruction Set Computer Chips that are easy to program and which make efficient use of memory.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Course Instructor: Hira Farman Course : BY:HIRA FARMAN.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Introduction to Computer Programming itc-314 Lecture 04.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
CSC141 Introduction to Computer Programming Programming Language.
Fundamentals of Programming C++ Programming Language CS 1400 Dennis A. Fairclough Version 1.1 C++ Programming Language CS 1400 Dennis A. Fairclough Version.
INTRODUCTION TO COMPUTER PROGRAMMING ITC-314. Computer Programming  Computer Programming means creating a sequence of instructions to enable a computer.
Main Part of a Computer.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Foundations of Computer Science C & C++ programming lecture 2
LESSON 1 Introduction to Programming Language
C Language VIVA Questions with Answers
Overview of C.
Introduction to C Programming Language
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Introduction to Computer Programming
(Course Introduction)
Introduction to Computer Programming
The Purpose of this Course
Algorithms vs. Programming
Algorithms vs. Programming
Presentation transcript:

Introduction By: Dr. Javad Razjouyan

Programming Languages

So, what exactly is a programming language? As a loose definition, a programming language is a tool used by a programmer to give the computer very specific instructions in order to serve some purpose for the user. A program is like a recipe. It outlines exactly the steps needed to create something or perform a certain task. For, example, when baking chocolate chip cookies, there are certain steps that need to be followed:

Chocolate Chip Cookies Baking Steps: mix eggs, butter, sugar in a bowl add flour, baking soda, and flavorings mix until creamy add chocolate chips bake in the oven.

For a person who has made cookies before and knows the amounts of each ingredient to use, this recipe is sufficient, however, for a person who has never baked cookies before, this recipe will not do. That person would need a recipe like the following: –place two eggs in a bowl –add 1.5 c. butter to the eggs –... –bake cookies for minutes at 375 degrees or until brown

There is still a problem with the preceding recipe. The first instruction says to put two eggs in the bowl, but it doesn't say to shell them first! This may seem like common sense, but it illustrates a fundamental concept: computers do exactly what they are told, no more, no less. When writing a program, a programmer must outline every possible step and scenario that could occur.

The first programming languages that emerged, were assembly languages. These languages are exactly the instruction set of a specific processor. These languages are very low-level and hard to understand. For example, say we wanted to add two numbers, 3 and 4 and get a result:

in C++: –int a = 3 + 4; in assembly: – ldl 3, R1 –ldl 4, R2 –addl R1, R2, R3

The version in C++ is easier to understand and simpler to write. This is analagous to the differences in the first recipe presented and the second recipe presented. The first recipe expressed the method of baking cookies on a high level, while the second method went more in depth on how to actually mix and bake the cookies. Programmers write their code in a high level language and then use a compiler to translate their code into an assembly language and then into a machine language that will run on the machine they are using.

Programs consist of algorithms. An algorithm is just a well-outlined method for completing a task. The above recipes could be called algorithms for the task of baking cookies. A high level algorithm for adding two numbers could be as follows: –ask the user for the first number –ask the user for the second number –add the two numbers –display the result on the screen

This high-level abstraction is not actual code. However, it does express the ideas of a program, and is called pseudo-code. Often, programmers will design their programs in pseudo-code, and then use this to write their actual code.

So, why is there more than one programming language? It may seem that a standard language should be agreed on, since all languages are translated using a compiler anyways. However, languages are often designed with a specific use in mind, and some are better than others for dealing with certain problems. So if a programmer is capable of writing a compiler (which is a very complex piece of software) then they can design and create a language.

The most important thing to remember about programming languages is that they are only an abstraction! Programming languages were created so developers could express their ideas on a higher level than a computer can understand. Once a user has a good concept of how computers work, and has learned a few computer languages, it becomes much easier to pick up new languages.

A programming language is a tool used by programmers in order to specifically outline a series of steps that a computer is to take in a certain instance. High-level programming languages allow a programmer to express ideas on an abstract level, and forces the compiler to worry about the low-level implementation details. This allows for faster development of applications, since applications are easier to write. There are even fourth generation languages emerging as viable programming languages. Recall that machine code is considered first generation, assembly languages are second generation, compiled languages are third generation. Fourth generation languages are actually code-generating environments, such as Microsoft's Visual Basic. These fourth generation languages allow programmers to express their ideas visually, and the environment then writes the code to implement these ideas.

Why Program in C++?

So what is so special about C++? Why should you use C++ to develop your applications? First, C++ is not the best language to use in every instance. C++ is a great choice in most instances, but some special circumstances would be better suited to another language. There are a few major advantages to using C++:

1. C++ allows expression of abstract ideas –C++ is a third generation language that allows a programmer to express their ideas at a high level as compared to assembly languages.

2. C++ still allows a programmer to keep low-level control –Even though C++ is a third generation language, it has some of the "feel" of an assembly language. It allows a programmer to get down into the low-level workings and tune as necessary. C++ allows programmers strict control over memory management.

3. C++ has national standards (ANSI) –C++ is a language with national standards. This is good for many reasons. Code written in C++ that conforms to the national standards can be easily integrated with preexisting code. Also, this allows programmers to reuse certain common libraries, so certain common functions do not need to be written more than once, and these functions behave the same anywhere they are used.

4. C++ is reusable and object-oriented –C++ is an object-oriented language. This makes programming conceptually easier (once the object paradigm has been learned) and allows easy reuse of code, or parts of code through inheritance.

5. C++ is widely used and taught –C++ is a very widely used programming language. Because of this, there are many tools available for C++ programming, and there is a broad base of programmers contributing to the C++ "community".

A Brief History of C++

The C++ Programming Language is basically an extension of the C Programming Language. The C Programming language was developed from at Bell labs, at the same time the UNIX operating system was being developed there. C was a direct descendant of the language B, which was developed by Ken Thompson as a systems programming language for the fledgling UNIX operating system. B, in turn, descended from the language BCPL which was designed in the 1960s by Martin Richards while at MIT.

In 1971 Dennis Ritchie at Bell Labs extended the B language (by adding types) into what he called NB, for "New B". Ritchie credits some of his changes to language constructs found in Algol68, although he states "although it [the type scheme], perhaps, did not emerge in a form that Algol's adherents would approve of" After restructuring the language and rewriting the compiler for B, Ritchie gave his new language a name: "C".

In 1983, with various versions of C floating around the computer world, ANSI established a committee that eventually published a standard for C in In 1983 Bjarne Stroustrup at Bell Labs created C++. C++ was designed for the UNIX system environment, it represents an enhancement of the C programming language and enables programmers to improve the quality of code produced, thus making reusable code easier to write. Bjarne Stroustrup