Don t Go Java! Edition 2019
|
|
- Ralf Simmons
- 5 years ago
- Views:
Transcription
1 Don t Go, Java!
2 Don t Go Java!
3 Don t Go Java! Edition 2019
4 Disclaimer
5 Disclaimer I actually like Go!
6 Guess The Movie
7 Guess The Movie
8 Guess The Movie
9 Guess The Movie
10 Who s That Dude? Chris Engelbert Senior Developer Instana Java-Passionate (10+ years) Go (2 years) Performance Garbage Collection Benchmark Fairytales
11 Who s That
12 Who s That Dude? Adores TypeScript Prefers Kotlin Codes
13 Who s That Dude? Kinda likes Go Adores TypeScript Prefers Kotlin Codes
14 Who s That Dude? Kinda likes Go Adores TypeScript Forced to use JS Prefers Kotlin Totally hates Python Codes
15 Who s That Dude? Kinda likes Go Adores TypeScript Forced to use JS Prefers Kotlin Totally hates Python Codes Java LOVES BEER! (Dah,
16 What is?
17 What Is Go? s t r a P d o o G e h T : Go d e t a nion i p o s t I. 1
18 What Is Go? General Purpose Language Inception: 2009 Version 1.0: 2012 Current Release:
19 What Is Go?
20 What Is Go? Type Inference package main func main() { value := "my string"
21 What Is Go? Type Inference Package Declaration package main func main() { value := "my string"
22 What Is Go? Type Inference Package Declaration package main Main (Entry) Function func main() { value := "my string"
23 What Is Go? Type Inference Package Declaration package main Main (Entry) Function Variable Declaration func main() { value := "my string"
24 What Is Go? Type Inference Package Declaration package main Main (Entry) Function Variable Declaration func main() { value := "my string" Variable
25 What Is Go? Type Inference Package Declaration package main Main (Entry) Function Variable Declaration func main() { value := "my string" Variable Create and Infer Type
26 What Is Go? Type Inference Package Declaration package main Main (Entry) Function Variable Declaration func main() { value := "my string" Variable Some String Create and Infer Type
27 What Is Go? Type Inference package main func main() { value := "my string"
28 What Is Go? Type Inference package main func main() { value := "my string" Compile Error
29 What Is Go? Type Inference package main func main() { value := "my string Compile Error
30 What Is Go? Extensive Stdlib package main import "io/ioutil" func main() {
31 What Is Go? Extensive Stdlib package main Import Declaration import "io/ioutil" func main() {
32 What Is Go? Extensive Stdlib Archive (tar, zip, ) Sorting Byte Manipulation Math HTML Templates (Buffered) IO Time Debugging Reflection OS (Exec, File, ) Database (SQL) Encoding (base64, hex, csv, json, xml, ) Compression (bzip2, flate, gzip, ) Crypto (aes, dsa, rsa, sha, tls, ) Logging Net (TCP, UDP, Unix Socket, )
33 What Is Go? Extensive Stdlib package main import "io/ioutil" func main() {
34 What Is Go? Extensive Stdlib package main import "io/ioutil" func main() { Compile Error
35 What Is Go? Extensive Stdlib package main import "io/ioutil" func main() { Compile Error
36 What Is Go? Multi-Value Return func main() { x, y := findcoordinates("conference") func findcoordinates(place string) (x, y int) { return 0, 0
37 What Is Go? Multi-Value Return func main() { x, y := findcoordinates("conference") func findcoordinates(place string) (x, y int) { return 0, 0 Defines Two Return Values (both type int)
38 What Is Go? Automatic Resource Management package main import "os" func main() { file, _ := os.open("/tmp/foo") defer file.close()
39 What Is Go? Automatic Resource Management package main import "os" func main() { ignore return value file, _ := os.open("/tmp/foo") defer file.close()
40 What Is Go? Automatic Resource Management package main import "os" func main() { ignore return value file, _ := os.open("/tmp/foo") defer file.close() file.close() should be called on Method return
41 What else is? Unfortunately!
42 What Is Go too? - Unfortunately Error Handling func main() { file, err := os.open("/tmp/foo") if err!= nil { log.fatal(err) defer file.close()
43 What Is Go too? - Unfortunately Error Handling func foo() error { file, err := os.open("/tmp/foo") if err!= nil { return err defer file.close() return nil
44 What Is Go too? - Unfortunately Public Vs. (Package) Private func Foo() { func foo() {
45 What Is Go too? - Unfortunately Public Vs. (Package) Private public func Foo() { func foo() { private
46 What Is Go too? - Unfortunately Public Vs. (Package) Private? func 日本語 () {
47 What Is Go too? - Unfortunately Public Vs. (Package) Private private func 日本語 () {
48 What Is Go too? - Unfortunately Syntax func (f *foo) method(p1 *string) (foo, error) { if p1 == nil { return "", errors.new("nil pointer") return "foo", nil
49 What Is Go too? - Unfortunately Syntax Bind Method to Type Pointer-To-Foo func (f *foo) method(p1 *string) (foo, error) { if p1 == nil { return "", errors.new("nil pointer") return "foo", nil
50 What Is Go too? - Unfortunately Syntax func (f *foo) method(p1 *string) (foo, error) { if p1 == nil { return "", errors.new("nil pointer") return "foo", nil
51 What Is Go too? - Unfortunately Syntax func (f *foo(*string)) method(p1 *string) (foo, error) { if p1 == nil { return "", errors.new("nil pointer") return "foo", nil
52 What Is Go too? - Unfortunately
53 5 Things You Can Hate About Go But You Don t Have To
54 You re Crazy, But Don t You Worry!
55 You re Crazy, But Don t You Worry! func foo(var1 string) { { var1 := "bar" fmt.println(var1) break func main() { foo("foo")
56 You re Crazy, But Don t You Worry! func foo(var1 string) { { fmt := "bar" fmt.println(var1) break func main() { foo("foo")
57 You re Crazy, But Don t You Worry! type task struct { func main() { task := &task{
58 You re Crazy, But Don t You Worry! type task struct { func main() { instantiation task := &task{
59 You re Crazy, But Don t You Worry! type task struct { func main() { task := &task{ task = &task{
60 Clone Or Not Clone, That Is The Question!
61 Clone Or Not Clone, That Is The Question! type handle int func types(val interface{) { switch v := val.(type) { case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
62 Clone Or Not Clone, That Is The Question! type handle int func types(val interface{) { switch v := val.(type) { reflective type case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
63 Clone Or Not Clone, That Is The Question! func main() { var var1 int = 1 var var2 handle = 2 type handle int types(var1) types(var2) func types(val interface{) { switch v := val.(type) { case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
64 Clone Or Not Clone, That Is The Question! func main() { var var1 int = 1 var var2 handle = 2 type handle = int types(var1) types(var2) func types(val interface{) { switch v := val.(type) { case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
65 Clone Or Not Clone, That Is The Question! func main() { var var1 int = 1 var var2 handle = 2 type handle int types(var1) types(var2) func types(val interface{) { switch v := val.(type) { case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
66 Clone Or Not Clone, That Is The Question! func main() { var var1 int = 1 var var2 handle = 2 type handle = int types(var1) types(var2) func types(val interface{) { switch v := val.(type) { case int: fmt.println(fmt.sprintf("i am an int: %d", v)) switch v := val.(type) { case handle: fmt.println(fmt.sprintf("i am an handle: %d", v))
67 Clone Or Not Clone, That Is The Question! type Callable func() func test(callable Callable) { callable() func main() { mycallable := func() { fmt.println("callable") test(mycallable)
68 Clone Or Not Clone, That Is The Question! type Callable func() func main() { callable1 := func() { fmt.println("callable1") func test(val interface{) { switch v := val.(type) { case func(): var callable2 Callable callable2 = func() { fmt.println("callable2") v() default: fmt.println("wrong type") test(callable1) test(callable2)
69 He Looks Lazy, Isn t He?
70 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { functions[i] = func() { fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
71 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) map instantiation for i := 0; i < 3; i++ { functions[i] = func() { fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
72 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { map instantiation loop functions[i] = func() { fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
73 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { functions[i] = func() { map instantiation loop closure fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
74 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { functions[i] = func() { fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
75 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { functions[i] = func(i int) func() { return func() { fmt.println(fmt.sprintf("iterator value: %d", i)) (i) functions[0]() functions[1]() functions[2]()
76 He Looks Lazy, Isn t He? func main() { functions := make([]func(), 3) for i := 0; i < 3; i++ { i := i functions[i] = func() { fmt.println(fmt.sprintf("iterator value: %d", i)) functions[0]() functions[1]() functions[2]()
77 Aren t We All A Little Bit Gopher?
78 Aren t We All A Little Bit Gopher? type Sortable interface { Sort(other Sortable)
79 Aren t We All A Little Bit Gopher? type Sortable interface { Sort(other Sortable) type MyStruct struct{ func (m MyStruct) Sort(other Sortable) {
80 Aren t We All A Little Bit Gopher? type Sortable interface { Sort(other Sortable) type MyStruct struct{ func (m MyStruct) Sort(other Sortable) { func main() { var foo Sortable = &MyStruct{ foo.sort(&mystruct{)
81 Aren t We All A Little Bit Gopher? type Sortable interface { Sort(other Sortable) type MyStruct struct{ func (m MyStruct) Sort(other Sortable) {
82 Aren t We All A Little Bit Gopher? type Sortable interface { Sort(other Sortable) type MyStruct struct{ func (m MyStruct) Sort(other Sortable) { var _ Sortable = MyStruct{ var _ Sortable = (*MyStruct)(nil)
83 It s Nil Or Nothing!
84 It s Nil Or Nothing! type MyError string func (m MyError) Error() string { return string(m)
85 It s Nil Or Nothing! type MyError string func (m MyError) Error() string { return string(m) type error interface { Error() string
86 It s Nil Or Nothing! type MyError string func (m MyError) Error() string { return string(m)
87 It s Nil Or Nothing! type MyError string func (m MyError) Error() string { return string(m) func test(v bool) error { var e *MyError = nil if v { return nil return e func main() { fmt.println(nil == test(true)) fmt.println(nil == test(false))
88 Seriously? I Don t Give A FAQ!
89 Seriously? I Don t Give A FAQ!
90 Remember Not Here To Scare You!
91 Remember Not Here To Scare You! But There Will Be Dragons
92 ? Questions???
93 ? Thank You??
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 informationGo Tutorial. Arjun Roy CSE 223B, Spring 2017
Go Tutorial Arjun Roy arroy@eng.ucsd.edu CSE 223B, Spring 2017 Administrative details TA Office Hours: EBU3B B250A, Tuesday 5-7PM TA Email: arroy@eng.ucsd.edu All labs due by 2359 PDT. Lab 1 due: 4/13/2017.
More informationdeveloped ~2007 by Robert Griesemer, Rob Pike, Ken Thompson open source
Go developed ~2007 by Robert Griesemer, Rob Pike, Ken Thompson open source compiled, statically typed syntax looks sort of like C garbage collection built-in concurrency no classes or type inheritance
More informationRemote Procedure Call
Remote Procedure Call Introduction Socket and HTTP programming use a message-passing paradigm. A client sends a message to a server which usually sends a message back. Both sides ae responsible for creating
More informationWilliam Kennedy. Brian Ketelsen Erik St. Martin Steve Francia FOREWORD BY MANNING WITH
SAMPLE CHAPTER William Kennedy WITH FOREWORD BY Brian Ketelsen Erik St. Martin Steve Francia MANNING Go in Action by William Kennedy with Brian Ketelsen and Erik St. Martin Chapter 2 Copyright 2015 Manning
More informationThe 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 informationOperating Systems. 18. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Spring /20/ Paul Krzyzanowski
Operating Systems 18. Remote Procedure Calls Paul Krzyzanowski Rutgers University Spring 2015 4/20/2015 2014-2015 Paul Krzyzanowski 1 Remote Procedure Calls 2 Problems with the sockets API The sockets
More informationCSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files
CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs
More informationCSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.
CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs
More informationChapter 1 Getting Started
Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different
More informationOral Question Bank for CL-3 Assignment
Oral Question Bank for CL-3 Assignment What is difference between JDK,JRE and JVM? What do you mean by platform independence? What is class loader and byte code? What is class, Object? what is mean by
More informationRecap: Functions as first-class values
Recap: Functions as first-class values Arguments, return values, bindings What are the benefits? Parameterized, similar functions (e.g. Testers) Creating, (Returning) Functions Iterator, Accumul, Reuse
More informationunderstanding
understanding nil @francesc thanks welcome every single one of you agenda what is nil? what is nil in Go? what does nil mean? is nil useful? nil? you misspelled null how I learn words how I learn words
More informationLecture 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 informationDistributed Systems 8. Remote Procedure Calls
Distributed Systems 8. Remote Procedure Calls Paul Krzyzanowski pxk@cs.rutgers.edu 10/1/2012 1 Problems with the sockets API The sockets interface forces a read/write mechanism Programming is often easier
More informationGo Tutorial. To do. A brief, gentle intro to Go. Next Networking. q Today
Go Tutorial To do q Today A brief, gentle intro to Go q Next Networking About Go Developed by Google Webpage: https://golang.org/ Concurrency was a priority in the language design A bit of a mix between
More informationPierce Ch. 3, 8, 11, 15. Type Systems
Pierce Ch. 3, 8, 11, 15 Type Systems Goals Define the simple language of expressions A small subset of Lisp, with minor modifications Define the type system of this language Mathematical definition using
More informationCS558 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 informationCSC209 Review. Yeah! We made it!
CSC209 Review Yeah! We made it! 1 CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files 2 ... and C programming... C basic syntax functions
More informationVariables and Bindings
Net: Variables Variables and Bindings Q: How to use variables in ML? Q: How to assign to a variable? # let = 2+2;; val : int = 4 let = e;; Bind the value of epression e to the variable Variables and Bindings
More informationSwift. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder
Swift Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Why Swift Recommended for all ios, macos, watchos,
More informationFunctions & Variables !
Functions & Variables 02-201! What Is Programming? Programming is clearly, correctly telling a computer what to do. Programming Executable Program Algorithm: (English) instructions to the computer Programming
More information416 Distributed Systems. RPC Day 2 Jan 12, 2018
416 Distributed Systems RPC Day 2 Jan 12, 2018 1 Last class Finish networks review Fate sharing End-to-end principle UDP versus TCP; blocking sockets IP thin waist, smart end-hosts, dumb (stateless) network
More informationIntroduction to C: Pointers
Introduction to C: Pointers Nils Moschüring PhD Student (LMU) Nils Moschüring PhD Student (LMU), Introduction to C: Pointers 1 1 Introduction 2 Pointers Basics Useful: Function
More informationCOMP-520 GoLite Tutorial
COMP-520 GoLite Tutorial Alexander Krolik Sable Lab McGill University Winter 2019 Plan Target languages Language constructs, emphasis on special cases General execution semantics Declarations Types Statements
More informationGo 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 informationDistributed Systems. How do regular procedure calls work in programming languages? Problems with sockets RPC. Regular procedure calls
Problems with sockets Distributed Systems Sockets interface is straightforward [connect] read/write [disconnect] Remote Procedure Calls BUT it forces read/write mechanism We usually use a procedure call
More informationLecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs
1 Lecture Overview Methods and Interfaces Methods review Interfaces Example: using the sort interface Anonymous fields in structs Generic printing using the empty interface Maps Creating a map Accessing
More informationInstantiation of Template class
Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double
More informationTH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo
TH IRD EDITION Python Cookbook David Beazley and Brian K. Jones O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo Table of Contents Preface xi 1. Data Structures and Algorithms 1 1.1. Unpacking
More informationStanford CS193p. Developing Applications for ios. Fall CS193p. Fall
Stanford Developing Applications for ios Today Mostly Swift but some other stuff too Autolayout teaser Quick review of what we learned in Concentration CountableRange of floating point numbers Tuples Computed
More informationGo 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 informationIntroduction 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 informationCS 222: Arrays, Strings, Structs
CS 222: Arrays, Strings, Structs Chris Kauffman Week 3-1 Logistics Reading Ch 6 (arrays) Ch 7 (structs) HW 2 & 3 HW 2 due tonight Conditionals, loops, arrays, natural log HW 3 up tomorrow, due next week
More informationSWIFT! init(title: String) { self.title = title } // required initializer w/ named parameter
SWIFT! class Session { let title: String // constant non-optional field: can never be null and can never be changed var instruktør: Person? // variable optional field: null is permitted var attendees:
More informationClasses. Logical method to organise data and functions in a same structure. Also known as abstract data type (ADT).
UNITII Classes Logical method to organise data and functions in a same structure. Also known as abstract data type (ADT). It s a User Defined Data-type. The Data declared in a Class are called Data- Members
More informationObject Oriented Programming in C#
Introduction to Object Oriented Programming in C# Class and Object 1 You will be able to: Objectives 1. Write a simple class definition in C#. 2. Control access to the methods and data in a class. 3. Create
More informationThe 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 informationRemote Invocation. To do. Request-reply, RPC, RMI. q Today q. q Next time: Indirect communication
Remote Invocation To do q Today q Request-reply, RPC, RMI q Next time: Indirect communication Beyond message passing In DS, all IPC is based on low-level msg passing A bit too low level Modern distributed
More informationthe gamedesigninitiative at cornell university Lecture 7 C++ Overview
Lecture 7 Lecture 7 So You Think You Know C++ Most of you are experienced Java programmers Both in 2110 and several upper-level courses If you saw C++, was likely in a systems course Java was based on
More informationCourse 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 informationScala : 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 informationIntroduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy
Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 5, 2009 Agenda 1 Introduction and Overview 2 Socket Programming 3
More informationPython Training. Complete Practical & Real-time Trainings. A Unit of SequelGate Innovative Technologies Pvt. Ltd.
Python Training Complete Practical & Real-time Trainings A Unit of. ISO Certified Training Institute Microsoft Certified Partner Training Highlights : Complete Practical and Real-time Scenarios Session
More informationCSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341)
CSE 413 Languages & Implementation Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341) 1 Goals Representing programs as data Racket structs as a better way to represent
More information2D Game design Intro to Html 5
2D Game design Intro to Html 5 Javascript Javascript: Dynamic untyped Object Oriented interpreted language Typecast as a web language Could be used for a variety of tasks Dymanic? Javascript Javascript:
More information6. Pointers, Structs, and Arrays. 1. Juli 2011
1. Juli 2011 Einführung in die Programmierung Introduction to C/C++, Tobias Weinzierl page 1 of 50 Outline Recapitulation Pointers Dynamic Memory Allocation Structs Arrays Bubble Sort Strings Einführung
More informationCS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco
CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level
More informationGo 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 informationJava Basics. Object Orientated Programming in Java. Benjamin Kenwright
Java Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Java Concepts Syntax, Grammar, Formatting, Introduce Object-Orientated Concepts Encapsulation, Abstract Data, OO Languages,
More informationDialects of ML. CMSC 330: Organization of Programming Languages. Dialects of ML (cont.) Features of ML. Functional Languages. Features of ML (cont.
CMSC 330: Organization of Programming Languages OCaml 1 Functional Programming Dialects of ML ML (Meta Language) Univ. of Edinburgh,1973 Part of a theorem proving system LCF The Logic of Computable Functions
More information1d: tests knowing about bitwise fields and union/struct differences.
Question 1 1a: char ptr[] = Hello World ; char a = ptr[1], b = *(ptr+6); Creates an array of 12 elements, 11 visible letters and a character value 0 at the end. i true ii true iii false iv false v true
More informationObject Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.
CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java
More informationOverview. Exercise 0: Implementing a Client. Setup and Preparation
Overview This Lab assignment is similar to the previous one, in that you will be implementing a simple client server protocol. There are several differences, however. This time you will use the SOCK_DGRAM
More informationBegin at the beginning
Begin at the beginning Expressions (Syntax) Exec-time Dynamic Values (Semantics) Compile-time Static Types 1. Programmer enters expression 2. ML checks if expression is well-typed Using a precise set of
More informationSymbolic Computation and Common Lisp
Symbolic Computation and Common Lisp Dr. Neil T. Dantam CSCI-56, Colorado School of Mines Fall 28 Dantam (Mines CSCI-56) Lisp Fall 28 / 92 Why? Symbolic Computing: Much of this course deals with processing
More informationCrash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++
Crash Course in Java Netprog: Java Intro 1 Why Java? Network Programming in Java is very different than in C/C++ much more language support error handling no pointers! (garbage collection) Threads are
More informationIntroduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy
Network Programming Samuli Sorvakko/Nixu Oy Telecommunications software and Multimedia Laboratory T-110.4100 Computer Networks October 16, 2008 Agenda 1 Introduction and Overview Introduction 2 Socket
More informationProgramming Languages
CSE 130 : Spring 2011 Programming Languages Lecture 3: Crash Course Ctd, Expressions and Types Ranjit Jhala UC San Diego A shorthand for function binding # let neg = fun f -> fun x -> not (f x); # let
More informationDesign Issues. Subroutines and Control Abstraction. Subroutines and Control Abstraction. CSC 4101: Programming Languages 1. Textbook, Chapter 8
Subroutines and Control Abstraction Textbook, Chapter 8 1 Subroutines and Control Abstraction Mechanisms for process abstraction Single entry (except FORTRAN, PL/I) Caller is suspended Control returns
More informationFuture Web App Technologies
Future Web App Technologies Mendel Rosenblum MEAN software stack Stack works but not the final say in web app technologies Angular.js Browser-side JavaScript framework HTML Templates with two-way binding
More informationCS 32. Lecture 5: Templates
CS 32 Lecture 5: Templates Vectors Sort of like what you remember from Physics but sort of not Can have many components Usually called entries Like Python lists Array vs. Vector What s the difference?
More informationgo-tutorial Documentation Release latest
go-tutorial Documentation Release latest Jun 04, 2017 Contents 1 Lesson 1: Introduction, installation and first code 3 1.1 Introduction............................................... 3 1.2 Links, bibliography............................................
More informationDevelop your Embedded Applications Faster: Comparing C and Golang. Marcin Pasinski Mender.io
Develop your Embedded Applications Faster: Comparing C and Golang Marcin Pasinski Mender.io My view on C vs Go I think Go is great and very productive programming language It excels when developing networking
More informationCS 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 informationApplications. Cloud. See voting example (DC Internet voting pilot) Select * from userinfo WHERE id = %%% (variable)
Software Security Requirements General Methodologies Hardware Firmware Software Protocols Procedure s Applications OS Cloud Attack Trees is one of the inside requirement 1. Attacks 2. Evaluation 3. Mitigation
More informationCMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics
Recall Architecture of Compilers, Interpreters CMSC 330: Organization of Programming Languages Source Scanner Parser Static Analyzer Operational Semantics Intermediate Representation Front End Back End
More informationCS558 Programming Languages
CS558 Programming Languages Fall 2016 Lecture 7a Andrew Tolmach Portland State University 1994-2016 Values and Types We divide the universe of values according to types A type is a set of values and a
More informationRemote Procedure Calls (RPC)
Distributed Computing Remote Procedure Calls (RPC) Dr. Yingwu Zhu Problems with Sockets Sockets interface is straightforward [connect] read/write [disconnect] BUT it forces read/write mechanism We usually
More informationOverview. Exercise 0: Implementing a Client. Setup and Preparation
Overview This Lab assignment is similar to the previous one, in that you will be implementing a simple clientserver protocol. There are several differences, however. This time you will use the SOCK_DGRAM
More informationCS 220: Introduction to Parallel Computing. Arrays. Lecture 4
CS 220: Introduction to Parallel Computing Arrays Lecture 4 Note: Windows I updated the VM image on the website It now includes: Sublime text Gitkraken (a nice git GUI) And the git command line tools 1/30/18
More informationNews. CSE 130: Programming Languages. Environments & Closures. Functions are first-class values. Recap: Functions as first-class values
CSE 130: Programming Languages Environments & Closures News PA 3 due THIS Friday (5/1) Midterm NEXT Friday (5/8) Ranjit Jhala UC San Diego Recap: Functions as first-class values Arguments, return values,
More informationShort Notes of CS201
#includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system
More informationStarting to Program in C++ (Basics & I/O)
Copyright by Bruce A. Draper. 2017, All Rights Reserved. Starting to Program in C++ (Basics & I/O) On Tuesday of this week, we started learning C++ by example. We gave you both the Complex class code and
More informationPython INTRODUCTION: Understanding the Open source Installation of python in Linux/windows. Understanding Interpreters * ipython.
INTRODUCTION: Understanding the Open source Installation of python in Linux/windows. Understanding Interpreters * ipython * bpython Getting started with. Setting up the IDE and various IDEs. Setting up
More informationthe gamedesigninitiative at cornell university Lecture 6 C++: Basics
Lecture 6 C++: Basics So You Think You Know C++ Most of you are experienced Java programmers Both in 2110 and several upper-level courses If you saw C++, was likely in a systems course Java was based on
More informationD Programming Language
Group 14 Muazam Ali Anil Ozdemir D Programming Language Introduction and Why D? It doesn t come with a religion this is written somewhere along the overview of D programming language. If you actually take
More informationCS201 - Introduction to Programming Glossary By
CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with
More informationCPSC 213. Introduction to Computer Systems. Instance Variables and Dynamic Allocation. Unit 1c
CPSC 213 Introduction to Computer Systems Unit 1c Instance Variables and Dynamic Allocation 1 Reading For Next 3 Lectures Companion 2.4.4-2.4.5 Textbook Structures, Dynamic Memory Allocation, Understanding
More informationCSE 341: Programming Languages
CSE 341: Programming Languages Hal Perkins Spring 2011 Lecture 2 Functions, pairs, and lists Hal Perkins CSE341 Spring 2011, Lecture 2 1 What is a programming language? Here are separable concepts for
More informationCSE 413 Spring Introduction to Ruby. Credit: Dan Grossman, CSE341
CSE 413 Spring 2011 Introduction to Ruby Credit: Dan Grossman, CSE341 Why? Because: Pure object-oriented language Interesting, not entirely obvious implications Interesting design decisions Type system,
More informationRust intro. (for Java Developers) JFokus #jfokus 1. 1
Rust intro (for Java Developers) JFokus 2017 - #jfokus 1. 1 Hi! Computer Engineer Programming Electronics Math
More informationCS61C Machine Structures. Lecture 3 Introduction to the C Programming Language. 1/23/2006 John Wawrzynek. www-inst.eecs.berkeley.
CS61C Machine Structures Lecture 3 Introduction to the C Programming Language 1/23/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L03 Introduction to C (1) Administrivia
More informationCS 2113 Software Engineering
CS 2113 Software Engineering Do this now!!! From C to Java git clone https://github.com/cs2113f18/c-to-java.git cd c-to-java./install_java Professor Tim Wood - The George Washington University We finished
More informationCSci 4223 Lecture 12 March 4, 2013 Topics: Lexical scope, dynamic scope, closures
CSci 4223 Lecture 12 March 4, 2013 Topics: Lexical scope, dynamic scope, closures 1 Lexical Scope SML, and nearly all modern languages, follow the Rule of Lexical Scope: the body of a function is evaluated
More informationException Namespaces C Interoperability Templates. More C++ David Chisnall. March 17, 2011
More C++ David Chisnall March 17, 2011 Exceptions A more fashionable goto Provides a second way of sending an error condition up the stack until it can be handled Lets intervening stack frames ignore errors
More informationProcesses. Operating System Concepts 8 th Edition
Processes Silberschatz, Galvin and Gagne 2009 Processes Process Concept Process Scheduling Operations on Processes Inter-process Communication Examples of IPC Systems Communication in Client-Server Systems
More informationBeyond Blocks: Python Session #1
Beyond Blocks: Session #1 CS10 Spring 2013 Thursday, April 30, 2013 Michael Ball Beyond Blocks : : Session #1 by Michael Ball adapted from Glenn Sugden is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike
More informationCMSC 330: Organization of Programming Languages. OCaml Expressions and Functions
CMSC 330: Organization of Programming Languages OCaml Expressions and Functions CMSC330 Spring 2018 1 Lecture Presentation Style Our focus: semantics and idioms for OCaml Semantics is what the language
More informationDistributed Systems. 03. Remote Procedure Calls. Paul Krzyzanowski. Rutgers University. Fall 2017
Distributed Systems 03. Remote Procedure Calls Paul Krzyzanowski Rutgers University Fall 2017 1 Socket-based communication Socket API: all we get from the OS to access the network Socket = distinct end-to-end
More informationOperating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst
Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst Department of Computer Science Why C? Low-level Direct access to memory WYSIWYG (more or less) Effectively
More informationSummary of Go Syntax /
Summary of Go Syntax 02-201 / 02-601 Can declare 1 or more variables in same var statement Variables Can optionally provide initial values for all the variables (if omitted, each variable defaults to the
More informationPerl 6 Hands-On Tutorial
Perl 6 Hands-On Tutorial DCBPW 2016 Brock Wilcox awwaiid@thelackthereof.org Rakudo 楽土 Install Resources REPL Script Application Library Install Rakudobrew # Linux sudo apt-get install build-essential git
More informationProgramming Standards: You must conform to good programming/documentation standards. Some specifics:
CS3114 (Spring 2011) PROGRAMMING ASSIGNMENT #3 Due Thursday, April 7 @ 11:00 PM for 100 points Early bonus date: Wednesday, April 6 @ 11:00 PM for a 10 point bonus Initial Schedule due Thursday, March
More informationIntroduction to RPC, Apache Thrift Workshop. Tomasz Powchowicz
Introduction to RPC, Apache Thrift Workshop Tomasz Powchowicz It is all about effective communication page 2 Synchronous, asynchronous execution Executor Executor A Executor B Executor A Executor B 1 1
More informationCS 222: Pointers and Manual Memory Management
CS 222: Pointers and Manual Memory Management Chris Kauffman Week 4-1 Logistics Reading Ch 8 (pointers) Review 6-7 as well Exam 1 Back Today Get it in class or during office hours later HW 3 due tonight
More informationAPIs and API Design with Python
APIs and API Design with Python Lecture and Lab 5 Day Course Course Overview Application Programming Interfaces (APIs) have become increasingly important as they provide developers with connectivity to
More informationUser Scripting April 14, 2018
April 14, 2018 Copyright 2013, 2018, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and
More informationLecture 15: Object-Oriented Programming
Lecture 15: Object-Oriented Programming COMP 524 Programming Language Concepts Stephen Olivier March 23, 2009 Based on slides by A. Block, notes by N. Fisher, F. Hernandez-Campos, and D. Stotts Object
More informationBack to OCaml. Summary of polymorphism. Example 1. Type inference. Example 2. Example 2. Subtype. Polymorphic types allow us to reuse code.
Summary of polymorphism Subtype Parametric Bounded F-bounded Back to OCaml Polymorphic types allow us to reuse code However, not always obvious from staring at code But... Types never entered w/ program!
More information