Introduction

Questions

  • What is the Purpose of Formalism in Computer Science?

  • What is software development life cycle

  • There seem to be many concepts in this course. What do they mean?

Objectives

  • We’ll

    • give an introduction to the week

    • give some introduction to concepts used in the course

    • give some introduction to handy tools for the software developer

    • try to set up the mindset to find the rest of the week interesting and useful!

Instructor note

  • Theory

  • Demos/type-alongs

  • Exercise

Hint

  1. We start with a more theoretical introduction covering the software and tools and mindsets for software development.

  2. The second part follows the development of a simple software project.

  • The exercises and type-alongs are mostly based on copy-pasting code.

  • So you don’t need to program yourself or understand the python syntax used.

  • The important aspect is the workflow!

  1. Deeper material not covered in the lessons today can be found in the extra reading part.

Preliminary schedule 1st day

Topic

Time

Syllabus

9.00

Intro

9.20

Coffee break (15 min)

9.45

SDLC tools

10.00

Planning phase (incl. break)

10.45

Start the project

11.15

Start with coding (begin)

11.45

LUNCH

12.00

Start with coding (cont’d)

13.00

Iterations and Git (incl. break)

13.30

Deploy and documentation

14.30

Coffee break

15.00

(Collaboration)

15.15

Summary

15.25

Reflection

15.35

END

16.00

What is software?

Wikipedia

  • set of computer programs and associated documentation and data.

  • This is in contrast to hardware, from which the system is built and which actually performs the work.

  • User-written software: End-user development

    • Users create this software themselves and often overlook how important it may be to others.

Some software concepts

  • program

  • script (directly interpreted at run time)

  • tool

  • model

  • application


Scripting vs programming

  • Python is an interpreted language.

    • Python uses an interpreter to translate and run its code. Hence Python is a scripting language.

  • Programs written in C++ are compiled and then the compiled code runs to generate the output.

    • Hence, C++ is a programming language and not a scripting language, since scripting languages are directly interpreted at run time and no prior compilation of the code takes place.


Note

We will not be very definite in the course in when to use scripting, program or tools

Outcome of a Program

  • Correct

    • and flawless

  • Efficient

    • Utilize the computer system’s resources

  • Reusable

    • Finished components

    • Lower development costs

    • Faster

    • Higher quality

    • packaging technology

  • Changeable

    • Maintenance cost

      • Fix errors, bugs

      • Adapt to new requirements

      • Independent modules

      • Encapsulation/information hiding

Independent modules

  • Modular coding is really good!

  • Object-oriented or functional programming, see below.

  • Modularity could be within a program but also for a workflow.

Workflow

Functional vs. object-oriented programming

Object oriented programming

  • Object-oriented (OO) programming is

    • a mindset of mimicking the real-world as:

    • entities (objects) that are different

    • or share attributes with each-other (within a class)

    • info-hiding mindset…

@startuml
class Elevator{
  direction : String
  floor : Integer
  
  void goto_floor()
  void stop()
  void which_floor()
}
@enduml

@startuml
object elevator1{
direction="up"
floor=2
}
object elevator2{
direction="rest"
floor=5
}

@enduml

Note

Object orientation (OO) in some programming languages

  • OO (built-in classes)

    • C++

    • Java

    • Python

    • Julia

  • OO features

    • Fortran 2003-

    • MATLAB

    • Perl

    • PHP

  • OO object-based (but not class-based)

    • Javascript

Functional programming

  • More classical as it is more focused on the algorithms

  • Functions

  • Modules: a way to gather functions with similar functionality

  • Also to some extent info-hiding mindset

To sum up

  • At its simplest, functional programming uses immutable data to tell the program exactly what to do.

  • Object-oriented programming tells the program how to achieve results through objects altering the program’s state.

  • Both paradigms can be used to create elegant code.

See also

Your scripting/programming background

spiral

Different types of Scientific software:

  • analysis of data

    • statistics

    • figures

    • visualization

  • tools for process data

    • refining data (formatting)

    • bioinformatics

  • workflows

  • modelling (mimic the reality)

    • simulations time-varying bahaviour of a system

    • mathematical models of relationships among variables in a system

  • decision assistance

Discussion

What do you develop for?

  • Use Menti

Exercise

Planet application

  • Make a program that simulates the Earth’s change of orbit due to the interaction with other planets-

  • This was done in MATLAB with no thought of best practices, just trying to solve the problem!

  • What are the problems?

  • Discuss!

    • Readability?

    • Correct?

    • Efficient?

    • Reusable?

    • Changeable?

Software Development Life Cycle (SDLC)

  • We need a workflow in our programming projects!

Some common steps

  • Planning

    • Analysis and design

  • Development

    • Source control

    • Algorithms

    • In-code documentation

    • Optimization

      • Parallelism

  • Test

  • Development and maintenance

    • Documentation

    • Reproducibility and sharing


  • … and Iterations


Agile development

  • Division of tasks into short phases of work and frequent re-assessment and adaptation of plans.

See also

More about life cycles in next session and later this week

Summary of Introduction

  • Now after the overview you are ready to dig deeper in the topics and try it out yourself!

Keypoints

  • A program shall be or have content/components that is:

    • Correct

    • Efficient

    • Reusable

    • Changeable

  • Software development is both series of steps:

    1. Requirements

    2. Analysis and design

    3. Development

    4. Test

    5. Development and maintenance

  • … and iteration of these