Source Code Basics. Code For a computer to execute instructions, it needs to be in binary Each instruction is given a number Known as “operation code”

Slides:



Advertisements
Similar presentations
GCSE Computing Lesson 5.
Advertisements

Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
101.  When you communicate with people you use a language that you both understand.  The trick is that the computer does not speak English.  To communicate.
Software. What Is Software? software –Also called Computer programs –Are a list of instructions –Instructions are called code –CPU performs the instructions.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Introduction to Java Programming
Reasons to study concepts of PL
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Floating-Point and High-Level Languages Programming Languages Spring 2004.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Compilers and Interpreters. Translation to machine language Every high level language needs to be translated to machine code There are different ways.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
Introduction to Java.
Course: Introduction to Computers
1 Programming Languages Examples: C, Java, HTML, Haskell, Prolog, SAS Also known as formal languages Completely described and rigidly governed by formal.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
IB Computer Science II Paul Bui
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
CS 355 – Programming Languages
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Standard Grade Computing SYSTEM SOFTWARE CHAPTER 19.
Java Virtual Machine Java Virtual Machine A Java Virtual Machine (JVM) is a set of computer software programs and data structures that use.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Introduction 1-1 Introduction to Virtual Machines From “Virtual Machines” Smith and Nair Chapter 1.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Compiling and the Java Virtual Machine (JVM). The syntax of Pseudocode is pretty loose –visual validation encourages a permissive approach –emphasized.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
1 3. Computing System Fundamentals 3.1 Language Translators.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
Introduction  Program: Set of sequence instruction that tell the computer what to do.  Software: A collection of programs, data, and information. 
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
Introduction to Programming 1 1 2Introduction to Java.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
HIGH-LEVEL LANGUAGE PROGRAMMING PARADIGMS. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
High-level language programming paradigms. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
Computer Systems Nat 5 Computing Science
Basic Concepts: computer, program, programming …
Why don’t programmers have to program in machine code?
Lecture 1b- Introduction
Introduction to Computers, the Internet and the World Wide Web
Introduction to programming
Sections Basic Concepts of Programming
Computer Systems Nat 5 Computing Science
Topic: Difference b/w JDK, JRE, JIT, JVM
A451 Theory – 7 Programming 7A, B - Algorithms.
1.1 Reasons to study concepts of PLs
Want to Write a Compiler?
Lecture 1 Runtime environments.
Translators & Facilities of Languages
High Level Programming Languages
PROGRAMMING What is it?.
IB Computer Science II Paul Bui
Introduction to Virtual Machines
Lecture 1 Runtime environments.
Introduction to Virtual Machines
Reasons To Study Programming Languages
1.3.7 High- and low-level languages and their translators
Programming language translators
Presentation transcript:

Source Code Basics

Code For a computer to execute instructions, it needs to be in binary Each instruction is given a number Known as “operation code” Collection of these is what a program “binary” is

Op Codes

Punch Cards

But…

Machine Code Punch-card like instructions still used today – Called machine code, or (technically incorrect) assembly language Now we convert human-readable instructions into this What a program “binary” is. What companies sell and is too complex to figure out how it works exactly… but sometimes….

Source Enter 2 nd generation programming languages – First (most significantly) C – C++ – Java More for humans – using English words

C++ and Java

JVM Sometimes called the Java Runtime Environment (JRE) The java program is the JVM/JRE Is why Java is secure (checks and controls java code, isolates it) and portable (java code just needs to worry about the JVM)

Languages: C++ C++ Pro: Fast! Con: Have to worry about so many details, complex -> slow to implement (just like machine code)

Languages: Java Java Pro: Worry about less (e.g. memory), fully object oriented (more in line with real world), less machine oriented Con: Slow (mostly) run speed, very slow load speed

Languages: 4 th Generation Ruby, Swift, Python, Shell Pros: Worry about even less, more human centric (even like natural language), higher programmer efficiency Cons: Even slower (but computers are getting faster), loss of control over some things (like memory)

4 th Generation Non-compiled Java and C# is halfway (still compile for the interpreter) Likely to dominate most programming as computers speed up and problems get more complex Interpreter is like the JVM, each language needs one (ruby, python, sh) Bad for learning… hide too many fundamentals

The Point Never have a general argument about which language is “better” Always pros and cons. There are tradeoffs Only which language is best for the given problem or project

Java Source Java enforces rules: Every source code file must be.java Every file must have a matching class definition with exact same name (case sensitive!) Brackets {} groups “blocks” of code All normal code must belong to a class

Example Java