SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
Why I Love Python
 …with some essential
 questions about computing


© 2008 Bruce Eckel
MindView, Inc.
www.mindviewinc.com


Write questions
on paper
Alas, I’ve spent years of my life here…




                 Why I Love Python   ©2008 www.MindView.net
The language
you speak affects
what you can
think
By learning
multiple
languages, I can
think more
broadly and
create better
designs
Reduces rigid thinking
Does Language Matter?
Fundamental Question
 How much safety
 can we build into a
 language?
 What can you
 actually get?
 What does it cost?



                 Why I Love Python   ©2008 www.MindView.net
Directing vs. Enabling




               Why I Love Python   ©2008 www.MindView.net
More static
          typing is better
           It’s a belief




Why I Love Python   ©2008 www.MindView.net
Why I Love Python   ©2008 www.MindView.net
From “Sway”:
  Fear of loss -> Playing “not to lose”
  Commitment
Static analysis is very useful

                                    But it should be
                                    decoupled from
                                    the language
                                    Allows more
                                    experiments;
                                    faster addition of
                                    new tests
                                    Python benefits
                                    from more static
                                    analysis tools

                Why I Love Python      ©2008 www.MindView.net
Optional Static Typing
 Scott Meyers: Static typing is for
 development tools and code
 generation.
 ActionScript (the Flex language) is a dynamic
 language with optional static typing
   FlexBuilder gives code hinting when you provide
   type information
   But you can turn it off whenever you want
   Something like what Python 3 allows


                     Why I Love Python   ©2008 www.MindView.net
ActionScript

package com.mindviewinc.functional {
  public function reduce(a:Array, reducer:Function):* {
    var result:* = a[0]
    for each(var item:* in a.slice(1, a.length))
      result = reducer(result, item)
    return result
  }
}
Is Programming Art or Engineering?
Many
Companies
Desperately
Want it to be
Engineering


  Replaceable You
Why I Love Python   ©2008 www.MindView.net
The Concurrency Problem
 Processor speed
 increases replaced
 by multiple cores
 How do we use
 them?




                Why I Love Python   ©2008 www.MindView.net
Why I Love Python




    Why I Love Python       ©2008
           www.MindView.net
What I love most: Python is about ME

 As if Guido said: “Bruce,
 what can we do to make
 your programming
 experience as easy as
 possible?”
 No compromises: it’s all
 about making me more
 productive

                  Why I Love Python   ©2008 www.MindView.net
A ‘Bout’ of Perl
 After C++ and Java, seemed amazing
 Python is executable pseudocode. Perl
 is executable line noise.
 Perl is like vice grips. You can do
 anything with it, and it's the wrong tool
 for every job (Leaves teeth marks
 everywhere)
 Perl is worse than Python because
 people wanted it worse. Larry Wall, 14 Oct 1998
 I would actively encourage my
 competition to use Perl. Sean True, 30 Mar 1999
                    Why I Love Python   ©2008 www.MindView.net
Python Reduces Clutter
Programs are read more
than they are written
Consistent formatting
really is important
  Readability and compactness
  Conservation of complexity:
  Simplicity really does
  make a difference
Consistent use of programming idioms
improves understandability
  Rapid understanding
  The opposite of “more than one way to do it”
                     Why I Love Python   ©2008 www.MindView.net
It doesn’t value performance
over my productivity
  C++: can’t let go of C performance
     Better than C, sure, but still takes forever
    to get something working; memory leaks
    are almost impossible to design out
  Java: Primitive types require awkward
  coding (primitives “necessary” for speed)
     As opposed to Python: everything is an
    object; escape mechanism for speed:
    ctypes

                     Why I Love Python   ©2008 www.MindView.net
It doesn’t treat me like I’m stupid
 “Operator overloading is bad because you
 can make ugly code with it”
 “finalize( ) does something”
 “We reviewed Java designs before putting
 them into the language”
 AWT & EJB are great, Swing
 is easy, JavaFX will be great!
 “Every new feature
 makes it better!
 Generics! Closures!”

                  Why I Love Python   ©2008 www.MindView.net
Pro                               Con
  Garbage collection is now           Dumb naming. Java 2 is
  mainstream                          1.2, Java 5 is 1.5. Also
  Virtual                             nio and nnio. Naming is
  machines/bytecode                   important.
  interpreters are now                Classpath (enough said)
  mainstream                          Bad invention in general
  Unified error handling vs.          Added-on features to
  C++                                 compensate for bad
                                      language design
                                      Never admitting that the
                                      design was bad in the
                                      first place
                                      Checked exceptions.
                                      Sound good, don't scale
                               Why I Love Python   ©2008 www.MindView.net
Con                                Con
 Primitives (but they like to          Assertions: they're off by
 call the language quot;pure”)             default; you have to turn
 Knee-jerk threading,                  them on via a command-
 which is confusing and                line flag
 too hard to get right.                Generics (so-called) w/
 Subtle threading bugs                 erasure. Not really
 until Java 5                          generics, just support for
 They *had* to rush it out,            collection typing. Even
 now they're                           one of the architects has
 monkeypatching the                    reversed position.
 language                              Now closures! But this
 Faked properties and                  has rapidly become a
 events (JavaBeans)                    mess with lots of push-
                                       back, no doubt because
                                       of generics.
                                Why I Love Python   ©2008 www.MindView.net
Con                              Con
 The EJB fiasco (many                AWT was too simple &
 billions lost)                      bad. Swing is too
 The JCP: Panders to                 complex, but Sun has a
 every special interest and          deathgrip on it (sunk cost
 pushes the results on us            model). Now we have
 (you get 10 days to                 JavaFX instead of playing
 comment)                            well with, say, Flex which
                                     has already solved the
                                     problems.
                                     I could go on.




                              Why I Love Python   ©2008 www.MindView.net
Con                                Pro
 Self                                  (Everything else)
 GIL is unavoidable, but               Biggest: I trust Guido, the
 we need a pythonic                    team, and the community.
 concurrency model (don't              Choices that seem weird
 just use threads because              at first turn out to be good
 everyone else does).                  (comprehensions).
 Need a one-click installer            Things that are broken
 as part of the distribution.          get fixed (XML library,
 An easy_install type of               refactoring in Python 3).
 service should also be                I'd like to just work with
 built in.                             Python and Flex.
                                       Currently, for me, that's
                                       the best of all worlds.


                                Why I Love Python   ©2008 www.MindView.net
It doesn’t make assumptions
about how we discover errors
Is static type checking really
the only way to be sure?
  Lack of good static typing in pre-ANSI C
  was certainly heaps of trouble
  Doesn’t mean it’s the best solution
Errors discovered with real data seem
to me to be the hardest to find statically


                   Why I Love Python   ©2008 www.MindView.net
Marketing people are not involved
 “Java is flawless”
 Of course, Python
 isn’t immune




Spam, spam, spam, spam …



                   Why I Love Python   ©2008 www.MindView.net
I don’t have to type so much
 … And I don’t have to wade through so
 much code when I’m reading
 But the right typing
   Not obscure like APL
   Not endlessly inventive
   like Perl or FORTH




                   Why I Love Python   ©2008 www.MindView.net
The clean design of the language
encourages clean library design:

import feedparser
rss = feedparser.parse('myurl.rss')
for entry in rss['entries']:
    print entry['link'],
          entry['title'],
          entry['summary‘]



                Why I Love Python   ©2008 www.MindView.net
My guesses are
usually right
 Most things in Java
 require me to look
 something up
 I can remember many Python idioms
 because they’re simpler
 One more reason I program faster



               Why I Love Python   ©2008 www.MindView.net
I can remember this:
file(quot;Myfile.txtquot;)
I always have to look this up:
import java.io.*;
BufferedReader in = new BufferedReader(
  new FileReader(quot;Myfile.txtquot;));




                 Why I Love Python   ©2008 www.MindView.net
#1:
Python lets me focus on concepts
 No stumbling through Java designs,
 fighting with C++ compilations or run-time
 bugs.




                  Why I Love Python   ©2008 www.MindView.net
Duck (Structural) typing
 Only constraints on an object that is
 passed into a function are that the
 function can apply its operations to that
 object
 def sum(arg1, arg2):
     return arg1 + arg2

 print sum(42, 47)
 print sum('spam', 'eggs')

 If it walks like a duck, and talks like a duck…
                   Why I Love Python   ©2008 www.MindView.net
Duck Typing in C++: Templates
#include <string>
#include <iostream>
using namespace std;

template<class A, class B, class R>
R sum(A a, B b) {
  return a + b;
}

int main() {
  string a(quot;onequot;), b(quot;twoquot;)
  cout << sum<string, string, string>(a, b) << endl;
  cout << sum<int, int, int>(1, 2) << endl;
}

                       Why I Love Python   ©2008 www.MindView.net
Duck Typing in Java
 Reflection, possibly with interfaces




                  Why I Love Python   ©2008 www.MindView.net
interface addable { Object add(Object b);}
class X implements addable {
  public Object add(Object b) {
    return new Object(); // Test
  }
}
class AddableNotFoundException extends Exception {}
public class DuckTyping {
  public static Object sum(Object a, Object b)
    throws AddableNotFoundException {
    Class[] intfs = a.getClass().getInterfaces();
    for(int i = 0; i < intfs.length; i++)
      if(intfs[i] == addable.class)
        return ((addable)a).add(b);
    throw new AddableNotFoundException();
  }
  public static void
  main(String[] args) throws Exception {
    X a = new X();
    X b = new X();
    Object c = sum(a, b);
  }
}
Duck typing isn't weak
 You write what you want to do,
 let Python worry about how
 Argument against dynamic typing:
 “errors won’t be found”
   Like in pre-ANSI C (had no rules)
 As long as rules are enforced sometime,
 you’ll find the errors
   Heresy: run-time is better than compile time

                    Why I Love Python   ©2008 www.MindView.net
Performance issues
 Machine Performance
 vs. Programmer
 Performance
 Most of the time,
 which is really
 more important?
 Python 2.5 cytpes
 easily connect to dlls
 pp and similar solutions for multiprocessor
 machines and machine clusters
                   Why I Love Python   ©2008 www.MindView.net
Life is Short
(You Need Python)




   Why I Love Python       ©2008
          www.MindView.net
Questions

Mais conteúdo relacionado

Mais procurados

Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
20 Facts about Swift programming language
20 Facts about Swift programming language20 Facts about Swift programming language
20 Facts about Swift programming languageRohit Tirkey
 
Windows 10 in 10 Minutes
Windows 10 in 10 MinutesWindows 10 in 10 Minutes
Windows 10 in 10 MinutesHemant Prasad
 
Logo Programming language
Logo Programming languageLogo Programming language
Logo Programming languageJoy Protim
 
Introduction to keyboarding & document processing_PPT1.pptx
Introduction to keyboarding & document processing_PPT1.pptxIntroduction to keyboarding & document processing_PPT1.pptx
Introduction to keyboarding & document processing_PPT1.pptxTilapGeraldineM
 
Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)Sandip Nirmal
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming francopw
 
Human Computer Interaction + User Experience
Human Computer Interaction + User ExperienceHuman Computer Interaction + User Experience
Human Computer Interaction + User ExperienceJose Berengueres
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive ProgrammingGaurav Agarwal
 
Interacting With Your Computer
Interacting With Your ComputerInteracting With Your Computer
Interacting With Your ComputerZOOBIA fatima
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical fileAnkit Dixit
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2REHAN IJAZ
 
Revision for class 1 of computer
Revision for class 1 of computerRevision for class 1 of computer
Revision for class 1 of computerKanji Sodham
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with ScratchNicole Baratta
 

Mais procurados (19)

Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
20 Facts about Swift programming language
20 Facts about Swift programming language20 Facts about Swift programming language
20 Facts about Swift programming language
 
COCOMO MODEL
COCOMO MODELCOCOMO MODEL
COCOMO MODEL
 
GORM
GORMGORM
GORM
 
Windows 10 in 10 Minutes
Windows 10 in 10 MinutesWindows 10 in 10 Minutes
Windows 10 in 10 Minutes
 
Logo Programming language
Logo Programming languageLogo Programming language
Logo Programming language
 
Introduction to keyboarding & document processing_PPT1.pptx
Introduction to keyboarding & document processing_PPT1.pptxIntroduction to keyboarding & document processing_PPT1.pptx
Introduction to keyboarding & document processing_PPT1.pptx
 
Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)Introduction to Progressive Web Apps (PWA)
Introduction to Progressive Web Apps (PWA)
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
Human Computer Interaction + User Experience
Human Computer Interaction + User ExperienceHuman Computer Interaction + User Experience
Human Computer Interaction + User Experience
 
HCI, Chapter 3
HCI, Chapter 3HCI, Chapter 3
HCI, Chapter 3
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive Programming
 
The Word Processor
The Word ProcessorThe Word Processor
The Word Processor
 
Interacting With Your Computer
Interacting With Your ComputerInteracting With Your Computer
Interacting With Your Computer
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 
Notepad ++
Notepad ++Notepad ++
Notepad ++
 
Revision for class 1 of computer
Revision for class 1 of computerRevision for class 1 of computer
Revision for class 1 of computer
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with Scratch
 

Destaque

Top 5 Deep Learning and AI Stories 3/9
Top 5 Deep Learning and AI Stories 3/9Top 5 Deep Learning and AI Stories 3/9
Top 5 Deep Learning and AI Stories 3/9NVIDIA
 
Looking for Disruptive Business Models in Higher Education
Looking for Disruptive Business Models in Higher EducationLooking for Disruptive Business Models in Higher Education
Looking for Disruptive Business Models in Higher EducationCraig Martin
 
ARMS TRADE BETWEEN TURKEY AND EU 2015
ARMS TRADE BETWEEN TURKEY AND EU 2015ARMS TRADE BETWEEN TURKEY AND EU 2015
ARMS TRADE BETWEEN TURKEY AND EU 2015Thierry Debels
 
ハードディスクの正しい消去(2015.7)
ハードディスクの正しい消去(2015.7)ハードディスクの正しい消去(2015.7)
ハードディスクの正しい消去(2015.7)UEHARA, Tetsutaro
 
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことAWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことKeisuke Nishitani
 
B2B Marketing and The Power of Twitter
B2B Marketing and The Power of TwitterB2B Marketing and The Power of Twitter
B2B Marketing and The Power of TwitterSteve Yanor
 
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary Singularity
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary SingularityThe Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary Singularity
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary SingularityDinis Guarda
 
The Be-All, End-All List of Small Business Tax Deductions
The Be-All, End-All List of Small Business Tax DeductionsThe Be-All, End-All List of Small Business Tax Deductions
The Be-All, End-All List of Small Business Tax DeductionsWagepoint
 
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpotHubSpot
 
How to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHow to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHubSpot
 
25 Discovery Call Questions
25 Discovery Call Questions25 Discovery Call Questions
25 Discovery Call QuestionsHubSpot
 
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...HubSpot
 
Class 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessClass 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessHubSpot
 
Behind the Scenes: Launching HubSpot Tokyo
Behind the Scenes: Launching HubSpot TokyoBehind the Scenes: Launching HubSpot Tokyo
Behind the Scenes: Launching HubSpot TokyoHubSpot
 
HubSpot Diversity Data 2016
HubSpot Diversity Data 2016HubSpot Diversity Data 2016
HubSpot Diversity Data 2016HubSpot
 
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...HubSpot
 
What is Inbound Recruiting?
What is Inbound Recruiting?What is Inbound Recruiting?
What is Inbound Recruiting?HubSpot
 
3 Proven Sales Email Templates Used by Successful Companies
3 Proven Sales Email Templates Used by Successful Companies3 Proven Sales Email Templates Used by Successful Companies
3 Proven Sales Email Templates Used by Successful CompaniesHubSpot
 
Add the Women Back: Wikipedia Edit-a-Thon
Add the Women Back: Wikipedia Edit-a-ThonAdd the Women Back: Wikipedia Edit-a-Thon
Add the Women Back: Wikipedia Edit-a-ThonHubSpot
 

Destaque (20)

Top 5 Deep Learning and AI Stories 3/9
Top 5 Deep Learning and AI Stories 3/9Top 5 Deep Learning and AI Stories 3/9
Top 5 Deep Learning and AI Stories 3/9
 
Looking for Disruptive Business Models in Higher Education
Looking for Disruptive Business Models in Higher EducationLooking for Disruptive Business Models in Higher Education
Looking for Disruptive Business Models in Higher Education
 
ARMS TRADE BETWEEN TURKEY AND EU 2015
ARMS TRADE BETWEEN TURKEY AND EU 2015ARMS TRADE BETWEEN TURKEY AND EU 2015
ARMS TRADE BETWEEN TURKEY AND EU 2015
 
Speakers PMF17
Speakers PMF17Speakers PMF17
Speakers PMF17
 
ハードディスクの正しい消去(2015.7)
ハードディスクの正しい消去(2015.7)ハードディスクの正しい消去(2015.7)
ハードディスクの正しい消去(2015.7)
 
AWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべことAWSでアプリ開発するなら 知っておくべこと
AWSでアプリ開発するなら 知っておくべこと
 
B2B Marketing and The Power of Twitter
B2B Marketing and The Power of TwitterB2B Marketing and The Power of Twitter
B2B Marketing and The Power of Twitter
 
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary Singularity
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary SingularityThe Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary Singularity
The Next Tsunami AI Blockchain IOT and Our Swarm Evolutionary Singularity
 
The Be-All, End-All List of Small Business Tax Deductions
The Be-All, End-All List of Small Business Tax DeductionsThe Be-All, End-All List of Small Business Tax Deductions
The Be-All, End-All List of Small Business Tax Deductions
 
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 
How to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHow to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's Buyer
 
25 Discovery Call Questions
25 Discovery Call Questions25 Discovery Call Questions
25 Discovery Call Questions
 
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
 
Class 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessClass 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your Business
 
Behind the Scenes: Launching HubSpot Tokyo
Behind the Scenes: Launching HubSpot TokyoBehind the Scenes: Launching HubSpot Tokyo
Behind the Scenes: Launching HubSpot Tokyo
 
HubSpot Diversity Data 2016
HubSpot Diversity Data 2016HubSpot Diversity Data 2016
HubSpot Diversity Data 2016
 
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...
Why People Block Ads (And What It Means for Marketers and Advertisers) [New R...
 
What is Inbound Recruiting?
What is Inbound Recruiting?What is Inbound Recruiting?
What is Inbound Recruiting?
 
3 Proven Sales Email Templates Used by Successful Companies
3 Proven Sales Email Templates Used by Successful Companies3 Proven Sales Email Templates Used by Successful Companies
3 Proven Sales Email Templates Used by Successful Companies
 
Add the Women Back: Wikipedia Edit-a-Thon
Add the Women Back: Wikipedia Edit-a-ThonAdd the Women Back: Wikipedia Edit-a-Thon
Add the Women Back: Wikipedia Edit-a-Thon
 

Semelhante a Why I Love Python V2

Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonSpotle.ai
 
Dear compiler please don't be my nanny v2
Dear compiler  please don't be my nanny v2Dear compiler  please don't be my nanny v2
Dear compiler please don't be my nanny v2Dino Dini
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
 
Poing: a coder’s take on protein modelling
Poing: a coder’s take on protein modellingPoing: a coder’s take on protein modelling
Poing: a coder’s take on protein modellingBiogeeks
 
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
Lennart Regebro   What Zope Did Wrong (And What To Do Instead)Lennart Regebro   What Zope Did Wrong (And What To Do Instead)
Lennart Regebro What Zope Did Wrong (And What To Do Instead)Vincenzo Barone
 
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
Lennart Regebro   What Zope Did Wrong (And What To Do Instead)Lennart Regebro   What Zope Did Wrong (And What To Do Instead)
Lennart Regebro What Zope Did Wrong (And What To Do Instead)Vincenzo Barone
 
Performance Enhancement Tips
Performance Enhancement TipsPerformance Enhancement Tips
Performance Enhancement TipsTim (文昌)
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)wesley chun
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)wesley chun
 
Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Ronan Lamy
 
开源沙龙第一期 Python intro
开源沙龙第一期 Python intro开源沙龙第一期 Python intro
开源沙龙第一期 Python introfantasy zheng
 
Why I Love Python
Why I Love PythonWhy I Love Python
Why I Love Pythondidip
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PuneEthan's Tech
 
Why you should use the Yocto Project
Why you should use the Yocto ProjectWhy you should use the Yocto Project
Why you should use the Yocto Projectrossburton
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For ManagersAtul Shridhar
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSCisco Russia
 
Cr java concept by vikas jagtap
Cr java  concept by vikas jagtapCr java  concept by vikas jagtap
Cr java concept by vikas jagtapVikas Jagtap
 

Semelhante a Why I Love Python V2 (20)

Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Dear compiler please don't be my nanny v2
Dear compiler  please don't be my nanny v2Dear compiler  please don't be my nanny v2
Dear compiler please don't be my nanny v2
 
Python overview
Python overviewPython overview
Python overview
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
Poing: a coder’s take on protein modelling
Poing: a coder’s take on protein modellingPoing: a coder’s take on protein modelling
Poing: a coder’s take on protein modelling
 
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
Lennart Regebro   What Zope Did Wrong (And What To Do Instead)Lennart Regebro   What Zope Did Wrong (And What To Do Instead)
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
 
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
Lennart Regebro   What Zope Did Wrong (And What To Do Instead)Lennart Regebro   What Zope Did Wrong (And What To Do Instead)
Lennart Regebro What Zope Did Wrong (And What To Do Instead)
 
Performance Enhancement Tips
Performance Enhancement TipsPerformance Enhancement Tips
Performance Enhancement Tips
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
 
Pythonic doesn't mean slow!
Pythonic doesn't mean slow!Pythonic doesn't mean slow!
Pythonic doesn't mean slow!
 
开源沙龙第一期 Python intro
开源沙龙第一期 Python intro开源沙龙第一期 Python intro
开源沙龙第一期 Python intro
 
Why I Love Python
Why I Love PythonWhy I Love Python
Why I Love Python
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
 
Why you should use the Yocto Project
Why you should use the Yocto ProjectWhy you should use the Yocto Project
Why you should use the Yocto Project
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OS
 
Cr java concept by vikas jagtap
Cr java  concept by vikas jagtapCr java  concept by vikas jagtap
Cr java concept by vikas jagtap
 

Mais de gsroma

Python Pythononcampus Uva 060609
Python Pythononcampus Uva 060609Python Pythononcampus Uva 060609
Python Pythononcampus Uva 060609gsroma
 
Amora: A mobile remote assistant
Amora: A mobile remote assistantAmora: A mobile remote assistant
Amora: A mobile remote assistantgsroma
 
Integração de aplicações em
Integração de aplicações emIntegração de aplicações em
Integração de aplicações emgsroma
 
Computação Gráfica em Python
Computação Gráfica em PythonComputação Gráfica em Python
Computação Gráfica em Pythongsroma
 
Python Na Informática Para Biodiversidade
Python Na Informática Para BiodiversidadePython Na Informática Para Biodiversidade
Python Na Informática Para Biodiversidadegsroma
 
Por que Python?
Por que Python?Por que Python?
Por que Python?gsroma
 
Integrando C com Python
Integrando C com PythonIntegrando C com Python
Integrando C com Pythongsroma
 
Busca Visual
Busca VisualBusca Visual
Busca Visualgsroma
 
Pound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de CargaPound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de Cargagsroma
 
ZEO/RelStorage/PostgreSQL
ZEO/RelStorage/PostgreSQLZEO/RelStorage/PostgreSQL
ZEO/RelStorage/PostgreSQLgsroma
 

Mais de gsroma (10)

Python Pythononcampus Uva 060609
Python Pythononcampus Uva 060609Python Pythononcampus Uva 060609
Python Pythononcampus Uva 060609
 
Amora: A mobile remote assistant
Amora: A mobile remote assistantAmora: A mobile remote assistant
Amora: A mobile remote assistant
 
Integração de aplicações em
Integração de aplicações emIntegração de aplicações em
Integração de aplicações em
 
Computação Gráfica em Python
Computação Gráfica em PythonComputação Gráfica em Python
Computação Gráfica em Python
 
Python Na Informática Para Biodiversidade
Python Na Informática Para BiodiversidadePython Na Informática Para Biodiversidade
Python Na Informática Para Biodiversidade
 
Por que Python?
Por que Python?Por que Python?
Por que Python?
 
Integrando C com Python
Integrando C com PythonIntegrando C com Python
Integrando C com Python
 
Busca Visual
Busca VisualBusca Visual
Busca Visual
 
Pound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de CargaPound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de Carga
 
ZEO/RelStorage/PostgreSQL
ZEO/RelStorage/PostgreSQLZEO/RelStorage/PostgreSQL
ZEO/RelStorage/PostgreSQL
 

Último

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Why I Love Python V2

  • 1. Why I Love Python …with some essential questions about computing © 2008 Bruce Eckel MindView, Inc. www.mindviewinc.com Write questions on paper
  • 2. Alas, I’ve spent years of my life here… Why I Love Python ©2008 www.MindView.net
  • 3.
  • 4.
  • 5.
  • 6. The language you speak affects what you can think By learning multiple languages, I can think more broadly and create better designs
  • 9.
  • 10. Fundamental Question How much safety can we build into a language? What can you actually get? What does it cost? Why I Love Python ©2008 www.MindView.net
  • 11. Directing vs. Enabling Why I Love Python ©2008 www.MindView.net
  • 12.
  • 13. More static typing is better It’s a belief Why I Love Python ©2008 www.MindView.net
  • 14. Why I Love Python ©2008 www.MindView.net
  • 15. From “Sway”: Fear of loss -> Playing “not to lose” Commitment
  • 16.
  • 17. Static analysis is very useful But it should be decoupled from the language Allows more experiments; faster addition of new tests Python benefits from more static analysis tools Why I Love Python ©2008 www.MindView.net
  • 18. Optional Static Typing Scott Meyers: Static typing is for development tools and code generation. ActionScript (the Flex language) is a dynamic language with optional static typing FlexBuilder gives code hinting when you provide type information But you can turn it off whenever you want Something like what Python 3 allows Why I Love Python ©2008 www.MindView.net
  • 19. ActionScript package com.mindviewinc.functional { public function reduce(a:Array, reducer:Function):* { var result:* = a[0] for each(var item:* in a.slice(1, a.length)) result = reducer(result, item) return result } }
  • 20. Is Programming Art or Engineering?
  • 21. Many Companies Desperately Want it to be Engineering Replaceable You
  • 22. Why I Love Python ©2008 www.MindView.net
  • 23. The Concurrency Problem Processor speed increases replaced by multiple cores How do we use them? Why I Love Python ©2008 www.MindView.net
  • 24. Why I Love Python Why I Love Python ©2008 www.MindView.net
  • 25. What I love most: Python is about ME As if Guido said: “Bruce, what can we do to make your programming experience as easy as possible?” No compromises: it’s all about making me more productive Why I Love Python ©2008 www.MindView.net
  • 26. A ‘Bout’ of Perl After C++ and Java, seemed amazing Python is executable pseudocode. Perl is executable line noise. Perl is like vice grips. You can do anything with it, and it's the wrong tool for every job (Leaves teeth marks everywhere) Perl is worse than Python because people wanted it worse. Larry Wall, 14 Oct 1998 I would actively encourage my competition to use Perl. Sean True, 30 Mar 1999 Why I Love Python ©2008 www.MindView.net
  • 27. Python Reduces Clutter Programs are read more than they are written Consistent formatting really is important Readability and compactness Conservation of complexity: Simplicity really does make a difference Consistent use of programming idioms improves understandability Rapid understanding The opposite of “more than one way to do it” Why I Love Python ©2008 www.MindView.net
  • 28. It doesn’t value performance over my productivity C++: can’t let go of C performance Better than C, sure, but still takes forever to get something working; memory leaks are almost impossible to design out Java: Primitive types require awkward coding (primitives “necessary” for speed) As opposed to Python: everything is an object; escape mechanism for speed: ctypes Why I Love Python ©2008 www.MindView.net
  • 29. It doesn’t treat me like I’m stupid “Operator overloading is bad because you can make ugly code with it” “finalize( ) does something” “We reviewed Java designs before putting them into the language” AWT & EJB are great, Swing is easy, JavaFX will be great! “Every new feature makes it better! Generics! Closures!” Why I Love Python ©2008 www.MindView.net
  • 30. Pro Con Garbage collection is now Dumb naming. Java 2 is mainstream 1.2, Java 5 is 1.5. Also Virtual nio and nnio. Naming is machines/bytecode important. interpreters are now Classpath (enough said) mainstream Bad invention in general Unified error handling vs. Added-on features to C++ compensate for bad language design Never admitting that the design was bad in the first place Checked exceptions. Sound good, don't scale Why I Love Python ©2008 www.MindView.net
  • 31. Con Con Primitives (but they like to Assertions: they're off by call the language quot;pure”) default; you have to turn Knee-jerk threading, them on via a command- which is confusing and line flag too hard to get right. Generics (so-called) w/ Subtle threading bugs erasure. Not really until Java 5 generics, just support for They *had* to rush it out, collection typing. Even now they're one of the architects has monkeypatching the reversed position. language Now closures! But this Faked properties and has rapidly become a events (JavaBeans) mess with lots of push- back, no doubt because of generics. Why I Love Python ©2008 www.MindView.net
  • 32. Con Con The EJB fiasco (many AWT was too simple & billions lost) bad. Swing is too The JCP: Panders to complex, but Sun has a every special interest and deathgrip on it (sunk cost pushes the results on us model). Now we have (you get 10 days to JavaFX instead of playing comment) well with, say, Flex which has already solved the problems. I could go on. Why I Love Python ©2008 www.MindView.net
  • 33. Con Pro Self (Everything else) GIL is unavoidable, but Biggest: I trust Guido, the we need a pythonic team, and the community. concurrency model (don't Choices that seem weird just use threads because at first turn out to be good everyone else does). (comprehensions). Need a one-click installer Things that are broken as part of the distribution. get fixed (XML library, An easy_install type of refactoring in Python 3). service should also be I'd like to just work with built in. Python and Flex. Currently, for me, that's the best of all worlds. Why I Love Python ©2008 www.MindView.net
  • 34. It doesn’t make assumptions about how we discover errors Is static type checking really the only way to be sure? Lack of good static typing in pre-ANSI C was certainly heaps of trouble Doesn’t mean it’s the best solution Errors discovered with real data seem to me to be the hardest to find statically Why I Love Python ©2008 www.MindView.net
  • 35. Marketing people are not involved “Java is flawless” Of course, Python isn’t immune Spam, spam, spam, spam … Why I Love Python ©2008 www.MindView.net
  • 36. I don’t have to type so much … And I don’t have to wade through so much code when I’m reading But the right typing Not obscure like APL Not endlessly inventive like Perl or FORTH Why I Love Python ©2008 www.MindView.net
  • 37. The clean design of the language encourages clean library design: import feedparser rss = feedparser.parse('myurl.rss') for entry in rss['entries']: print entry['link'], entry['title'], entry['summary‘] Why I Love Python ©2008 www.MindView.net
  • 38. My guesses are usually right Most things in Java require me to look something up I can remember many Python idioms because they’re simpler One more reason I program faster Why I Love Python ©2008 www.MindView.net
  • 39. I can remember this: file(quot;Myfile.txtquot;) I always have to look this up: import java.io.*; BufferedReader in = new BufferedReader( new FileReader(quot;Myfile.txtquot;)); Why I Love Python ©2008 www.MindView.net
  • 40. #1: Python lets me focus on concepts No stumbling through Java designs, fighting with C++ compilations or run-time bugs. Why I Love Python ©2008 www.MindView.net
  • 41. Duck (Structural) typing Only constraints on an object that is passed into a function are that the function can apply its operations to that object def sum(arg1, arg2): return arg1 + arg2 print sum(42, 47) print sum('spam', 'eggs') If it walks like a duck, and talks like a duck… Why I Love Python ©2008 www.MindView.net
  • 42. Duck Typing in C++: Templates #include <string> #include <iostream> using namespace std; template<class A, class B, class R> R sum(A a, B b) { return a + b; } int main() { string a(quot;onequot;), b(quot;twoquot;) cout << sum<string, string, string>(a, b) << endl; cout << sum<int, int, int>(1, 2) << endl; } Why I Love Python ©2008 www.MindView.net
  • 43. Duck Typing in Java Reflection, possibly with interfaces Why I Love Python ©2008 www.MindView.net
  • 44. interface addable { Object add(Object b);} class X implements addable { public Object add(Object b) { return new Object(); // Test } } class AddableNotFoundException extends Exception {} public class DuckTyping { public static Object sum(Object a, Object b) throws AddableNotFoundException { Class[] intfs = a.getClass().getInterfaces(); for(int i = 0; i < intfs.length; i++) if(intfs[i] == addable.class) return ((addable)a).add(b); throw new AddableNotFoundException(); } public static void main(String[] args) throws Exception { X a = new X(); X b = new X(); Object c = sum(a, b); } }
  • 45. Duck typing isn't weak You write what you want to do, let Python worry about how Argument against dynamic typing: “errors won’t be found” Like in pre-ANSI C (had no rules) As long as rules are enforced sometime, you’ll find the errors Heresy: run-time is better than compile time Why I Love Python ©2008 www.MindView.net
  • 46. Performance issues Machine Performance vs. Programmer Performance Most of the time, which is really more important? Python 2.5 cytpes easily connect to dlls pp and similar solutions for multiprocessor machines and machine clusters Why I Love Python ©2008 www.MindView.net
  • 47. Life is Short (You Need Python) Why I Love Python ©2008 www.MindView.net