1 / 28

Computer Programming f or Everyone

In this course, you will learn the basics of computer programming and how a computer works. No previous programming experience is required. You will make several programs and additions to existing products. Attitude is key!

winsteada
Télécharger la présentation

Computer Programming f or Everyone

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Programming for Everyone Petri Kuittinen Lead Game Designer Riot Entertainment Ltd.

  2. Introduction • No previous programming experience is required • Everyone will learn to program and know the basics of how computer works • Everyone will make several programs and make additions to existing products • Attitude is the most important thing

  3. Agenda I • Introduction 9:30-9:32 • How a Computer Works 9:32-9:38 • What is Programming 9:38-9:45 • (Monty) Python 9:45-9:50 • Basics of Python 9:50-10:25 • Revision 10:25:-10:30 • 15 Minute Break

  4. Agenda II • Let’s See Some Games 11:00-11:10 • Modify the Products 11:10-11:45 • Check & Revision 11:45-11:55 • Tips for Future 11:55-12:00 After that you will know more than most IT consultants ever know

  5. Computer Organization INPUT/OUTPUT PERIPHERALS CPU BUS MEMORY

  6. Compilation Source Code Compiler Compilation Time Executable Binary Output Run Time Input

  7. Interpretation Source Code Interpreter Output Input

  8. From C to Machine Language int sum_of_squares(int a, int b) { return a*a+b*b; } C Assembler sum_of_squares: pushl %ebp movl %esp,%ebp movl 8(%ebp),%edx imull %edx,%edx movl 12(%ebp),%eax imull %eax,%eax addl %edx,%eax leave ret Machine Code sum_of_squares: 00x8be58955 4 0xaf0f0855 8 0x0c458bd2 12 0x01c0af0f 16 0x90c3c9d0

  9. (Monty) Python • very high-level programming language • highly modular • object-oriented • automatic memory management • dynamic typing • interactive • very easy to learn

  10. Hello World – Program In Java: class HelloWorld { public static void main(String[] args) { System.out.println(”Hello World!”); } } In Python: print ”Hello World!”

  11. Python • free, open source • available for all major platforms, including Windows, Mac, UNIX/Linux, Palm etc. • easily intergrated with other languages • Jython = Python implemented in Java • lots of support (libraries, books) • http://www.python.org

  12. Who Uses Python? • Google • Yahoo! • Rebel Act Studios (Severance) • Industrial Light and Magic • Lawrence Livermore Labs • Digital Creations (ZOPE) • Redhat (Linux)

  13. Software Development • project overall planning (what? how? budget, schedule, resources) • specification • build prototype • program design (split into smaller components: modules, classes, functions) • implementation (programming) • testing & fixing bugs (debugging) • release • maintenance

  14. Program Development Cycles Traditional Development Python Development Start the Application Start the Application Test Behavior Test Behavior Stop the application Stop the application Edit Program Code Edit Program Code Recompile code Relink the executable

  15. Programming Paradigms • Imperative Programming (C, Pascal, Basic) • Functional Programming (Lisp) • Object-Oriented Programming (OOP) (C++) • Logic Programming (Prolog) • Concurrent programming (Ada) • In Future: • Aspect-Oriented Programming (AOP) • Subject-Oriented Programming (SUP)

  16. Relational Databases (SQL) Table MEMBERS SELECT * FROM MEMBERS WHERE LastName=”Cleese”;

  17. Object-Oriented Modeling Animal Super Class Inheritance Classes Mammal Instance King Arthur Age: 34 Residence: England Cat Human

  18. IDLE • Alt+n next (in command history) • Alt+p previous (in command history) • Cltr+a go to beginning of line • Ctrl+c interrupt program • Ctrl+e go to end of line • Ctrl+k yank (delete) to the end of line • Ctrl+s save • Ctrl+F5 run script • Ctrl-z undo

  19. Summary • Python built-in data types: • numeric types: integer 1, long integer 987654321L, floating point number 3.14, complex number 2+3j • sequence types: strings ””, list [”cat”, 3], tuple (1,2), xrange • mapping type: dictionary {key:value} • other: module, class, class instance, function, method, file object

  20. Summary II • expressions: • arithmethic operators: + - * / ** % • statements: • if ...: ... elif ...: ... else: • while ...: ... • for ... in ...: • import • return

  21. Summary III (Objects) • classClassName(superclass(es)): • constructor def __init__(self): • generate instance: instance = ClassName() • instance variables: self.variable • methods def method(self, ...): • call method: instance.method() • Python instance objects are new namespaces!

  22. Where to Get More Information • Python WWW site (download Python, documentation, links) • http://www.python.org • Vaults of Parnassus (Python resources) • http://www.vex.net/parnassus/ • Usenet: news:comp.lang.python • And of course Python’s built-in documentation!

  23. Recommended Books • Harms; McDonald: The Quick Python Book (Manning Publications 2000) • Lutz; Archer: Learning Python (O’Reilly 1999) • Chun, Wesley J.: Core Python Programming (Prentice Hall 2000) • Beazley, David: Python Essential Reference (New Riders 1999) • Lutz, Mark: Programming Python (2nd Edition) (O’Reilly 2001) • Grayson, John E.: Python and Tkinter Programming (Manning Publications 2000)

  24. On-line books • Non-Programmers Tutorial for Python • http://www.honors.montana.edu/~jjc/easytut/easytut/ • Learning to Program • http://www.crosswinds.net/~agauld/ • How to Think Like a Computer Scientist • http://www.ibiblio.org/obp/thinkCS.html • Dive into Python (for experienced programmers) • http://www.diveintopython.org

  25. SQL (Structured Query Language) • Getting Started with SQL • http://javascriptweenie.com/articles/sql.html • Introduction to Structured Query Language • http://w3.one.net/~jhoffman/sqltut.htm • MySQL – free, opensource SQL database • http://www.mysql.com/ • MySQL tutorials • http://www.devshed.com/Server_Side/MySQL/

  26. Programming Languages • Google Web directory > Programming > Languages • http://directory.google.com/Top/Computers/Programming/Languages/ • The Great Computer Language Shootout • http://www.bagley.org/~doug/shootout/ • Language Comparison and Critiques • http://www.openhere.com/tech1/programming/languages/language-comparison-and-critiques/

  27. Language Comparisons • An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl for a search/string-processing program • http://wwwipd.ira.uka.de/~prechelt/Biblio/#jccpprtTR • An Analysis of Two Next-Generation Languages: Java and Python • http://www.python.org/~rmasse/papers/java-python96/ • A subjective analysis of two high-level, object-oriented languages – Comparing Python to Java • http://www.twistedmatrix.com/~glyph/rant/python-vs-java.html

  28. Successfull Software Projects • Brooks, Frederick: The Mythical Man-Month: Essays on Software Engineering (Addison-Wesley 1995) • Beating the Averages • http://www.paulgraham.com/paulgraham/avg.html • Matloff, Norman: Debunking the Myth of a Desperate Software Labor Shortage • http://heather.cs.ucdavis.edu/itaa.real.html • Extreme Programming • http://www.extremeprogramming.org

More Related