* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download interpreted language
Falcon (programming language) wikipedia , lookup
Functional programming wikipedia , lookup
Reactive programming wikipedia , lookup
Library (computing) wikipedia , lookup
Abstraction (computer science) wikipedia , lookup
Program optimization wikipedia , lookup
Scala (programming language) wikipedia , lookup
Go (programming language) wikipedia , lookup
History of compiler construction wikipedia , lookup
Programming language wikipedia , lookup
Object-oriented programming wikipedia , lookup
Structured programming wikipedia , lookup
Assembly language wikipedia , lookup
Java (programming language) wikipedia , lookup
Interpreter (computing) wikipedia , lookup
INTRODUCTION TO PROGRAMMING 1 ICS 3U WHAT IS A PROGRAM? A program is a set of instructions that makes the computer do something. There are two ways to supply a program to a computer: 1) Buy a program written by somebody else (Future Shop, Google Play Store, etc.). 2) Write the program yourself! 2 HISTORY OF PROGRAMMING Computer circuits are in one of two binary states: on when a signal is present or off when there is no signal present. Accordingly, computer programs are represented in binary (1’s and 0’s) at the lowest level. Called machine code, these strings of 1’s and 0’s are long and difficult to understand! Not only are they difficult to read, but they’re just as tough to write! 3 ASSEMBLY LANGUAGES As microprocessor development continued in the 1950s, symbolic machine languages called assembly languages came into the scene. Assembly languages allow the programmer to use symbolic commands rather than cryptic binary to accomplish tasks. A program called the assembler translates the source program (written in assembly) into an object program (encoded in binary) which can then be executed by your computer. 4 HIGH-LEVEL LANGUAGES Problem: Assembly languages are designed to work on certain microprocessors. A program written on one machine will not necessarily work on another. A high-level programming language provides easy-to-use shortcut commands to the programmer with minimal drawbacks. High-level source code needs to be compiled into machine code before execution. The program that does this translation is called a compiler. Highlevel languages can be compiled to run on the most common types of microprocessor. 5 EXAMPLE PROGRAM 6 INTERPRETED LANGUAGES Problem: If I want my software to run on both Windows and Mac, I have to program and compile for two separate platforms! Solution: Interpreted languages An interpreted language uses a program called an interpreter to translate the source code in machine language statement-by-statement – it is not compiled to run on any one particular platform. 7 THE JAVA PROGRAMMING LANGUAGE Released in 1995. An interpreted language, Java source code is compiled into Java bytecode. The Java Virtual Machine (JVM) interprets and runs the Java bytecode regardless of the computer architecture. Supports Object-Oriented Programming (OOP), a programming concept that allows us to represent concepts as “objects” which we can instantiate and use. 8 JAVA FUN FACTS Most Android smartphone apps are written using Java. A large amount of the Android operating system is also written in Java Javascript, commonly used in web-based settings, is nothing like Java. Kind of. The Java syntax is very similar to C/C++. Since Java is platform-independent, it does not permit as much communication with the computer hardware as C/C++. 9 JAVA FUN FACTS Some argue that Java is not efficient in comparison to C/C++. In Java, you can free up memory by simply not using it anymore. In C/C++, memory must be cleared by the programmer. This allows for stronger control over resources. Java has several classes that programmers can override and manipulate for special uses: Applet - programs that are embedded in other applications (commonly in web pages) Servlets – allows programmers to handle web server requests in a custom manner JavaServer Pages (JSPs) – allow for dynamic webpage creation 10 WHERE DO I TYPE MY PROGRAMS? We will be typing our Java programs in one of two IDEs (Integrated Developer Environments): Eclipse by IBM NetBeans, an open source IDE sponsored by Oracle Both IDEs are installed on the lab computers. Last year, students used Eclipse and it was slow. This year, we’ll try NetBeans. A Java program written using Eclipse will work in NetBeans – it’s your choice! 11