Rheinisch-Westfälische Technische Hochschule Aachen. Lehrstuhl für Datenmanagement und -exploration Prof. Dr. T. Seidl. Proseminar.

Size: px
Start display at page:

Download "Rheinisch-Westfälische Technische Hochschule Aachen. Lehrstuhl für Datenmanagement und -exploration Prof. Dr. T. Seidl. Proseminar."

Transcription

1 Rheinisch-Westfälische Technische Hochschule Aachen Lehrstuhl für Datenmanagement und -exploration Prof. Dr. T. Seidl Proseminar Google Go illustrated on the basis of Fibonacci numbers Jan Pennekamp Mai 2012 SS 2012 Betreuung: Dipl.-Ing. Marwan Hassani

2

3 Declaration of Originality The material in this paper has not previously been submitted for a degree in any University, and to the best of my knowledge contains no material previously published or written by another person except where due to acknowledgement is made in the paper itself. Aachen, the 31st May 2012

4

5 Contents List of Source Code List of Figures & Tables vi vii Abstract 1 1 Introduction Development of Google Go Plattform support Basics about Go Hello World program Data types of Go Control structures Memory management Advanced features The Fibonacci numbers in Go, Pascal and Java Short code of Google Go Exceptions Multiple return values and assignments Future and recent changes Go at Google Active development Own evaluation Bibliography List of Abbreviations Source Files I II IV v

6 List of Source Code 2.1 Hello World program implemented in Google Go Initializing a struct in Google Go Loops implemented in Google Go with the for command Package import in Google Go extracted from my own example Exception handling in Java Exception handling in Google Go Multiple return values in Google Go Multiple assignments in one call in Google Go Hello world program implemented in Google Go IV 2 Fibonacci Number calculation implemented in Google Go... V 3 Fibonacci Number calculation implemented in Pascal..... VI 4 Fibonacci Number calculation implemented in Java VII 5 Required additional file for the Java program VIII 6 Required additional file for the Java program VIII vi

7 List of Figures 1.1 Google Go logo Commonly known influences to Google Go List of Tables 1.1 Timeline of Go development [4] Goals of Google Go and matching decisions built-in standard types of Google Go [2] vii

8

9 Abstract This paper introduces the imparative programming language Google Go to the reader. The main aspect is why a programmer should use Go. There is an overview about the development and basic features included. On top of that some concepts of Go are illustrated in connection with the Fibonacci numbers and compared to Java and Pascal. As conclusion there is a brief look into the future and a rating of Go. 1

10 Chapter 1 Introduction Figure 1.1: Google Go logo 1.1 Development of Google Go Developers Go is developed an open source project by Google. Go development started in September 2007 with the developers Rob Pike, who worked a long time in a Unix-Team, where he developed the Plan 9 operating system [7], and Ken Thompson, who created the first Unix shell in 1971 and created the programming language B [6]. 2

11 1.1. Development of Google Go Timeline Table 1.1: Timeline of Go development [4] initial design public release TIOBE award 09 used at Google Go 1 release Sep Nov Jan May 2010 Mar Goals At the moment of its public release Go had many small issues, which made productive usage nearly impossible before May What were the reasons for developing a new programming language? Over the years computer systems have evolved in an enormous speed on the one hand. Yet no new system programming language was successfully developed on the other. The common used language C is in productive use since The project members tried to combine the advantages of both, imperative and dynamic programming languages, to create a new language, which is reliable, fast to code and compile. These ideas are expressed in the Go logo as well lines of Go source code compile in under ten seconds on a slow computer [5]. In addition to these goals Go should be used in every possible task, from system programming over mobile application programming to web server programming. The question the developers had in mind was, what would C look like today. As a modern programming language Go supports network and multiprocessor programming natively [1]. Some final design decisions are listed in the Table 1.2 below. Table 1.2: Goals of Google Go and matching decisions Goals Safety + Efficient Easy to code Left out pointer arithmetic inheritance Included garbage collector known syntax Go code should be short and easy to read and write as explained in my own example.

12 4 Chapter 1. Introduction Influences The basic syntax of Go is similar to the syntax of C, but there are influences from both, Java and Pascal as well [8].There are several languages with influence on the presented one, because Rob Pike took part in several projects [7]. The common known languages and its influences to Go are listed in the Figure 1.2. Figure 1.2: Commonly known influences to Google Go 1.2 Plattform support A Go compiler is officially available for Linux and Mac OS X systems. A Windows version was developed by a community project with a certain delay until Go 1 introduced an official version [4]. There are versions for all three major architectures i386, amd64, and ARM [4].

13 Chapter 2 Basics about Go 2.1 Hello World program List of Source Code 2.1: Hello World program implemented in Google Go 1 package main import " fmt " 4 func main () { fmt. Println (" Hello world ") 7 } The hello world program shows the basic syntax of Go. The striking change is that it does not require semicolons after a complete instruction. Only a for-loop needs semicolons in order to define the borders. Apart from that Go requires only one strict rule. The curly brackets need to be written in the same line as the function declaration or the used loop command. There is no special rule for text indent, so Go is plain in terms of formatting. Comments are added the same way they are in C or Java. 5

14 6 Chapter 2. Basics about Go 2.2 Data types of Go Table 2.1: built-in standard types of Google Go [2] Integer int8, int16, int32, uint8,... Float float32, float64 Other complex64, complex128, string, char, uchar Boolean bool Go has all kinds of built-in types, the size of these types can be given in its declaration. The language also has functions for explicit type conversion, which can be useful in some cases. Google Go is not an object-oriented programming language, but it features structures, which are already known in C or as records in Pascal. The initialization of those types is less code in Go than in any other language [3]. This new concept, seen with structs in Listing 2.2, is working with arrays, sets and maps as well. In addition to that Go supports anonymous types in structs [3]. This way the compiler decides based on the given type in which part of the struct the information has to be written in. List of Source Code 2.2: Initializing a struct in Google Go type example struct { 2 number int name string } 5... var ( valuea example = example {1, " one "} 8 valueb example = example {2, " two "} ) 2.3 Control structures Like all of its successors Go offers if-else control structures. This and other control structures can be used with all kinds of known comparative operational factors. On top of that Go handles bitwise operations [3]. Paradoxically Go features the GoTo command, which is generally known for making the code unreadable [1]. In comparison to other languages Go features a complex switch command. It is not only working with integers and characters, it is working with all kind of types [4]. This way a long if-else chain can be cleaned up into a switch command. This feature is used in my own code.

15 2.4. Memory management 7 Another big change compared to earlier languages is that Go does not support while and repeat/do commands. Go only providesfor-loops. The following code in Listing 2.3 shows how to implement these loops in Go. List of Source Code 2.3: Loops implemented in Google Go with the for command // regular for loop for i := 0; i < 10; i++ {... } 3 // while loop for ; sum < 1000; {... } 6 for sum < 1000 {... } // infinite loop 9 for ; ; {... } for true {... } for {... } 2.4 Memory management A change compared to C is that pointer in Go are not used to directly change the accessed memory address [3]. This is a decision for security and readableness of the code. Typically pointers are used to mark if a function accesses a variable call-by-value or call-by-reference. Therefore the star in a function declaration in Go can be compared to the keyword VAR in Pascal. This does not mean that all variables are saved in the stack when working with Go. Allocating heap memory works the same way it does in Pascal, by using the command new [3]. To follow Go s concept there is one step forward compared to Pascal. Not referenced memory will be freed automatically by the garbage collector [4]. Another important feature Go offers will be presented later in connection with my own example in Listing 3.2, it treats the concept of multiple return values and assignments.

16 8 Chapter 2. Basics about Go 2.5 Advanced features The package system and import is currently very similar to the one Java provides [8]. There is one exception in Go it is possible to declare a name for the imported package this can be used before an imported command [3]. This is shown in Listing 2.4. List of Source Code 2.4: Package import in Google Go extracted from my own example 1 import (. " fmt " err " errors " 4 ) At first Google Go did not support any exception or error handling, this was added in a later version of Go [4]. As of today there are regular errors, which do not affect the program s stability, and panics, which create a run time error after a critical event. Like the Java programming language, Go has an implementation for the interfaces design pattern built-in [3]. Therefore a program can be planned very well between multiple code writers. On top of that Go provides an extra tool, which creates an overview over the current file and its implementations, it is calles godoc [4]. In contrast to Java, Go has not yet implemented a tool for verifying a program s correctness. Although Go is a young programming language, there are many packages which offer functions on special data types. For example there are maps, linked lists, rings and heaps implemented [4]. Go as well has many mathematical functions in several packages. Over the years these collection will surely grow further.

17 Chapter 3 The Fibonacci numbers in Go, Pascal and Java 3.1 Short code of Google Go This example shows the calculation of Fibonacci numbers from 1 to 99 in Google Go, Pascal and Java. All programs feature basic error handling and use an imperative algorithm to calculate the result. The Fibonacci numbers are used to illustrate different aspect in computer sciene and return repeatedly during the study. Both Java and Go have around 35 lines of code, but the Go program uses clearly less characters (707 characters vs characters). Nevertheless the Go code is as readable as the Java code. Pascal has only few lines more, but it is missing a real error handling, which both alternatives provide. My intention in this example was to limit the program s range to calculate the Fibonacci numbers, therefore only Pascal catches wrong inputs. This does not mean that wrong inputs cannot be handled in Java and Go. 3.2 Exceptions The most sophisticated exception system is built in Java, but this spectrum of features is not possible in Go, because it is not an object-oriented language. As presented in my example Go can throw errors as well and this way the programmer can prevent the program from crashing. 9

18 10 Chapter 3. The Fibonacci numbers in Go, Pascal and Java List of Source Code 3.1: Exception handling in Java try { System. out. println (" The fibonacci number of " + n + " is " + fib (n)); } 2 catch ( FibonacciNegativeException fne ) { System. out. println (" Number lower / equal zero, try again.");} catch ( FibonacciTooBigException ftbe ) 5 { System. out. println (" Number higher / equal 100, try again.");} public static long fib ( int n) throws FibonacciNegativeException, FibonacciTooBigException { 8 if (n <= 0) throw new FibonacciNegativeException (); if (n >= 100) 11 throw new FibonacciTooBigException ();... } List of Source Code 3.2: Exception handling in Google Go 1 switch { case n <= 0: return 0, 1, err. New (" Number lower / equal zero, try again.") 4 case n >= 100: return 0, 1, err. New (" Number higher / equal 100, try again.") } 7... if err!= nil { f. Println ( err ) 10 } else { f. Printf (" The fibonacci number of %v is %v\n",n,res ) } Compared to the better known programming languages, this code features two interesting features of Go. First there is the early mentioned use of the complex switch command [4]. The code in Listing 3.2 shows how to write an if-else chain with this new concept. This makes the code more readable and requires less typing as well. In other languages long if-else chains limit the readability and comprehension enormously.

19 3.3. Multiple return values and assignments Multiple return values and assignments The second Go feature that is implemented in my example is the possibility to obtain multiple return values by a function. Surely this is possible by returning a struct or an array as well, but with in Go such a program can be written without much foreknowledge and without complex data types. It is not necessary to declare a special type and the code stays more simple. But why use multiple return values? In this example the program could continue in a form, where the user is asked if he or she wants to calculate a higher Fibonacci number. This way the current calculated number and the index could be transferred to the function and the previous calculation would not have to be repeated. This is not implemented in the presented code to keep it short and comparable to the other. List of Source Code 3.3: Multiple return values in Google Go // function declaration func fib (a, b int64, n int ) ( int64, int64, error ) { 3 // name parameters return values // function call 6 _,res, err := fib (0,1,n) // return values name parameters This limited example had one advantage as well, leaving out this aspect allowed me to show another feature of Go. The underscore is used when a function returns a value, which is not needed later on at this point of the program [4]. This way the same function can be used in different parts of a program, where different return values matter. Further more there is no memory wasted for not needed values. The Go compiler even stops with an error when this concept is not used in the code. Another small feature of Go which is included in the code is that Go is able to process multiple assignments in one line [3]. This is very convienient when switching the values of two variables. In my example it is used to calculate the Fibonacci numbers iterative. But using more than two assignments in one row, will make the code less readable, as it is already obvious in my example. List of Source Code 3.4: Multiple assignments in one call in Google Go b, a = a+b, b 2 // uses the values of the variables before the call The Pascal code is attachted at the end of this paper to see the resemblence of the syntax. There is no other programming technique included.

20 Chapter 4 Future and recent changes 4.1 Go at Google Google itself uses Go in various projects, the website shows what Go is capable of, because it is written in this new language [4]. In the future there will follow more projects which are based on Google Go. Recently Go developed from a new language with stability issues to a language, which has a real major version for productive use. The mentioned version was released on March 28th 2012 and is called Go 1 [4]. It has no major feature changes, it mostly brings more stability. The purpose of this release is to create a final standard of Go. All following releases should be compatible with this version. Go 1 even includes a tool which brings old Go programs to the new Go 1 standard [4]. Most of these syntax changes affect only some special aspects [4]. 4.2 Active development Go development is very active, there are many aspects which were added after the first release [4]. A better error handling was included after the initial release. More and more the developers are adding functional concepts into Go. The interesting programming techniques form Go into an innovative and interesting language. Higher order functions which are known from Haskell are already supported in the current build of Go [8]. On top of that the developer will add generics to the code at some point [4]. In the past year this was not a priority, because stability was more urgent. A GUI for Go will be provided in the future as well [4]. 12

21 4.3. Own evaluation Own evaluation My personal opinion on Go is that it has chances to become a widely used programming language. It combines the advantages of the most popular languages and creates a simple and fast to write language. Experts in C, Java or Pascal can understand and transfer to Go quickly. Beginners have a simple language with all modern benefits. There is a well maintained wiki on the website [4]. The main reason for learning Go is that the programmer can use it in any project, Go is available for every platform and device [4]. From my point of view there is no reason not to use Go. Every feature Go promises is included and working. With special requirements which are not matched by Go another language might be the better choice, but nearly every program can be implemented with another program design in Go. Some people refuse Go, because it is different and new or because it is supported by Google. Today 25 of 50 core developers are independent and not financed by Google [4]. In May 2012 there have been published three books about Google Go, which all look quite promising and interesting. Before Go 1 it was hard to find much literature, but the ones available showed a nice introduction and an easy transfer to Go. Now Go standard is final [4] and more papers and literature will follow.

22 Bibliography [1] Ivo Balbaert. The Way to Go - A Thorough Introduction to the Go Programming Language. iuniverse, Antwerp, Covers the release of Go 1. [2] Rainer Feike. German community site to promote Google Go. May visited on May 18th [3] Rainer Feike and Steffen Blass. Programmierung in Google Go. Addison- Wesley, München, [4] Google. The Go Programming Language - offical website. May visited on May 18th [5] Google Developers. The Go Programming Language Promo. May visited on May 18th [6] Miscellaneous. Wikipedia arcticle about Ken Thompson. May http: //en.wikipedia.org/wiki/ken_thompson visited on May 18th [7] Miscellaneous. Wikipedia arcticle about Rob Pike. May http: //en.wikipedia.org/wiki/rob_pike visited on May 18th [8] Frank Müller. Systemprogrammierung in Google Go - Grundlagen- Skalierbarkeit- Performanz- Sicherheit. Dpunkt.Verlag GmbH, Heidelberg, Available in the university library. I

23 List of Abbreviations amd64 is an extension of the i386 instruction set, it supports larger address spaces than i386 ARM ARM architecture is the most widely used 32-bit instruction set architecture in numbers produced, it is mostly used in tablets, mobile phones, music players, and calculators cbr call-by-reference, a called function is allowed to change variables in the main program cbv call-by-value, a called function recieves a copy of variables and can not change them in the main program i386 is an architecture that defines the instruction set for microprocessors, most personal computers use this set, it is currently replaced by amd64 Go Google Go GUI graphical user interface object-oriented programming is a programming technique using "objects" to interact within a data structures consisting of data fields and methods open source project everyone can support the developers and contribute to the base code and its future Plan 9 operating system from Bell Labs developed primarily for research purposes as the successor to Unix shell is software that provides an interface for users which provides access to the services of the main part of the operating system struct structure / record II

24 TIOBE well-known programming language ranking on TIOBE award entitles the programming language of the year based on the ranking on TIOBE Unix operating system originally developed in 1969 and predecessor of many systems, e.g. Mac OS or Linux III

25 Source Files List of Source Code 1: Hello world program implemented in Google Go 1 package main import " fmt " 4 func main () { fmt. Println (" Hello world ") 7 } IV

26 V List of Source Code 2: Google Go package main 2 // package import import (. " fmt " 5 err " errors " ) Fibonacci Number calculation implemented in 8 // function with 3 return values func fib (a, b int64, n int ) ( int64, int64, error ) { // if - else chain - exception handling 11 switch { case n <= 0: return 0, 1, err. New (" Number lower / equal zero, try again.") 14 case n >= 100: return 0, 1, err. New (" Number higher / equal 100, try again.") } 17 // calculation for i := int (b); i < n; i++ { b, a = a+b, b 20 } return a, b, nil } 23 // main procedure func main () { 26 var n int f. Printf (" This program calculates the fibonacci numbers iterative.\n") // while loop 29 for { f. Printf (" Which fibonacci number should be computed?\ n" ) f. Scanf ("%d", &n) 32 // function call _,res, err := fib (0,1,n) if err!= nil { 35 f. Println ( err ) // error output } else { f. Printf (" The fibonacci number of %v is %v\n",n,res ) // result output 38 } } } 41 // 707 characters without comments

27 VI SOURCE FILES List of Source Code 3: Fibonacci Number calculation implemented in Pascal 1 PROGRAM fibonacci ; USES crt ;// package import VAR n : INTEGER ; 4 res : LONGINT ; // function 7 FUNCTION Fibonacci ( n : INTEGER ) : LONGINT ; VAR i : INTEGER ; a,b,c : LONGINT ; 10 BEGIN // calculation a := 0; b := 1; 13 FOR i := 2 TO n DO BEGIN c := a + b; 16 a := b; b := c; END ; 19 Fibonacci := b; END ; 22 // main procedure BEGIN Writeln ( This program calculates the fibonacci numbers iterative. ); 25 // while loop WHILE ( true ) DO BEGIN 28 REPEAT Writeln ( Which fibonacci number should be computed? ); Readln (n); 31 // exception handling IF (n <= 0) THEN Writeln ( Number lower / equal zero, try again. ) 34 ELSE IF ( n >= 100) THEN Writeln ( Number higher / equal 100, try again. ) ; UNTIL ( n > 0) AND ( n < 100) ; 37 Writeln ; // function call res := Fibonacci (n); 40 Writeln ( The fibonacci number of, n, is, res ); // result output Writeln ; END ; 43 END. // 760 characters without comments

28 VII List of Source Code 4: Fibonacci Number calculation implemented in Java 1 public class Fibonacci { // function public static long fib ( int n) 4 throws FibonacciNegativeException, FibonacciTooBigException { // if - else chain - exception handling if (n <= 0) 7 throw new FibonacciNegativeException (); if (n >= 100) throw new FibonacciTooBigException (); 10 // calculation long a = 0, b = 1, c; for ( int i = 2; i <= n; i ++) { 13 c = a + b; a = b; b = c; 16 } return b; } 19 // main procedure public static void main ( String [] args ) { 22 System. out. println (" This program calculates the fibonacci numbers iterative."); // while loop while ( true ) { 25 System. out. println (" Which fibonacci number should be computed?"); int n = Integer. parseint ( System. console (). readline ()); System. out. println (); 28 // result output try { System. out. println (" The fibonacci number of " + n + " is " + fib (n)); } catch ( FibonacciNegativeException fne ) // error output 31 { System. out. println (" Number lower / equal zero, try again.");} catch ( FibonacciTooBigException ftbe ) // error output { System. out. println (" Number higher / equal 100, try again.");} 34 System. out. println (); } } 37 } // 1020 characters without comments

29 VIII SOURCE FILES List of Source Code 5: Required additional file for the Java program 1 public class FibonacciNegativeException extends Exception { } List of Source Code 6: Required additional file for the Java program 1 public class FibonacciTooBigException extends Exception { }

Go Forth and Code. Jonathan Gertig. CSC 415: Programing Languages. Dr. Lyle

Go Forth and Code. Jonathan Gertig. CSC 415: Programing Languages. Dr. Lyle J o n a t h a n G e r t i g P a g e 1 Go Forth and Code Jonathan Gertig CSC 415: Programing Languages Dr. Lyle 2013 J o n a t h a n G e r t i g P a g e 2 Go dogs Go or A Brief History of Go 6 years ago

More information

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language 1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

More information

Motivations History Principles Language Gommunity Success stories Conclusion. Let s Go! A brief introduction to Google s new language.

Motivations History Principles Language Gommunity Success stories Conclusion. Let s Go! A brief introduction to Google s new language. Let s Go! A brief introduction to Google s new language Aurélien Dumez Inria Bordeaux - Sud-Ouest aurelien.dumez@inria.fr Tuesday, October 2nd 2012 Content - 1/2 1 2 3 4 Characteristics SDK vs Examples

More information

Learn C programme. C Programming language. Cloud1 C tutorial

Learn C programme. C Programming language.   Cloud1 C tutorial Learn C programme C Programming language www.cloud1.me Cloud1 C tutorial About The Tutorial C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie

More information

Programming in C. What is C?... What is C?

Programming in C. What is C?... What is C? C Programming in C UVic SEng 265 Developed by Brian Kernighan and Dennis Ritchie of Bell Labs Earlier, in 1969, Ritchie and Thompson developed the Unix operating system We will be focusing on a version

More information

Programming in C UVic SEng 265

Programming in C UVic SEng 265 Programming in C UVic SEng 265 Daniel M. German Department of Computer Science University of Victoria 1 SEng 265 dmgerman@uvic.ca C Developed by Brian Kernighan and Dennis Ritchie of Bell Labs Earlier,

More information

Programming in C. What is C?... What is C?

Programming in C. What is C?... What is C? Programming in C UVic SEng 265 C Developed by Brian Kernighan and Dennis Ritchie of Bell Labs Earlier, in 1969, Ritchie and Thompson developed the Unix operating system We will be focusing on a version

More information

CS Prof J.P.Morrison

CS Prof J.P.Morrison CS1061 2018-2019 Prof J.P.Morrison C Programming C is the most popular language worldwide. Everything from microcontrollers to operating systems is written in C flexible and versatile, allowing maximum

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

TYPES, VALUES AND DECLARATIONS

TYPES, VALUES AND DECLARATIONS COSC 2P90 TYPES, VALUES AND DECLARATIONS (c) S. Thompson, M. Winters 1 Names, References, Values & Types data items have a value and a type type determines set of operations variables Have an identifier

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Introduction To C#.NET

Introduction To C#.NET Introduction To C#.NET Microsoft.Net was formerly known as Next Generation Windows Services(NGWS).It is a completely new platform for developing the next generation of windows/web applications. However

More information

Syntax and Variables

Syntax and Variables Syntax and Variables What the Compiler needs to understand your program, and managing data 1 Pre-Processing Any line that starts with # is a pre-processor directive Pre-processor consumes that entire line

More information

Preview from Notesale.co.uk Page 6 of 52

Preview from Notesale.co.uk Page 6 of 52 Binary System: The information, which it is stored or manipulated by the computer memory it will be done in binary mode. RAM: This is also called as real memory, physical memory or simply memory. In order

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Type Conversion. and. Statements

Type Conversion. and. Statements and Statements Type conversion changing a value from one type to another Void Integral Floating Point Derived Boolean Character Integer Real Imaginary Complex no fractional part fractional part 2 tj Suppose

More information

Professor Peter Cheung EEE, Imperial College

Professor Peter Cheung EEE, Imperial College 1/1 1/2 Professor Peter Cheung EEE, Imperial College In this lecture, we take an overview of the course, and briefly review the programming language. The rough guide is not very complete. You should use

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

Jython. An introduction by Thinh Le

Jython. An introduction by Thinh Le Jython An introduction by Thinh Le precursor_python! Google App Engine! Dropbox! PyGTK (Gnome)! Vim (embedded)! BitTorrent/Morpheus! Civilization/Battlefield Jython! Interpretation of Python (1997)! Jim

More information

Go Cheat Sheet. Operators. Go in a Nutshell. Declarations. Basic Syntax. Hello World. Functions. Comparison. Arithmetic. Credits

Go Cheat Sheet. Operators. Go in a Nutshell. Declarations. Basic Syntax. Hello World. Functions. Comparison. Arithmetic. Credits Credits Go Cheat Sheet Most example code taken from A Tour of Go, which is an excellent introduction to Go. If you're new to Go, do that tour. Seriously. Original HTML Cheat Sheet by Ariel Mashraki (a8m):

More information

Topic 6: A Quick Intro To C

Topic 6: A Quick Intro To C Topic 6: A Quick Intro To C Assumption: All of you know Java. Much of C syntax is the same. Also: Many of you have used C or C++. Goal for this topic: you can write & run a simple C program basic functions

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

More information

LECTURE 18. Control Flow

LECTURE 18. Control Flow LECTURE 18 Control Flow CONTROL FLOW Sequencing: the execution of statements and evaluation of expressions is usually in the order in which they appear in a program text. Selection (or alternation): a

More information

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath UNIT - I Introduction to C Programming Introduction to C C was originally developed in the year 1970s by Dennis Ritchie at Bell Laboratories, Inc. C is a general-purpose programming language. It has been

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types and

More information

Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types. Record Types. Pointer and Reference Types

Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types. Record Types. Pointer and Reference Types Chapter 6 Topics WEEK E FOUR Data Types Introduction Primitive Data Types Character String Types User-Defined Ordinal Types Array Types Associative Arrays Record Types Union Types Pointer and Reference

More information

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline CS 0 Lecture 8 Chapter 5 Louden Outline The symbol table Static scoping vs dynamic scoping Symbol table Dictionary associates names to attributes In general: hash tables, tree and lists (assignment ) can

More information

Introduce C# as Object Oriented programming language. Explain, tokens,

Introduce C# as Object Oriented programming language. Explain, tokens, Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation

More information

The Awesomeness of Go. Igor Lankin DevFest Karlsruhe, Nov 2016

The Awesomeness of Go. Igor Lankin DevFest Karlsruhe, Nov 2016 The Awesomeness of Go Igor Lankin DevFest Karlsruhe, Nov 2016 Igor Lankin Software Developer @ inovex C#, Java, Java Script, full-time GO (waipu.tv ) 2 What is Go? 3 An Awesome Programming Language 4 Imagine

More information

C++ for Python Programmers

C++ for Python Programmers C++ for Python Programmers Adapted from a document by Rich Enbody & Bill Punch of Michigan State University Purpose of this document This document is a brief introduction to C++ for Python programmers

More information

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor CS 261 Fall 2017 Mike Lam, Professor C Introduction Variables, Memory Model, Pointers, and Debugging The C Language Systems language originally developed for Unix Imperative, compiled language with static

More information

Questions. Exams: no. Get by without own Mac? Why ios? ios vs Android restrictions. Selling in App store how hard to publish? Future of Objective-C?

Questions. Exams: no. Get by without own Mac? Why ios? ios vs Android restrictions. Selling in App store how hard to publish? Future of Objective-C? Questions Exams: no Get by without own Mac? Why ios? ios vs Android restrictions Selling in App store how hard to publish? Future of Objective-C? Grading: Lab/homework: 40%, project: 40%, individual report:

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 4 Thomas Wies New York University Review Last week Control Structures Selection Loops Adding Invariants Outline Subprograms Calling Sequences Parameter

More information

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are: LESSON 1 FUNDAMENTALS OF C The purpose of this lesson is to explain the fundamental elements of the C programming language. C like other languages has all alphabet and rules for putting together words

More information

The current topic: Python. Announcements. Python. Python

The current topic: Python. Announcements. Python. Python The current topic: Python Announcements! Introduction! reasons for studying languages! language classifications! simple syntax specification Object-oriented programming: Python Types and values Syntax

More information

DOMjudge team manual. Summary. Reading and writing. Submitting solutions. Viewing scores, submissions, etc.

DOMjudge team manual. Summary. Reading and writing. Submitting solutions. Viewing scores, submissions, etc. judge DOMjudge team manual Summary /\ DOM DOM judge Here follows a short summary of the system interface. This is meant as a quick introduction, to be able to start using the system. It is, however, strongly

More information

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309 A Arithmetic operation floating-point arithmetic, 11 12 integer numbers, 9 11 Arrays, 97 copying, 59 60 creation, 48 elements, 48 empty arrays and vectors, 57 58 executable program, 49 expressions, 48

More information

COMP 202 Java in one week

COMP 202 Java in one week CONTENTS: Basics of Programming Variables and Assignment Data Types: int, float, (string) Example: Implementing a calculator COMP 202 Java in one week The Java Programming Language A programming language

More information

EL2310 Scientific Programming

EL2310 Scientific Programming (yaseminb@kth.se) Overview Overview Roots of C Getting started with C Closer look at Hello World Programming Environment Discussion Basic Datatypes and printf Schedule Introduction to C - main part of

More information

C Introduction. Comparison w/ Java, Memory Model, and Pointers

C Introduction. Comparison w/ Java, Memory Model, and Pointers CS 261 Fall 2018 Mike Lam, Professor C Introduction Comparison w/ Java, Memory Model, and Pointers Please go to socrative.com on your phone or laptop, choose student login and join room LAMJMU The C Language

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu/program/philippines-summer-2012/ Philippines Summer 2012 Lecture 1 Introduction to Python June 19, 2012 Agenda About the Course What is

More information

Bash command shell language interpreter

Bash command shell language interpreter Principles of Programming Languages Bash command shell language interpreter Advanced seminar topic Louis Sugy & Baptiste Thémine Presentation on December 8th, 2017 Table of contents I. General information

More information

High Performance Computing

High Performance Computing High Performance Computing MPI and C-Language Seminars 2009 Photo Credit: NOAA (IBM Hardware) High Performance Computing - Seminar Plan Seminar Plan for Weeks 1-5 Week 1 - Introduction, Data Types, Control

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

We do not teach programming

We do not teach programming We do not teach programming We do not teach C Take a course Read a book The C Programming Language, Kernighan, Richie Georgios Georgiadis Negin F.Nejad This is a brief tutorial on C s traps and pitfalls

More information

Comp 333: Concepts of Programming Languages Fall 2016

Comp 333: Concepts of Programming Languages Fall 2016 Comp 333: Concepts of Programming Languages Fall 2016 Instructor: Professor Schwartz History Syntax and Semantics Compilers Language Constructs Names, Binding, Scoping, Data Types Expressions, Control

More information

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information Laboratory 2: Programming Basics and Variables Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information 3. Comment: a. name your program with extension.c b. use o option to specify

More information

Topic 6: A Quick Intro To C. Reading. "goto Considered Harmful" History

Topic 6: A Quick Intro To C. Reading. goto Considered Harmful History Topic 6: A Quick Intro To C Reading Assumption: All of you know basic Java. Much of C syntax is the same. Also: Some of you have used C or C++. Goal for this topic: you can write & run a simple C program

More information

Recursion Enums. Basics of Programming 1. Department of Networked Systems and Services G. Horváth, A.B. Nagy, Z. Zsóka, P. Fiala, A.

Recursion Enums. Basics of Programming 1. Department of Networked Systems and Services G. Horváth, A.B. Nagy, Z. Zsóka, P. Fiala, A. Recursion The enumerated type Recursion Enums Basics of Programming 1 Department of Networked Systems and Services G. Horváth, A.B. Nagy, Z. Zsóka, P. Fiala, A. Vitéz 31 October, 2018 based on slides by

More information

Scientific Computing

Scientific Computing Scientific Computing Martin Lotz School of Mathematics The University of Manchester Lecture 1, September 22, 2014 Outline Course Overview Programming Basics The C++ Programming Language Outline Course

More information

Course May 18, Advanced Computational Physics. Course Hartmut Ruhl, LMU, Munich. People involved. SP in Python: 3 basic points

Course May 18, Advanced Computational Physics. Course Hartmut Ruhl, LMU, Munich. People involved. SP in Python: 3 basic points May 18, 2017 3 I/O 3 I/O 3 I/O 3 ASC, room A 238, phone 089-21804210, email hartmut.ruhl@lmu.de Patrick Böhl, ASC, room A205, phone 089-21804640, email patrick.boehl@physik.uni-muenchen.de. I/O Scientific

More information

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003 Control Flow COMS W1007 Introduction to Computer Science Christopher Conway 3 June 2003 Overflow from Last Time: Why Types? Assembly code is typeless. You can take any 32 bits in memory, say this is an

More information

Multimedia-Programmierung Übung 3

Multimedia-Programmierung Übung 3 Multimedia-Programmierung Übung 3 Ludwig-Maximilians-Universität München Sommersemester 2016 Ludwig-Maximilians-Universität München Multimedia-Programmierung 1-1 Today Ludwig-Maximilians-Universität München

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu Cali, Colombia Summer 2012 Lesson 1 Introduction to Python Agenda What is Python? and Why Python? Basic Syntax Strings User Input Useful

More information

Manual Allocation. CS 1622: Garbage Collection. Example 1. Memory Leaks. Example 3. Example 2 11/26/2012. Jonathan Misurda

Manual Allocation. CS 1622: Garbage Collection. Example 1. Memory Leaks. Example 3. Example 2 11/26/2012. Jonathan Misurda Manual llocation Dynamic memory allocation is an obvious necessity in a programming environment. S 1622: Garbage ollection Many programming languages expose some functions or keywords to manage runtime

More information

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer.

The Compiler So Far. CSC 4181 Compiler Construction. Semantic Analysis. Beyond Syntax. Goals of a Semantic Analyzer. The Compiler So Far CSC 4181 Compiler Construction Scanner - Lexical analysis Detects inputs with illegal tokens e.g.: main 5 (); Parser - Syntactic analysis Detects inputs with ill-formed parse trees

More information

Topic 1: Introduction

Topic 1: Introduction Recommended Exercises and Readings Topic 1: Introduction From Haskell: The craft of functional programming (3 rd Ed.) Readings: Chapter 1 Chapter 2 1 2 What is a Programming Paradigm? Programming Paradigm:

More information

Contents of Lecture 3

Contents of Lecture 3 Contents of Lecture 3 Repetition of matrices double a[3][4]; double* b; double** c; Terminology Linkage Types Conversions Jonas Skeppstedt (js@cs.lth.se) Lecture 3 2014 1 / 33 A global matrix: double a[3][4]

More information

Java Quick Syntax Reference. Second Edition. Mikael Olsson

Java Quick Syntax Reference. Second Edition. Mikael Olsson Java Quick Syntax Reference Second Edition Mikael Olsson Java Quick Syntax Reference Second Edition Mikael Olsson Java Quick Syntax Reference Mikael Olsson Hammarland, Länsi-Suomi, Finland ISBN-13 (pbk):

More information

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003 Outline Object Oriented Programming Autumn 2003 2 Course goals Software design vs hacking Abstractions vs language (syntax) Java used to illustrate concepts NOT a course about Java Prerequisites knowledge

More information

Differentiate Between Keywords and Identifiers

Differentiate Between Keywords and Identifiers History of C? Why we use C programming language Martin Richards developed a high-level computer language called BCPL in the year 1967. The intention was to develop a language for writing an operating system(os)

More information

CSC 1214: Object-Oriented Programming

CSC 1214: Object-Oriented Programming CSC 1214: Object-Oriented Programming J. Kizito Makerere University e-mail: jkizito@cis.mak.ac.ug www: http://serval.ug/~jona materials: http://serval.ug/~jona/materials/csc1214 e-learning environment:

More information

A short, pragmatic and INCOMPLETE intro to C++/ROOT programming. Mikołaj Krzewicki Nikhef/UU

A short, pragmatic and INCOMPLETE intro to C++/ROOT programming. Mikołaj Krzewicki Nikhef/UU A short, pragmatic and INCOMPLETE intro to C++/ROOT programming. Mikołaj Krzewicki Nikhef/UU C++ Middle-level, statically typed, free-form, multiparadigm, compiled language(wikipedia.org). Development

More information

Lecture 1: Overview of Java

Lecture 1: Overview of Java Lecture 1: Overview of Java What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed for easy Web/Internet applications Widespread

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Scala : an LLVM-targeted Scala compiler

Scala : an LLVM-targeted Scala compiler Scala : an LLVM-targeted Scala compiler Da Liu, UNI: dl2997 Contents 1 Background 1 2 Introduction 1 3 Project Design 1 4 Language Prototype Features 2 4.1 Language Features........................................

More information

Chapter 2: Programming Concepts

Chapter 2: Programming Concepts Chapter 2: Programming Concepts Objectives Students should Know the steps required to create programs using a programming language and related terminology. Be familiar with the basic structure of a Java

More information

The Go Programming Language. Frank Roberts

The Go Programming Language. Frank Roberts The Go Programming Language Frank Roberts frank.roberts@uky.edu - C++ (1983), Java (1995), Python (1991): not modern - Java is 18 years old; how has computing changed in 10? - multi/many core - web programming

More information

And Parallelism. Parallelism in Prolog. OR Parallelism

And Parallelism. Parallelism in Prolog. OR Parallelism Parallelism in Prolog And Parallelism One reason that Prolog is of interest to computer scientists is that its search mechanism lends itself to parallel evaluation. In fact, it supports two different kinds

More information

EECS 388 C Introduction. Gary J. Minden August 29, 2016

EECS 388 C Introduction. Gary J. Minden August 29, 2016 EECS 388 C Introduction Gary J. Minden August 29, 2016 1 C Developed at AT&T Bell Laboratories in the early 1970s by Dennis Richie Intended as a systems programming language, that is used to write operating

More information

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018 CS 31: Intro to Systems Pointers and Memory Kevin Webb Swarthmore College October 2, 2018 Overview How to reference the location of a variable in memory Where variables are placed in memory How to make

More information

Let s Go! Akim D le, Etienne Renault, Roland Levillain. June 8, TYLA Let s Go! June 8, / 58

Let s Go! Akim D le, Etienne Renault, Roland Levillain. June 8, TYLA Let s Go! June 8, / 58 Let s Go! Akim Demaille, Etienne Renault, Roland Levillain June 8, 2017 TYLA Let s Go! June 8, 2017 1 / 58 Table of contents 1 Overview 2 Language Syntax 3 Closure 4 Typed functional programming and Polymorphism

More information

About this exam review

About this exam review Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review

More information

Overview COMP Microprocessors and Embedded Systems. Lectures 18 : Pointers & Arrays in C/ Assembly

Overview COMP Microprocessors and Embedded Systems. Lectures 18 : Pointers & Arrays in C/ Assembly COMP 3221 Microprocessors and Embedded Systems Lectures 18 : Pointers & Arrays in C/ Assembly http://www.cse.unsw.edu.au/~cs3221 Overview Arrays, Pointers, Functions in C Example Pointers, Arithmetic,

More information

Lecture 22 Go http://xkcd.com/979/ Go developed ~2007 at Google by Robert Griesemer, Rob Pike, Ken Thompson open sourced in 2009 compiled, statically typed very fast compilation C-like syntax garbage collection

More information

Go for Java Developers

Go for Java Developers Go for Java Developers Stoyan Rachev May 26-27 16, Sofia 1 Agenda Introduction Variables and Control Flow Types and Data Structures Functions Methods and Interfaces Concurrency Conclusion 2 What is Go?

More information

Programming Lecture 3

Programming Lecture 3 Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Winter 2017 Lecture 7b Andrew Tolmach Portland State University 1994-2017 Values and Types We divide the universe of values according to types A type is a set of values and

More information

Introduction to Java https://tinyurl.com/y7bvpa9z

Introduction to Java https://tinyurl.com/y7bvpa9z Introduction to Java https://tinyurl.com/y7bvpa9z Eric Newhall - Laurence Meyers Team 2849 Alumni Java Object-Oriented Compiled Garbage-Collected WORA - Write Once, Run Anywhere IDE Integrated Development

More information

CS1622. Semantic Analysis. The Compiler So Far. Lecture 15 Semantic Analysis. How to build symbol tables How to use them to find

CS1622. Semantic Analysis. The Compiler So Far. Lecture 15 Semantic Analysis. How to build symbol tables How to use them to find CS1622 Lecture 15 Semantic Analysis CS 1622 Lecture 15 1 Semantic Analysis How to build symbol tables How to use them to find multiply-declared and undeclared variables. How to perform type checking CS

More information

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations

C#.Net. Course Contents. Course contents VT BizTalk. No exam, but laborations , 1 C#.Net VT 2009 Course Contents C# 6 hp approx. BizTalk 1,5 hp approx. No exam, but laborations Course contents Architecture Visual Studio Syntax Classes Forms Class Libraries Inheritance Other C# essentials

More information

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

Slide Set 3. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng

Slide Set 3. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng Slide Set 3 for ENCM 339 Fall 2017 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary September 2017 ENCM 339 Fall 2017 Section 01

More information

Senthil Kumaran S

Senthil Kumaran S Senthil Kumaran S http://www.stylesen.org/ Agenda History Basics Control Flow Functions Modules History What is Python? Python is a general purpose, object-oriented, high level, interpreted language Created

More information

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 19 Introduction to C++

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 19 Introduction to C++ CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 19 Introduction to C++ C++ C++ is an enormous language: All of C Classes and objects (kind of like Java, some crucial differences) Many

More information

Types II. Hwansoo Han

Types II. Hwansoo Han Types II Hwansoo Han Arrays Most common and important composite data types Homogeneous elements, unlike records Fortran77 requires element type be scalar Elements can be any type (Fortran90, etc.) A mapping

More information

EC 413 Computer Organization

EC 413 Computer Organization EC 413 Computer Organization C/C++ Language Review Prof. Michel A. Kinsy Programming Languages There are many programming languages available: Pascal, C, C++, Java, Ada, Perl and Python All of these languages

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING LAB 1 REVIEW THE STRUCTURE OF A C/C++ PROGRAM. TESTING PROGRAMMING SKILLS. COMPARISON BETWEEN PROCEDURAL PROGRAMMING AND OBJECT ORIENTED PROGRAMMING Course basics The Object

More information

Presented By : Gaurav Juneja

Presented By : Gaurav Juneja Presented By : Gaurav Juneja Introduction C is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs of UNIX are written

More information

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016 CS 31: Intro to Systems Pointers and Memory Martin Gagne Swarthmore College February 16, 2016 So we declared a pointer How do we make it point to something? 1. Assign it the address of an existing variable

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014 Lesson 6A Loops By John B. Owen All rights reserved 2011, revised 2014 Topic List Objectives Loop structure 4 parts Three loop styles Example of a while loop Example of a do while loop Comparison while

More information

CompSci 125 Lecture 02

CompSci 125 Lecture 02 Assignments CompSci 125 Lecture 02 Java and Java Programming with Eclipse! Homework:! http://coen.boisestate.edu/jconrad/compsci-125-homework! hw1 due Jan 28 (MW), 29 (TuTh)! Programming:! http://coen.boisestate.edu/jconrad/cs125-programming-assignments!

More information

Praktische Softwaretechnologie

Praktische Softwaretechnologie Praktische Softwaretechnologie Lecture 2. Károly Bósa () Research Institute for Symbolic Computation (RISC) 1 Books James Gosling, Bill Joy, Guy Steele The JavaTM Language Specification 2 Books James Gosling,

More information