f20sc/f21scoverviewhwloidl/courses/f21sc/courseoverview.pdff20sc/f21scoverview hans-wolfgangloidl ...

30
F20SC/F21SC Overview Hans-Wolfgang Loidl <[email protected]> School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh Semester 1 — 2018/19 H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 1 / 30

Upload: hakhuong

Post on 31-Mar-2019

218 views

Category:

Documents


0 download

TRANSCRIPT

F20SC/F21SC Overview

Hans-Wolfgang Loidl<[email protected]>

School of Mathematical and Computer Sciences,Heriot-Watt University, Edinburgh

Semester 1 — 2018/19

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 1 / 30

Welcome to Heriot-Watt University

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 2 / 30

Overview of F20SC/F21SC“Industrial Programming”

Key course characteristics:This course is about the programming skillsWe will cover:

I Systems languages: C#I Scripting languages: Python

It assumes solid prior knowledge of an object-orientedlanguage, eg. Java.

I It is about quickly picking up a new language of a familiarparadigm.

I It is not a gentle introduction to programming.

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 3 / 30

Learning Outcomes

Appreciation of role of different programming paradigmsin configuring/managing systems:

I Object-oriented: good at structuring large codeI Imperative: good at performanceI Functional: good at abstractionI Logic: good at reasoning

Autonomous problem analysis/solution:I Really understand the problem to pick the rightparadigm/approach for producing a solution

Understanding of core characteristics of contemporaryoperating systems: make good use of available resources

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 4 / 30

Learning Outcomes

Appreciation of role of “language as glue wear” inconfiguring/maintaining systems:

I Scripting languages combine existing codeKnowledge of key abstractions across programminglanguages:

I Write reusable and maintainable codeTechnical proficiency in advanced techniques in differentprogramming paradigms:

I Learn the Best of all Worlds

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 5 / 30

Topics to cover

Overview & Linux introduction (1 week)Core C# programming (3 weeks)Advanced C# programming (3 weeks)Python programming (4 weeks)Revision (1 week)Planned: Guest lecture on systematic testing

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 6 / 30

Lecture Plan

Week 1: Overview, Linux Introduction (with shellscripting)Week 2: .Net and C# Introduction, C# FundamentalsWeek 3: C# Objects & Classes, C# ConcurrencyWeek 4: C# Data Manipulation, Database access in C#and LINQ, C# GUI developmentWeek 5: Threading in C#, C# Systems ProgrammingWeek 6: Advanced C# Features, C# Revision

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 7 / 30

Lecture Plan (cont’d)

Week 7: Parallel Programming in C#Week 8: Python Introduction and Data TypesWeek 9: Python Control Structures and FunctionsWeek 10: Python Classes and Advanced LanguageConstructsWeek 11: Python Libraries and ToolsWeek 12: Revision

Course material is available via the Vision system:http://vision.hw.ac.uk/Main course information page:http://www.macs.hw.ac.uk/˜hwloidl/Courses/F21SC/

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 8 / 30

Main course information page

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 9 / 30

Assessment

Assessed Coursework: 100%Demonstration (mandatory) of the courseworkif you don’t do a demo you’ll get 0 points on the CW!There is no exam for this module

Coursework:Project 1: C# programming project (50%)Handout: Week 3; Deadline: Week 6Project 2: Python programming project (50%)Handout: Week 9; Deadline: Week 12

There will be no individual deadline extensions. If you have acase you must fill in a “Mitigating Circumstances” form.

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 10 / 30

Skills tested in the Coursework

Composing bigger applications out of existingcomponentsRapid prototypingResource conscious programmingGUI programmingConcurrency

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 11 / 30

Software Infrastructure

Visual Studio 2015 with C# (Windows)Alternatively, stand-alone C# compiler with librariesneeded for GUI etc programmingsh or bash scripting languages (Unix)Python interpreterOverall: heavy use of libraries!

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 12 / 30

Reading ListC#

Douglas Bell, Mike Parr, “C# for Students”, AddisonWesley, 2009.Jesse Liberty, Brian MacDonald, “Learning C# 3.0”,O’Reilly, 2009.Joseph Albahari, Ben Albahari, “C# 6.0 in a Nutshell:The Definitive Reference”, O’Reilly, 2015.Kurt Normark, “Object-oriented Programming in C# forC and Java Programmers”, 2010. on-lineEric Gunnerson, “A programmer’s Introduction to C#5.0”, Springer, 2012Andrew Birrell, “An Introduction to programming withC# Threads”, Microsoft, 2005.Arnold Robbins, “Classic Shell Scripting: HiddenCommands that Unlock the Power of Unix”, O’Reilly,2005.

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 13 / 30

Characteristics of Systems Languages

Build algorithms and data structures from scratchUse strong typing to help manage complexity of largepieces of softwareFocus is often on speed of executionEasy access to low-level operating system is crucialExamples: C, C#

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 14 / 30

Characteristics of Scripting Language

Their main purpose is to glue software togetherFocus is on rapid-prototypingSafety aspects are of a lesser concernThus, scripting languages are often type-lessModern scripting languages incorporate features ofgeneral purpose programming languages, especiallyobject-oriented (o-o) features, higher- order functionsEasier to learn for casual programmingExamples: sh, php, python, perl, ruby, lua

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 15 / 30

A Short History of Scripting Languages

Developed as an abstraction over assembler programsThey are higher-level by introducing abstractionmechanisms to manage large pieces of code.They are safe by using strong typing to more easilydetect mistakes in the programThey delegate some control of the underlying machine tolibraries and operating systemTogether this drastically increases programmerproductivity

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 16 / 30

Classifying Scripting Languages

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 17 / 30

A Short History of Scripting Languages

First Generation: simple composition of command-linejobs (espec. Unix systems); also called batch-languagesVery little language abstractionSlightly different syntax in different languagesRich libraries for low-level coordination with theoperating-system (OS)Examples: sh, bash, tcsh ...

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 18 / 30

A Short History of Scripting Languages

Second Generation: Trying to combine many differentlanguage features into one languageAddresses the problem that different batch languages dothe same thing slightly differentlyThus, the language becomes hugeThe mixture of concepts makes it hard to readthird-party code.Also, extended support for graphical user interfaces(GUIs)Examples: perl, tcl

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 19 / 30

A Short History of Scripting Languages

Third Generation: increasingly use modern programminglanguage abstractions to make programming simplerIn particular, heavy use of o-o conceptsAlso, concepts from other programming paradigms suchas higher-order functions and polymorphismExamples: php, python, ruby, lua, go, dart

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 20 / 30

Relevance of Scripting Languages

Increasing speed of processor makes the application ofinterpreted languages viableExistence of large libraries makes the development of newsoftware from scratch less common-placeHeterogeneous environment make a write- oncerun-everywhere approach appealingNew technologies, such as the internet, make the issue ofcomposing services even more important

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 21 / 30

Common Features of Scripting Languages

Scripting languages are usually typeless: no (type)restrictions on the use of the input/output to/fromexisting components are imposedThis enhances the flexibility of the language but reducesthe safetyExample from Unix shells: pipeline mechanism:select | grep scripting | wcThis reads the text currently selected in a window, passesit to a search for the word “scripting” and counts thenumber of lines in the output

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 22 / 30

Modern scripting languages provide a limited amount oftype information to re-gain type safetyTo avoid frequent conversion functions between types,class hierarchies and implicit type conversions are usedIn contrast to systems languages, some type checks areperformed at run-time rather than compile-time (dynamictyping)

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 23 / 30

Scripting languages are usually interpreted rather thancompiledThis gains rapid turnaround time in writing and testingcodeIt increases flexibility, since the program can generatestrings that are in themselves programsIt loses performance compared to executing compiledcode; but typically the amount of code in the scriptinglanguage is small and performance is dominated by thecode in the components

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 24 / 30

Scripting languages are often higher-level than systemlanguages, espec. for the latest generationFor example many scripting languages have powerful,built-in mechanisms for regular expression substitutionIn the latest generation high-level concepts such as classhierarchies are included, too.

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 25 / 30

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 26 / 30

When to use Scripting Languages

Is the application’s main task to connect pre- existingcomponents?Will the application manipulate a variety of differentkinds of things?Does the application involve a GUI?Does the application do a lot of string manipulation?Will the application’s functions evolve rapidly over time?Does the application need to be extensible?

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 27 / 30

When to use Systems Languages

Does the application implement complex algorithms ordata structures?Does the application manipulate large data sets?Are the application’s functions well-defined and changingslowly?

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 28 / 30

Application Domains for Scripting

Graphical User InterfacesI Fundamentally “gluing” natureI Large percentage of code in modern apps

InternetI Main role: connecting a huge number of existingcomputations and data (see success of perl)

I Web services as the next level of gluingComponent Frameworks

I A flexible method of assembling components intoapplications

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 29 / 30

Summary

Be aware of the characteristics of systems and scriptinglanguages

I Decide early on in a project which class of language to useI Today’s trends in programming languages will betomorrow’s features in scripting languages

Main reference:“Scripting: Higher Level Programming in the 21 stCentury”, John K. Ousterhout, IEEE Computer, March1998. URL:http://home.pacbell.net/ouster/scripting.html

H-W. Loidl (Heriot-Watt Univ) F20SC/F21SC — 2018/19 Course Overview 30 / 30