+ CS1001. Python. November 14 th, 2011. + Scripting languages Scripting languages foster an exploratory, incremental approach to writing code Historically.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Introduction to programming in java. Input and output to screen with Java program Structure of Java programs Statements Conditional statements.
Foundations of Programming and Problem Solving Introduction.
Programming for Beginners
Lilian Blot 11 Spring 2014 TPOP 1. Lilian Blot 22 Spring 2014 TPOP 2.
Microsoft Research March 20, 2000 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark.
Programming Methodology (1). MODULE TEAM Dr Aaron Kans Dr Sin Wee Lee.
In Review JAVA C++ GUIs - Windows Webopedia.com.
Introduction to Programming G51PRG University of Nottingham Revision 1
Today’s lecture Review of Chapter 1 Go over homework exercises for chapter 1.
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
Ruby The Gem of new programming languages. An interpreted scripting language.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Drew Murphy Drew Ebelhar. History December 18, 1987 Creator- Larry Wall Objective: To develop a general purpose Unix scripting language to make report.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Computer Science A 1: 3/2. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated.
Hello, world! Dissect HelloWorld.java Compile it Run it.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Introduction to Python Dr. Bernard Chen Ph.D. University of Central Arkansas July 9 th 2012
Ch 1. Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
1 Perl Perl basics Perl Elements Arrays and Hashes Control statements Operators OOP in Perl.
Java Lecture 16: Dolores Zage. WWW n Was a method for distributing passive information n added forms and image maps n interaction was only a new way to.
Programming in Python Part I Dr. Fatma Cemile Serçe Atılım University
The Python Programming Language Jeff Myers Programming Language Concepts, 01/14/2002
CS 105 Perl: Course Introduction Nathan Clement 13 May 2014.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
Software for Translators Barcelona, January 2002.
Introduction to Perl Yupu Liang cbio at MSKCC
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Siena Computational Crystallography School 2005
C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Ch 1. A Python Q&A Session. Why do people use Python? Software Quality Developer productivity Program portability Support Libraries Component integration.
CSc 201 Introduction to Java George Wells Room 007, Hamilton Building
Java FilesOops - Mistake Java lingoSyntax
WHY ARE WE HERE? Nick Derrickson BA371, Winter 2016.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Basics Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
Computer Programming Your First Java Program: HelloWorld.java.
Applications Active Web Documents Active Web Documents.
The language focusses on ease of use
Top 8 Best Programming Languages To Learn
CST 1101 Problem Solving Using Computers
Introduction to .NET Framework
Basic 1964 PC general purpose Imperative Small Easy to use.
PERL.
Introduction to.
Ch 1. A Python Q&A Session Bernard Chen 2007.
CompSci 230 Software Construction
Python Training Classes
Henning Schulzrinne Advanced Programming
Introduction to Computers and Python
Using the Java Library API
Java Intro.
Anatomy of a Java Program
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Presentation transcript:

+ CS1001. Python. November 14 th, 2011

+ Scripting languages Scripting languages foster an exploratory, incremental approach to writing code Historically interpreted Favor your time and energy over the CPUs Include libraries for common tasks Examples AWK [1977], Perl [1987], Python [1991]

+ Style Java: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world"); } } Python: print hello world Perl: print hello world\n; AWK: BEGIN { print "Hello, world!" }

+ Philosophy More time Thinking about the problem Experimenting with solutions Less time Writing code

+ Perl Larry Wall, 1987 (linguist) Report writing (text processing!) There is more than one way to do it. What was text processing essential for in the early 90s?

+ Websites per year (log scale) Source:

+ Which is more important? Code should be easy to write Code should be easy to read (This is a false dichotomy)

+ Obfuscated code contest `$=`;$_=\%!;($_)=/(.)/;$==++$|; (.)..(.)......(.)/,$"),$=++;$.++;$.+ +; $_++;$_++;($_,$\,$,)=($~.$"."$;$ /$%[$?]$_$\$,$:$%[$?]",$"&$~,$ #,);$,++;$,++;$^|=$";`$_$\$,$/$: $;$~$*$%[$?]$.$~$*${#}$%[$?]$ ;$\$"$^$~$*.>&$=` Perl

+ Obfuscated code contest `$=`;$_=\%!;($_)=/(.)/;$==++$|; (.)..(.)......(.)/,$"),$=++;$.++;$.+ +; $_++;$_++;($_,$\,$,)=($~.$"."$;$ /$%[$?]$_$\$,$:$%[$?]",$"&$~,$ #,);$,++;$,++;$^|=$";`$_$\$,$/$: $;$~$*$%[$?]$.$~$*${#}$%[$?]$ ;$\$"$^$~$*.>&$=` $ Just another Perl hacker. Perl

+ Obfuscated code contest C

+ C

+ Python Emphasizes readability There should be one – and preferably only one – way to do it. Large standard library (batteries included) Cross platform and open source

+ Parsing text files (and reading them back!)

+ Getting the weather

+ Technically Dynamic typing Garbage collected Multi-paradigm Compiles to bytecode Exception based error handling Extensible

+ Dynamic typing pi = print pi pi = "I'd love to have " + str(pi) + " pies" print pi print "In fact, I'd like one more" pi = pi + 1 # TypeError: cannot concatenate 'str' and 'int' objects print pi

+ Books Ordered by technical complexity - notice anything?

+ Internet humor Source: