Why I Invented Python EuroPython – June 27, 2005 Guido van Rossum Elemental Security, Inc.

Slides:



Advertisements
Similar presentations
Chapter 4 Loops Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved
Advertisements

Chapter 5: Control Structures II (Repetition)
Chapter 6 Writing a Program
Copyright © 2002 Pearson Education, Inc. Slide 1.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Chapter 11 Introduction to Programming in C
® ® Why Design Another Language? Python UK & ACCU Spring Conference Oxford - April 2, 2003 Guido van Rossum Director of PythonLabs at Zope Corporation.
"The State of the Python Union" Python10 - Alexandria, VA - February 7, 2002 Guido van Rossum Director, PythonLabs at Zope Corporation
State of the Python Union PyCon DC, March 26-28, 2003 Guido van Rossum Director of PythonLabs at Zope Corporation
10/09/1999© 1999 CNRI, Guido van Rossum 1 Computer Programming for Everybody Guido van Rossum CNRI (Corporation for National Research Initiatives, Reston,
1 Python Training for HP OSO Guido van Rossum CNRI 7/23/1999 9am - 1pm.
0 - 0.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
1 Data Link Protocols By Erik Reeber. 2 Goals Use SPIN to model-check successively more complex protocols Using the protocols in Tannenbaums 3 rd Edition.
Programming Language Concepts
Distributive Property
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 5.
Accelerated Linear Algebra Libraries James Wynne III NCCS User Assistance.
Modern Programming Languages, 2nd ed.
1 CSC 221: Computer Programming I Fall 2006 interacting objects modular design: dot races constants, static fields cascading if-else, logical operators.
Social Web Design 1 Darby Chang Social Web Design.
Molecular Biomedical Informatics Web Programming 1.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Cs205: engineering software university of virginia fall 2006 Specifying Procedures David Evans
1 The C Language An International Standard CIS2450 Professional Aspect of Software Engineering.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Introduction to Computer Administration Introduction.
Lilian Blot PART V: FUNCTIONS Core elements Autumn 2013 TPOP 1.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 4 Loops.
1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)
CSci 1130 Intro to Programming in Java
Enhancing Spotfire with the Power of R
Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.
Addition 1’s to 20.
Chapter Three Arithmetic Expressions and Assignment Statements
Week 1.
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
Lilian Blot CORE ELEMENTS SELECTION & FUNCTIONS Lecture 3 Autumn 2014 TPOP 1.
Introduction to Recursion and Recursive Algorithms
Chapter Modules CSC1310 Fall Modules Modules Modules are the highest level program organization unit, usually correspond to source files and.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
CS1022 Computer Programming & Principles
L6:CSC © Dr. Basheer M. Nasef Lecture #6 By Dr. Basheer M. Nasef.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 3 Loops.
Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.
Jonathan Huelman CSC 415 – Programming Languages
Introduction to Python (for C++ programmers). Background Information History – created in December 1989 by Guido van Rossum Interpreted Dynamically-typed.
Intro to Python Programming (Resources) Pamela A. Moore Zenia C. Bahorski Eastern Michigan University March 7, 2012 A language to swear by, not at. 1.
Computer Science 111 Fundamentals of Programming I Overview of Programming.
Chapter 4 Numbers. Python Program Structure Python programs consist of: Modules Statements Expressions Objects.
Modules and Decomposition UW CSE 190p Summer 2012 download examples from the calendar.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 6: Variables and constants.
Computer Science 101 Introduction to Programming.
1 CSC 221: Introduction to Programming Fall 2012 Python data, assignments & turtles  Scratch programming review  Python & IDLE  numbers & expressions.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Compsci 06/101, Spring Compsci 6/101: PFTW, Feb 28-March 4 l Algorithms and Data Structures  Sets and how they are used in Python (data structure)
Chapter 3 - Language Design Principles
Python Let’s get started!.
8 January 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
Python  Monty or Snake?. Monty?  Spam, spam, spam and eggs  Dead parrots  Eric Idle, John Cleese, Michael Palin, etc.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Fundamentals of Programming I Overview of Programming
Python Let’s get started!.
Variables, Expressions, and IO
Introduction to Python
Programming Tips GS540 January 10, 2011.
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Why I Invented Python EuroPython – June 27, 2005 Guido van Rossum Elemental Security, Inc.

June 27, 2005© 2005 Guido van Rossum 2 About 30 Years Ago... Discovered computers and programming Learned Algol-60, Fortran and Pascal (in that order!) Enjoyed programming more than anything Wanted better tools, and started creating them Started sharing with others Started learning about other languages

June 27, 2005© 2005 Guido van Rossum 3 About 20 Years Ago... Knew C and Unix really well Worked on implementing ABC, a new language Ported it to Mac and PC (DOS) Was really excited by the authors' philosophy Was disappointed by ABC's lack of integration Saw its failure to gain acceptance

June 27, 2005© 2005 Guido van Rossum 4 About 15 Years Ago... Worked on implementing Amoeba, a new OS Found it needed a scripting language "To bridge the gap between shell and C" Wanted ABC's elegance in that scripting language Had some time on my hands Had some ideas on language implementation

June 27, 2005© 2005 Guido van Rossum 5 Python's Birth Xmas 1989 About two weeks of time off with no plans Had it all in my head Fat Mac with Lightspeed C on 20 MB hard drive First code: a parser generator Soon followed: a running program!

June 27, 2005© 2005 Guido van Rossum 6 Some Design Goals Shell-like (interactive prompt as well as script files) Extensible architecture (create new types) One tool amongst many, work well with others Additional functionality implementable separately Avoid Not-Invented-Here syndrome (borrow freely) Doable as a one-person project (cut some corners)

June 27, 2005© 2005 Guido van Rossum 7 Why Object Oriented? One word: extensibility The original design was OO inside and used OO notation for method access, but did not support user-defined classes Method access was generalized to namespaces One unified namespace for everything in a module Each object is a namespace in its own right A module is just another object Name lookup is customized per namespace User-defined classes were added within the first year, but for a long time remained second-class citizens (until new-style classes in Python 2.2)

June 27, 2005© 2005 Guido van Rossum 8 Good Things About ABC Five powerful data types: –list, table, tuple, number, text Orthogonality an important principle No limits: values can be as large as fits in memory Numbers represent mathematical values, not bits Powerful string processing built-in No type declarations; assignment creates variables Simple control structures: IF, SELECT, WHILE, FOR Interactive >>> prompt

June 27, 2005© 2005 Guido van Rossum 9 Not-so-good Things About ABC Monolithic implementation; hard to add new things Hard to interact with file system Reinvented programming terminology Apostrophe (') in identifiers; UPPERCASE keywords List is unordered multi-set (bag); table is sorted Small strings relatively slow Assignment: PUT expression IN variable No error handling (errors return to >>> prompt) Editing environment too closely integrated Appealed most to people with insufficient computer access; hard to establish "early adopter" community in Unix world due to lack of OS integration

June 27, 2005© 2005 Guido van Rossum 10 What I Changed Extensibility an implementation cornerstone Built-in files; other OS functionality in an extension Returned to standard programming terminology Underscore in identifiers; lowercase keywords List has ordering; dictionary is hash table Optimize for small strings (memcpy is very fast) Assignment: variable = expression Added exceptions, try/except, try/finally (Modula 3) Dropped the integrated editing environment Appealed to the Unix world: imitate /bin/sh behavior, # for comments, support #!, access most low-level Unix system calls (but also PC/Mac ports!)

June 27, 2005© 2005 Guido van Rossum 11 What Else I Changed Much of this was motivated by keeping it simple enough to be a one-person project! Dropped type inference; dynamic typing instead Dropped "refinement" control structures Separated int, long and float numeric types Biggest mistakes: –32-bit integers (premature optimization) –int/int truncating the value (mindlessly copied C) –class/type dichotomy (user-classes an afterthought) –string exceptions (exceptions came before classes!)

June 27, 2005© 2005 Guido van Rossum 12 The Zen of Python 1.Beautiful is better than ugly. 2.Explicit is better than implicit. 3.Simple is better than complex. 4.Complex is better than complicated. 5.Flat is better than nested. 6.Sparse is better than dense. 7.Readability counts. 8.Special cases aren't special enough to break the rules. 9.Although practicality beats purity. 10.Errors should never pass silently. 11.Unless explicitly silenced. 12.In the face of ambiguity, refuse the temptation to guess. 13.There should be one and preferably only one obvious way to do it. 14.Although that way may not be obvious at first unless you're Dutch. 15.Now is better than never. 16.Although never is often better than right now. 17.If the implementation is hard to explain, it's a bad idea. 18.If the implementation is easy to explain, it may be a good idea. 19.Namespaces are one honking great idea let's do more of those! (a poem by Tim Peters)

June 27, 2005© 2005 Guido van Rossum 13 Question Time