SlideShare a Scribd company logo
Why I Love Python © 2001 Bruce Eckel MindView, Inc. Training & Consulting 5343 Valle Vista La Mesa, CA 91941 [email_address] www.MindView.net ftp://www.mindview.net/pub/eckel/LovePython.zip
The language you speak affects what you can think Python is what I use the most to solve my own problems (I  think  better) Including CGI/e-commerce with MySQL 5-10  times  productivity (really!) I’ve been trying to figure out how to explain “why” to people Top 10 reasons I’ve come up with And a few other interesting topics
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
My Language History Age 13: BASIC on HP1000 (HOSRAC.BAS is invented) Age 19: APL for physics. The  concept of a "terse language". Basic again, survey courses, Pascal et al. Age 21: Computer engineering, Chips + assembly language Age 22: I begin to understand the value of high-level languages Age 24: Database programming AppleII Basic
Age 25: Graduate (finally) with MS, discover C, work in embedded programming (in assembly). I am my own C compiler Age 26: Basic (again) for data analysis and control of wind-tunnel experiments Age 27: Embedded C development. Program 4-bit Harvard architecture machine in assembly. Wrote Assembler in GNU-Lisp. Created (?) primitive C++ mode for Gnu-emacs Start writing for Micro Cornucopia Age 29: University of Washington School of Oceanography with Tom Keffer.  Chose C++ over Objective-C for openness. Published “Computer Interfacing with Pascal & C”
Age 32: Publish “Using C++” Join ANSI C++ Committee Later: “C++ Inside & Out”, “Black-Belt C++” (edited), “Thinking in C++” Java: “easy translation from C++” Actually took two years Thinking in Python Research mode now, web page with notes at  www.BruceEckel.com The other books and languages wrapped around me like Jacob Marley’s chains…
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
Top 10 Reasons  Why I Love Python
10. Reduced Clutter Programs are read more  than they are written XP: Consistent formatting  really  is  important Readability and compactness Part of “conservation of complexity” Consistent use of programming idioms improves understandability Rapid understanding The opposite of “more than one way to do it”
9. It’s not backward-compatible in exchange for pain C++: Backward compatible  with C – its strength  and its bane Java: more or less with  C++ syntax (not too bad,  but a lot of typing) Perl: compatible with every hacky syntax of every Unix tool ever invented C# and .NET: backward compatible with previous Microsoft marketing campaigns Javascript: not even compatible with itself
8. 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 (extension) for speed
7. 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” “Java has an open  development process”
6. I don’t wait forever for a full implementation of the language Some features we invented in the C++ committee are still not implemented Unused features  don’t get tested; circular problem Many C++ vendors  say “it’s hard, and no one’s asking for it.”
5. It doesn’t make assumptions about how we discover errors Is strong 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 (More about this later) Errors discovered with real data seem to me to be the hardest to find
4. Marketing people are not involved “Java is flawless” Microsoft “Visual” “C++” Microsoft happens Of course, Python isn’t immune
3. I don’t have to type so much … And I don’t have to wade through so much code when I’m reading Conservation of complexity:  simplicity really does  make a difference But the  right  typing Not obscure like APL Not endlessly inventive like Perl or FORTH
2. My guesses are  usually right I  still  have to look up  how to open a file  every time I do it in Java In fact, 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
1. Python lets me focus on  concepts No stumbling through Java designs, fighting with C++ compilations or run-time bugs.
Python and “The Tipping Point” Email: possible to carry on dozens of conversations by paper mail, but you don’t. Automating Everything: Possible to write programs to automate every task. But you don’t. Python makes it easy enough Great with Gnu  make  (my CD build system)
Weak 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') “ Weak” sounds bad
Weak 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;one&quot;), b(&quot;two&quot;) cout << sum<string, string, string>(a, b) << endl; cout << sum<int, int, int>(1, 2) << endl; }
Weak Typing in Java Reflection, possibly with interfaces
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 WeakTyping { 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); } }
Why weak typing  isn't weak Upcasting becomes meaningless You write  what  you want to do, let Python worry about  how Argument against weak 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
Performance issues Machine performance vs. Programmer Performance Most of the time, which is really more important? C++ is naturally faster -- or is it? with IOStreams, not always
Future Impact Programmer productivity  is the most important thing  Python excels at rapid creation of  maintainable  code To increase performance, throw hardware at the problem Multiprocessor machines & stackless Seems like an important direction, even to the point of justifying core language changes
Other Languages C# bores me. Removes the interesting/useful features of both Java & C++. I’d use one of those languages first. Ruby. I’ll wait and see, but my impression is that it doesn’t do more for me than Python (or not more enough).
NerdsOnBicycles.com On the New Zealand  bike trip, Bill Venners & I decided it would be a good idea to host technically-themed bike tours Run by a professional company with all the amenities, the “sag wagon” etc. We thought a Python-themed trip might be an interesting beginning Grand Tetons? Send email if interested
Life is Short (You Need Python) OR: No Warrantee Not Fit for Any Particular Purpose (You Need Python)

More Related Content

PPTX
Python programming
PDF
Python Loop
PDF
Python Foundation – A programmer's introduction to Python concepts & style
PPTX
Advantages of Python Learning | Why Python
PPTX
Python Dictionary.pptx
PDF
Intro to Python for Non-Programmers
PDF
Python Basics.pdf
PDF
Natural Language Processing (NLP)
Python programming
Python Loop
Python Foundation – A programmer's introduction to Python concepts & style
Advantages of Python Learning | Why Python
Python Dictionary.pptx
Intro to Python for Non-Programmers
Python Basics.pdf
Natural Language Processing (NLP)

What's hot (20)

PDF
Natural language processing
PPTX
2CPP14 - Abstraction
ODP
Object Oriented Javascript
PPTX
Kotlin presentation
PPTX
Chapter 05 classes and objects
PPTX
Introduction to gRPC
PDF
Python course syllabus
PDF
Python Debugging Fundamentals
PPTX
Python programming
PDF
Learning Python with PyCharm EDU
PDF
LanGCHAIN Framework
ODP
Python_in_Detail
PPT
Introduction to Python
PDF
Introduction to python
PPTX
HTTP2 and gRPC
PPTX
Web development with Python
PPTX
Introduction to Automation Testing
PDF
Docker and Go: why did we decide to write Docker in Go?
PDF
A quick and fast intro to Kotlin
PDF
ChatGPT: der unermüdliche Q&A-Tutor auf frag.jetzt
Natural language processing
2CPP14 - Abstraction
Object Oriented Javascript
Kotlin presentation
Chapter 05 classes and objects
Introduction to gRPC
Python course syllabus
Python Debugging Fundamentals
Python programming
Learning Python with PyCharm EDU
LanGCHAIN Framework
Python_in_Detail
Introduction to Python
Introduction to python
HTTP2 and gRPC
Web development with Python
Introduction to Automation Testing
Docker and Go: why did we decide to write Docker in Go?
A quick and fast intro to Kotlin
ChatGPT: der unermüdliche Q&A-Tutor auf frag.jetzt
Ad

Similar to Why I Love Python (20)

PDF
Why I Love Python V2
PDF
Ali alshehri c++_comparison between c++&amp;python
PDF
Number of Computer Languages = 3
PPTX
Unit 1 introduction to c++.pptx
PPTX
Programming using C++ - slides.pptx
PPTX
object oriented programming language fundamentals
PDF
Python overview
PDF
Object oriented programming c++
PDF
Object Oriented Programming using C++ - Part 1
PPTX
Summer training PPT Manasv Singharia.pptx
PPTX
Unit 1 of c++ part 1 basic introduction
PDF
C-and-Cpp-Brochure-English. .
PPT
Python Intro For Managers
PPTX
Top Programming Languages of 2020
PPTX
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
PPTX
Evolution of programming languages
PDF
PPTX
Computer languages
PDF
Python'den Guide.pdf
PPTX
Introduction to C++
Why I Love Python V2
Ali alshehri c++_comparison between c++&amp;python
Number of Computer Languages = 3
Unit 1 introduction to c++.pptx
Programming using C++ - slides.pptx
object oriented programming language fundamentals
Python overview
Object oriented programming c++
Object Oriented Programming using C++ - Part 1
Summer training PPT Manasv Singharia.pptx
Unit 1 of c++ part 1 basic introduction
C-and-Cpp-Brochure-English. .
Python Intro For Managers
Top Programming Languages of 2020
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
Evolution of programming languages
Computer languages
Python'den Guide.pdf
Introduction to C++
Ad

More from didip (9)

PDF
Oregon Measure 66
PPT
High Performance Erlang
PDF
Turbogears Presentation
PDF
Ecma 262
PDF
Socket Programming In Python
PDF
Google Research Paper
PDF
Feed Burner Scalability
PDF
Theory Psyco
PDF
Super Sizing Youtube with Python
Oregon Measure 66
High Performance Erlang
Turbogears Presentation
Ecma 262
Socket Programming In Python
Google Research Paper
Feed Burner Scalability
Theory Psyco
Super Sizing Youtube with Python

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Tartificialntelligence_presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Tartificialntelligence_presentation.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
A comparative analysis of optical character recognition models for extracting...
MYSQL Presentation for SQL database connectivity
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars

Why I Love Python

  • 1. Why I Love Python © 2001 Bruce Eckel MindView, Inc. Training & Consulting 5343 Valle Vista La Mesa, CA 91941 [email_address] www.MindView.net ftp://www.mindview.net/pub/eckel/LovePython.zip
  • 2. The language you speak affects what you can think Python is what I use the most to solve my own problems (I think better) Including CGI/e-commerce with MySQL 5-10 times productivity (really!) I’ve been trying to figure out how to explain “why” to people Top 10 reasons I’ve come up with And a few other interesting topics
  • 3. 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
  • 4. My Language History Age 13: BASIC on HP1000 (HOSRAC.BAS is invented) Age 19: APL for physics. The concept of a &quot;terse language&quot;. Basic again, survey courses, Pascal et al. Age 21: Computer engineering, Chips + assembly language Age 22: I begin to understand the value of high-level languages Age 24: Database programming AppleII Basic
  • 5. Age 25: Graduate (finally) with MS, discover C, work in embedded programming (in assembly). I am my own C compiler Age 26: Basic (again) for data analysis and control of wind-tunnel experiments Age 27: Embedded C development. Program 4-bit Harvard architecture machine in assembly. Wrote Assembler in GNU-Lisp. Created (?) primitive C++ mode for Gnu-emacs Start writing for Micro Cornucopia Age 29: University of Washington School of Oceanography with Tom Keffer. Chose C++ over Objective-C for openness. Published “Computer Interfacing with Pascal & C”
  • 6. Age 32: Publish “Using C++” Join ANSI C++ Committee Later: “C++ Inside & Out”, “Black-Belt C++” (edited), “Thinking in C++” Java: “easy translation from C++” Actually took two years Thinking in Python Research mode now, web page with notes at www.BruceEckel.com The other books and languages wrapped around me like Jacob Marley’s chains…
  • 7. 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
  • 8. Top 10 Reasons Why I Love Python
  • 9. 10. Reduced Clutter Programs are read more than they are written XP: Consistent formatting really is important Readability and compactness Part of “conservation of complexity” Consistent use of programming idioms improves understandability Rapid understanding The opposite of “more than one way to do it”
  • 10. 9. It’s not backward-compatible in exchange for pain C++: Backward compatible with C – its strength and its bane Java: more or less with C++ syntax (not too bad, but a lot of typing) Perl: compatible with every hacky syntax of every Unix tool ever invented C# and .NET: backward compatible with previous Microsoft marketing campaigns Javascript: not even compatible with itself
  • 11. 8. 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 (extension) for speed
  • 12. 7. 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” “Java has an open development process”
  • 13. 6. I don’t wait forever for a full implementation of the language Some features we invented in the C++ committee are still not implemented Unused features don’t get tested; circular problem Many C++ vendors say “it’s hard, and no one’s asking for it.”
  • 14. 5. It doesn’t make assumptions about how we discover errors Is strong 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 (More about this later) Errors discovered with real data seem to me to be the hardest to find
  • 15. 4. Marketing people are not involved “Java is flawless” Microsoft “Visual” “C++” Microsoft happens Of course, Python isn’t immune
  • 16. 3. I don’t have to type so much … And I don’t have to wade through so much code when I’m reading Conservation of complexity: simplicity really does make a difference But the right typing Not obscure like APL Not endlessly inventive like Perl or FORTH
  • 17. 2. My guesses are usually right I still have to look up how to open a file every time I do it in Java In fact, 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
  • 18. 1. Python lets me focus on concepts No stumbling through Java designs, fighting with C++ compilations or run-time bugs.
  • 19. Python and “The Tipping Point” Email: possible to carry on dozens of conversations by paper mail, but you don’t. Automating Everything: Possible to write programs to automate every task. But you don’t. Python makes it easy enough Great with Gnu make (my CD build system)
  • 20. Weak 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') “ Weak” sounds bad
  • 21. Weak 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;one&quot;), b(&quot;two&quot;) cout << sum<string, string, string>(a, b) << endl; cout << sum<int, int, int>(1, 2) << endl; }
  • 22. Weak Typing in Java Reflection, possibly with interfaces
  • 23. 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 WeakTyping { 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); } }
  • 24. Why weak typing isn't weak Upcasting becomes meaningless You write what you want to do, let Python worry about how Argument against weak 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
  • 25. Performance issues Machine performance vs. Programmer Performance Most of the time, which is really more important? C++ is naturally faster -- or is it? with IOStreams, not always
  • 26. Future Impact Programmer productivity is the most important thing Python excels at rapid creation of maintainable code To increase performance, throw hardware at the problem Multiprocessor machines & stackless Seems like an important direction, even to the point of justifying core language changes
  • 27. Other Languages C# bores me. Removes the interesting/useful features of both Java & C++. I’d use one of those languages first. Ruby. I’ll wait and see, but my impression is that it doesn’t do more for me than Python (or not more enough).
  • 28. NerdsOnBicycles.com On the New Zealand bike trip, Bill Venners & I decided it would be a good idea to host technically-themed bike tours Run by a professional company with all the amenities, the “sag wagon” etc. We thought a Python-themed trip might be an interesting beginning Grand Tetons? Send email if interested
  • 29. Life is Short (You Need Python) OR: No Warrantee Not Fit for Any Particular Purpose (You Need Python)