Software. Is

Similar documents
Software. Is

Turning Development Outside

Procedural Programming. It's Back? It Never Went

Old Is the New

Lowering the Level of

CS1 Lecture 22 Mar. 6, 2019

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

If Statements, For Loops, Functions

Creating an Animated Navigation Bar in InDesign*

Lecture Transcript While and Do While Statements in C++

Errors. And How to Handle Them

Introduction to Programming

Intro. Scheme Basics. scm> 5 5. scm>

Design and Information Hiding

The Architecture of

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.

Animator Friendly Rigging Part 1

MITOCW watch?v=w_-sx4vr53m

MITOCW ocw f99-lec07_300k

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

CSE : Python Programming. Homework 5 and Projects. Announcements. Course project: Overview. Course Project: Grading criteria

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Unit Testing as Hypothesis Testing

Repetition Through Recursion

Constructing Algorithms and Pseudocoding This document was originally developed by Professor John P. Russo

DESIGN AS RISK MINIMIZATION

Creating joints for the NovodeX MAX exporter

CS61A Notes Week 6: Scheme1, Data Directed Programming You Are Scheme and don t let anyone tell you otherwise

STA Rev. F Learning Objectives. Learning Objectives (Cont.) Module 3 Descriptive Measures

Software Analysis. Asymptotic Performance Analysis

MITOCW ocw f99-lec12_300k

(Refer Slide Time 3:31)


CS2304: Python for Java Programmers. CS2304: Sequences and Collections

Roc Model and Density Dependence, Part 1

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Divisibility Rules and Their Explanations

Installing and Using Trackside Cameras Revised November 2008

y= sin( x) y= cos( x)

Topic 22 Hash Tables

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

3 Nonlocal Exit. Quiz Program Revisited

The Big Python Guide

2016 All Rights Reserved

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

CS Introduction to Data Structures How to Parse Arithmetic Expressions

Introduction to 3D Concepts

Most of the class will focus on if/else statements and the logical statements ("conditionals") that are used to build them. Then I'll go over a few

MV-8800 Production Studio

(Refer Slide Time: 01.26)

Porsche 91 1GT D m o d e ling tutorial - by Nim

Introduction to Asymptotic Running Time Analysis CMPSC 122

Software Testing Lecture 1. Justin Pearson

(Refer Slide Time: 00:02:02)

9 R1 Get another piece of paper. We re going to have fun keeping track of (inaudible). Um How much time do you have? Are you getting tired?

Recursively Enumerable Languages, Turing Machines, and Decidability

About the Final. Saturday, 7-10pm in Science Center 101. Closed book, closed notes. Not on the final: graphics, file I/O, vim, unix

Learn Ninja-Like Spreadsheet Skills with LESSON 9. Math, Step by Step

(Refer Slide Time: 00:03:51)

How to Create a Killer Resources Page (That's Crazy Profitable)

A Sophomoric Introduction to Shared-Memory Parallelism and Concurrency Lecture 2 Analysis of Fork-Join Parallel Programs

Designing Robust Classes

A short introduction to. designing user-friendly interfaces

Chapter 13. Recursion. Copyright 2016 Pearson, Inc. All rights reserved.

Module 10: Imperative Programming, Modularization, and The Future

EVENT-DRIVEN PROGRAMMING

Testing. UW CSE 160 Winter 2016

feel free to poke around and change things. It's hard to break anything in a Moodle course, and even if you do it's usually easy to fix it.

(Refer Slide Time: 1:27)

Python Evaluation Rules

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

Strategy Pattern. What is it?

Text Input and Conditionals

STA Module 2B Organizing Data and Comparing Distributions (Part II)

STA Learning Objectives. Learning Objectives (cont.) Module 2B Organizing Data and Comparing Distributions (Part II)

COMP 202 Java in one week

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Polar Coordinates. 2, π and ( )

Intro. Speed V Growth

n! = 1 * 2 * 3 * 4 * * (n-1) * n

CSE 2123 Recursion. Jeremy Morris

Brief 3ds max Shaping Tutorial

Data Structures. Lists, Tuples, Sets, Dictionaries

How invariants help writing loops Author: Sander Kooijmans Document version: 1.0

Anatomy of a Standard Transcript

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

1 Getting used to Python

2D and 3D Transformations AUI Course Denbigh Starkey

CATCH ERRORS BEFORE THEY HAPPEN. Lessons for a mature data governance practice

Tips to Help Maximize Research on Lexis Advance

lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1

(Refer Slide Time: 00:01:30)

Arrays.

Solution Guide for Chapter 20

Fun facts about recursion

V6 Programming Fundamentals: Part 1 Stored Procedures and Beyond David Adams & Dan Beckett. All rights reserved.

Mount Points Mount Points is a super simple tool for connecting objects together and managing those relationships.

There we are; that's got the 3D screen and mouse sorted out.

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

(Refer Slide Time: 00:02:00)

Transcription:

Software Is Details @KevlinHenney

Any program is a model of a model within a theory of a model of an abstraction of some portion of the world or of some universe of discourse. Meir M Lehman "Programs, Life Cycles, and Laws of Software Evolution"

The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise. Edsger W Dijkstra

Details count. Peter Weinberger

Geeks are people who love something so much that all the details matter. Marissa Mayer

We're talking about a very specific mindset that is crucial when it comes to the act of creating. Will Gompertz Think Like an Artist

It is an attitude that can be encapsulated in a simple but demanding rule: always think both big picture and fine detail. Will Gompertz Think Like an Artist

software

software architecture

code

implementation

implementation details

design details

design decisions

Architecture represents the significant design decisions that shape a system, where significant is measured by cost of change. Grady Booch

We propose [...] that one begins with a list of difficult design decisions or design decisions which are likely to change. Each module is then designed to hide such a decision from the others. David L Parnas On the Criteria to Be Used in Decomposing Systems into Modules

Programming is a design activity. Jack W Reeves What Is Software Design?

Coding actually makes sense more often than believed. Often the process of rendering the design in code will reveal oversights and the need for additional design effort. The earlier this occurs, the better the design will be. Jack W Reeves What Is Software Design?

If a plot works out exactly as you first planned, you're not working loosely enough to give room to your imagination and instincts.

/ WordFriday

pantser, noun Writer who writes by the seat of their pants. In contrast to a plotter, a pantser doesn't work to (or have) an outline.

16-bit

32-bit

64-bit

<windows.h>

LLP64

LP64

Ophelia: 'Tis in my memory locked, and you yourself shall keep the key of it. William Shakespeare The Tragedy of Hamlet [Act I, Scene 3]

Hamlet: Yea, from the table of my memory I'll wipe away all trivial fond records. William Shakespeare The Tragedy of Hamlet [Act I, Scene 5]

Unshared mutable data needs no synchronisation Unshared Mutable Shared mutable data needs synchronisation Shared Unshared immutable data needs no synchronisation Immutable Shared immutable data needs no synchronisation

Mutable The Synchronisation Quadrant Unshared mutable data needs no synchronisation Unshared Shared mutable data needs synchronisation Shared Unshared immutable data needs no synchronisation Immutable Shared immutable data needs no synchronisation

All computers wait at the same speed

Savings in time feel like simplicity

... premature optimization is the root of all evil (or at least most of it) in programming. Donald Knuth

... premature optimization is the root of all evil (or at least most of it) in programming. Donald Knuth

... premature optimization is the root of all evil (or at least most of it) in programming. Donald Knuth

Command-line tools can be 235x faster than your Hadoop cluster Adam Drake http://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html

sort

O(n log n)

O(n 2 )

O(n!)

OMG!

O(n)

https://twitter.com/iamdevloper/status/808344541669498881

Remember that there is no code faster than no code. Taligent's Guide to Designing Programs

Write code that is easy to delete, not easy to extend. http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to

http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/

function leftpad (str, len, ch) { str = String(str); var i = -1; if (!ch && ch!== 0) ch = ' '; len = len - str.length; while (++i < len) { str = ch + str; } } return str;

zfill

rjust

var cache = [ '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' ]; function leftpad (str, len, ch) { // convert `str` to `string` str = str + ''; // `len` is the `pad`'s length now len = len - str.length; // doesn't need to pad if (len <= 0) return str; // `ch` defaults to `' '` if (!ch && ch!== 0) ch = ' '; // convert `ch` to `string` ch = ch + ''; // cache common use cases if (ch === ' ' && len < 10) return cache[len] + str; // `pad` starts with an empty string var pad = ''; // loop while (true) { // add `ch` to `pad` if `len` is odd if (len & 1) pad += ch; // divide `len` by 2, ditch the remainder len >>= 1; // "double" the `ch` so this operation count grows logarithmically on `len` // each time `ch` is "doubled", the `len` would need to be "doubled" too // similar to finding a value in binary search tree, hence O(log(n)) if (len) ch += ch; // `len` is 0, exit the loop else break; } // pad `str`! return pad + str; }

I have yet to see any problem, however complicated, which, when you looked at it in the right way, did not become still more complicated. Anderson's Law

function leftpad(content, length, pad) { content = String(content) pad = String(pad pad === 0? pad : ' ')[0] var left = Math.max(length - content.length, 0) return pad.repeat(left) + content }

test({ "Padding an empty string to a length of 0 results in an empty string": () => assert(leftpad("", 0, "X") === ""), "Padding a non-empty string to a shorter length results in the same string": () => assert(leftpad("foobar", 3, "X") === "foobar"), "Padding a non-empty string to a negative length results in the same string": () => assert(leftpad("foobar", -3, "X") === "foobar"), "Padding a non-empty string to its length results in the same string": () => assert(leftpad("foobar", 6, "X") === "foobar"), "Padding to a longer length with a single character fills to the left": () => assert(leftpad("foobar", 8, "X") === "XXfoobar"), "Padding to a longer length with surplus characters fills using only first": () => assert(leftpad("foobar", 10, "XY") === "XXXXfoobar"), "Padding to a longer length with an empty string fills with space": () => assert(leftpad("foobar", 8, "") === " foobar"), "Padding to a longer length with no specified fill fills with space": () => assert(leftpad("foobar", 9) === " foobar"), "Padding to a longer length with integer 0 fills with 0": () => assert(leftpad("foobar", 7, 0) === "0foobar"), "Padding to a longer length with single-digit integer fills with digit": () => assert(leftpad("foobar", 10, 1) === "1111foobar"), "Padding to a longer length with multiple-digit integer fills with first digit": () => assert(leftpad("foobar", 10, 42) === "4444foobar"), "Padding to a longer length with negative integer fills with -": () => assert(leftpad("foobar", 8, -42) === "--foobar"), "Padding a non-string uses string representation": () => assert(leftpad(4.2, 5, 0) === "004.2") })

function assert(condition) { if(!condition) throw { name: "AssertionError", message: "assertion failed" } } function testpasses(totry) { try { totry() return true } catch (failure) { return false } } function report(testname, passed) { document.write(testname.fontcolor(passed? "green" : "red") + "<br>") } function test(testcases) { for (var testname in testcases) if (testcases.hasownproperty(testname)) report(testname, testpasses(testcases[testname])) }

Padding an empty string to a length of 0 results in an empty string Padding a non-empty string to a shorter length results in the same string Padding a non-empty string to a negative length results in the same string Padding a non-empty string to its length results in the same string Padding to a longer length with a single character fills to the left Padding to a longer length with surplus characters fills using only first Padding to a longer length with an empty string fills with space Padding to a longer length with no specified fill fills with space Padding to a longer length with integer 0 fills with 0 Padding to a longer length with single-digit integer fills with digit Padding to a longer length with multiple-digit integer fills with first digit Padding to a longer length with negative integer fills with - Padding a non-string uses string representation

Padding an empty string to a length of 0 results in an empty string Padding a non-empty string to a shorter length results in the same string Padding a non-empty string to a negative length results in the same string Padding a non-empty string to its length results in the same string Padding to a longer length with a single character fills to the left Padding to a longer length with surplus characters fills using only first Padding to a longer length with an empty string fills with space Padding to a longer length with no specified fill fills with space Padding to a longer length with integer 0 fills with 0 Padding to a longer length with single-digit integer fills with digit Padding to a longer length with multiple-digit integer fills with first digit Padding to a longer length with negative integer fills with - Padding a non-string uses string representation

Simple Testing Can Prevent Most Critical Failures An Analysis of Production Failures in Distributed Data-Intensive Systems https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-yuan.pdf

Schiaparelli s Inertial Measurement Unit (IMU) went about its business of calculating the lander s rotation rate. For some reason, the IMU calculated a saturationmaximum period that persisted for one second longer than what would normally be expected at this stage. When the IMU sent this bogus information to the craft s navigation system, it calculated a negative altitude. http://gizmodo.com/a-crazy-miscalculation-doomed-the-sciaparelli-lander-1789319670

That fateful miscalculation set off a cascade of despair, triggering the premature release of the parachute and the backshell, a brief firing of the braking thrusters, and activation of the on-ground systems as if Schiaparelli had already reached the surface. This all happened while the vehicle was still two miles (3.7 km) above ground. http://gizmodo.com/a-crazy-miscalculation-doomed-the-sciaparelli-lander-1789319670

A majority of the production failures (77%) can be reproduced by a unit test. https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-yuan.pdf

Your Customers Do Not Mean What They Say Nate Jackson

I ve never met a customer yet that wasn t all too happy to tell me what they wanted usually in great detail. The problem is that customers don t always tell you the whole truth. Nate Jackson

They generally don't lie. They use their terms and their contexts. They leave out significant details. They make assumptions. Nate Jackson

This is compounded by the fact that many customers don t actually know what they want in the first place! Nate Jackson

http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

Software Is Details