I remember hating the whitespace thing so much when I started with Python circa 2.4, but have really come to love the language in a lot of domains since then. A huge, huge "thank you" to Mr. van Rossum for creating this quirky language that I've become so fond of and for the countless hours of his life he's given to the project.
from __future__ import braces I hated the white-space thing until I discovered that. For whatever reason this made me get over myself and learn to love the tab/space argument that is somewhat akin to the vi/emacs argument.
Python has brought computer programming to a vast new audience
31–40 of 268 posts
Re: Python has brought computer programming to a vast new audience
#32It's syntactically concise because of its use of whitespace and indentation instead of curly braces.
Expressions are often concise because of things like list slicing and list expressions.
It can be linguistically concise, because it is so easy to fiddle with the data model of your classes, to customize their behavior at a deeper level. For example, it is so quick to design a suite of classes that have algebraic operators, which leads to elegant mathematical expressions of your custom GUI objects for example. But you can also change the way classes are instantiated by overriding Class.__new__ which I've used to make powerful libraries that are a joy to use.
Further elegance can be added through creative use of the flexible argument passing machinery, and the lovely way that functions are also objects.
Your application architecture tends to be concise because there are so many existing libraries, you can often design your application at a more interesting higher level. For example, you don't have to worry about the size of int's.
My big regret with Python 3.0 is that the scoping rules in list expressions changed to prohibit modification of variables in surrounding scope. This degraded the utility of list expressions. The work around is so long-winded.
Besides the odd gripe here and there, the language really gives me a warm glow.
Re: Python has brought computer programming to a vast new audience
#33Earlier quoted context omitted.
Can you explain implicit type conversions problems in python?
bools can be silently converted to int. 1 + true is ok, but 1 + "true" throws. Sometimes you do want to do math on bools, but it would avoid a class of errors if they would make you wrap them in 'int(the_boolean_variable)'.
Can you provide a concrete example for when this would be useful? I assume you're not talking about binary arithmetic.
Re: Python has brought computer programming to a vast new audience
#34Meh.. try Perl.
I was in the pedantic "meaningful whitespace is evil" camp back then, so I avoided Python. Then I got an internship in a house that used Python. That forced me to give Python a real try and I got over the whitespace thing... I learned that for all intents and purposes this language I had been scoffing was a better tool for many of my usual Perl use cases and more thanks to its extensive standard library.
Re: Python has brought computer programming to a vast new audience
#35Python is a great language to start programming in. My biggest frustration with traditional programming languages (well, C/Java mostly) was just how much upfront effort and understand is required to do useful stuff. Whereas with python it is pretty easy to whip up a script, read input and transform it into output in real time etc. That said, I think its also important for Python programmers to dabble at least a littl…
Other than interfaces and generics (which would make no sense to add in Python, since it's dynamically typed), can you name some OOP features Java has that Python doesn't have?
Encapsulation. In Python you can write code in an OO style and benefit from inheritance, but it’s really only good for people writing libraries and frameworks. For end user code, objects are best avoided because they can pick up state in unexpected ways, which leads to problems that are extremely difficult to debug.
Re: Python has brought computer programming to a vast new audience
#36Re: Python has brought computer programming to a vast new audience
#37The thing I love most about the language is its conciseness, on several levels. It's syntactically concise because of its use of whitespace and indentation instead of curly braces. Expressions are often concise because of things like list slicing and list expressions. It can be linguistically concise, because it is so easy to fiddle with the data model of your classes, to customize their behavior at a deeper level. F…
Can you elaborate? I'm not sure what this is referring to.
Re: Python has brought computer programming to a vast new audience
#38Re: Python has brought computer programming to a vast new audience
#39The thing I love most about the language is its conciseness, on several levels. It's syntactically concise because of its use of whitespace and indentation instead of curly braces. Expressions are often concise because of things like list slicing and list expressions. It can be linguistically concise, because it is so easy to fiddle with the data model of your classes, to customize their behavior at a deeper level. F…
That's a perfect summary of my feeling towards it, too. If the PSF puts up a GoFundMe for sending Guido on a nice vacation of his choosing, I will be happy to chip in a few bucks. Same goes for Linus when he hands over the reins, and a few other maintainers who probably cannot be adequately compensated for the impact of their work.
Re: Python has brought computer programming to a vast new audience
#40It goes to show: something doesn't need to be actually-better. It doesn't need to be actually-simpler. It doesn't need to make your job easier or better. It needs to make people think it does that.
Python is not, in any way, revolutionary. Several contemporaries exist with similar design constraints. But Python persists because it's created a community that considers itself hygienic for avoiding any other aspect of programming. And by doing this, it can be superlative in any aspect it wants to be. It simply conjures the worst example from any given competitor and those are, by proxy, pushed onto all of them.
Did we see a glowing review of how Javascript did this? No. Javascript, despite being the most deployed programming environment family in human history, didn't do this. Python did. Because it says so, over and over.
Even if you disagree with that assessment, I think Python has had a lot less to do with pushing python to new audiences. Its community has projected it outward with an impressive degree of vigor over the years, forcing it on more and more people.