Live data from Hacker News

Python has brought computer programming to a vast new audience

economist.com

181–190 of 268 posts

Re: Python has brought computer programming to a vast new audience

#181
post #153

Earlier quoted context omitted.

Right, they're even better than Interfaces: both a contract and a partial implementation. No need for an "Interface" when you've got ABCs.

I see what you mean, but to me abstract classes are distinct from interfaces. Abstract class answers the question "what an object is?", whereas an interface is about what the object can do.

That distinction is unnecessary.

Re: Python has brought computer programming to a vast new audience

#183
post #178

Someone else said this on HN: Python is the second best language in almost every field of computing. That's why there's a library for everything in Python. It's limitations are also not terrible for most people. If you want super fast, you will know how to do that some other way. If you just want simple and easy to read, you use Python.

> Someone else said this on HN: Python is the second best language in almost every field of computing. It isn't. Frankly, it isn't even top 3 in any "field of computing" depending on how you define "field of computing". What python has going for it is the evangelists who do a great job of spreading the word and of course funding - they have lots of money backing the language. Also, being an interpreted language, it h…

"My hope is that python will serve as a "gateway drug" to other languages like ruby, ML, C/C++, SQL"

Your inclusion of SQL in that list really shows you have no idea what you're talking about.

Re: Python has brought computer programming to a vast new audience

#184
post #15

Python 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…

I don't think Java's take on OOP is good to learn before you really understand OOP already. Its heavy handed style of OOP really hasn't aged that well and is rightfully being avoided in all newer languages.

I couldn't agree more. I don't know how to explain it exactly, but I had the opposite experience. Learning basics of functional programming in Python improved my OOP in Java over time.

I think it's probably more like this: learning a second, contrasting topic really helps explore the motivations that drive their respective goals.

OOP and Functional are broad classes of contrasting design patterns and philosophies but share the common idea: be principled about state.

Re: Python has brought computer programming to a vast new audience

#185
post #163
post #44

Earlier quoted context omitted.

In all this time I didn’t even know python uses reference counting instead of tracing gc...

It also uses mark-and-sweep. a = [] a.append(a) Can't collect that one with ref counting.

Weird. :)

Re: Python has brought computer programming to a vast new audience

#186
post #158

Earlier quoted context omitted.

Listen to how people who don't program describe the task of transforming each element of something. In my experience they often say something along the lines of, "I want y for each x in z," rather than, "For each x in z, I want y." The latter is more common among people who've been programming in certain languages, not the average person. I don't have systematic data collection for this, just personal experience. But…

> Listen to how people who don't program describe the task of transforming each element of something. In my experience they often say something along the lines of, "I want y for each x in z," rather than, "For each x in z, I want y." If we're really at the point where we're arguing between which clause order (among other potential variations in expression) is more natural across most natural language speakers, that s…

> empirically verifiable

I'd love to see the data.

> software ... built by people ... off the street

Programming is such a rapidly growing field that I think the majority of software will be written by programmers with less than 1 year experience. For a time, anyway. Maybe in 20 or 30 years the growth will slow.

Re: Python has brought computer programming to a vast new audience

#187
post #52

Earlier quoted context omitted.

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?

This may sound super n00b but I really like that Java is explicit about everything. So for instance, you explicitly specify variables, methods as private with the keyword 'private'. In python you have to use an underscore, and its still not really private, its obfuscated. That's just one example, but in general I really like that kind of by-the-book verbosity, instead of having to mentally map it into the OOP concept…

Check out Ada.

Re: Python has brought computer programming to a vast new audience

#188
post #52

Earlier quoted context omitted.

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?

This may sound super n00b but I really like that Java is explicit about everything. So for instance, you explicitly specify variables, methods as private with the keyword 'private'. In python you have to use an underscore, and its still not really private, its obfuscated. That's just one example, but in general I really like that kind of by-the-book verbosity, instead of having to mentally map it into the OOP concept…

I'm less concerned with encapsulation, but the explicitness is a godsend the larger your codebase or team.

Python keeps code much smaller but above a certain size I wish I could "promote" parts of my code to Java.

Partial typing in Python just isn't close to feeling the same.

Re: Python has brought computer programming to a vast new audience

#189
post #178

Someone else said this on HN: Python is the second best language in almost every field of computing. That's why there's a library for everything in Python. It's limitations are also not terrible for most people. If you want super fast, you will know how to do that some other way. If you just want simple and easy to read, you use Python.

> Someone else said this on HN: Python is the second best language in almost every field of computing. It isn't. Frankly, it isn't even top 3 in any "field of computing" depending on how you define "field of computing". What python has going for it is the evangelists who do a great job of spreading the word and of course funding - they have lots of money backing the language. Also, being an interpreted language, it h…

Some people have good taste for technologies and others do not.

Re: Python has brought computer programming to a vast new audience

#190
post #86
post #52

Earlier quoted context omitted.

This may sound super n00b but I really like that Java is explicit about everything. So for instance, you explicitly specify variables, methods as private with the keyword 'private'. In python you have to use an underscore, and its still not really private, its obfuscated. That's just one example, but in general I really like that kind of by-the-book verbosity, instead of having to mentally map it into the OOP concept…

Why would you want to actually enforce privacy? That makes it harder for the user to patch. Better to provide a mild discouragement via "_name".

The obvious usage of privacy is so you don't expose an API you don't want to maintain. It's also occasionally used to maintain some invariants; for instance, you can have a public method that wraps around some protected interface that does input checking/clean up. Having the compiler enforcing privacy, in this case, guarantees that whatever actual method you dynamically dispatches to has the "right" input (accidentally calling the interface directly won't compile).
Post reply on HN