Live data from Hacker News

Why We Choose Python

sixfeetup.com

51–60 of 62 posts

Re: Why We Choose Python

#51

I can vouch for 'easy to learn': if you can already program in another language, learning Python is like being reintroduced to an old friend who has grown up quite a bit since you last met him.

I found the opposite. For example, I find it extraordinarily frustrating not to be able to know what kind of object something is by looking at the point in code where it is created; something like variable = somefunction(inputParameter) where variable did not exist before leaves me having to look up the documentation of somefunction to know what kind of object it is returning.

The secret is not to care and just hack away.

Re: Why We Choose Python

#52

It would be strange if this guy had anything negative to say about Python since "Should you need assistance with your Python project, we'll be happy to help through a variety of professional services."

Why would you need assistance when "Python is easy to learn and use"?

Re: Why We Choose Python

#53

I love Python, but it's a rubbish article I regret to have upvoted. > Python is robust This paragraph does not feature a word about robustness. There are mentions of speed and scalability and some sort of benchmark showing a case where Python is faster than Ruby or PHP. Conclusion: "It's also very fast". The rest is less terrible but does not mention any of Python's shortcomings.

Are there any widely-used languages that aren't robust? That seems like kind of shallow praise.

Depends what you call robust. If you mean "strongly typed", PHP and Javascript come to mind immediately.

Re: Why We Choose Python

#54

I can vouch for 'easy to learn': if you can already program in another language, learning Python is like being reintroduced to an old friend who has grown up quite a bit since you last met him.

I found the opposite. For example, I find it extraordinarily frustrating not to be able to know what kind of object something is by looking at the point in code where it is created; something like variable = somefunction(inputParameter) where variable did not exist before leaves me having to look up the documentation of somefunction to know what kind of object it is returning.

Well, you'll hate it, but even after you discover what is the class of your object, you'll still have no idea what methods it implements, and what attributes it has. In Python any of that can (and do) change.

Sometimes that is frustating. I suffered a lot until I understood the Django's forms API. But this feature is worth the cost.

Re: Why We Choose Python

#55

Earlier quoted context omitted.

Are there any widely-used languages that aren't robust? That seems like kind of shallow praise.

Depends what you call robust. If you mean "strongly typed", PHP and Javascript come to mind immediately.

By robust, I mean the language/compiler has a strong test suite and the runtime is known to work reliably in production settings. I've heard horror stories about Sun's HotSpot JIT crashing frequently, but that was what, 10 or 20 years ago? Now that I think about it, Scala might be a modern example of that, but I haven't kept up with how they might have improved.

Re: Why We Choose Python

#56
I just came here to praise python and hate on php, because that seems to be the popular thing to do. But I do like the idea of it being functional pseudocode, because my pseudocode usually starts approximating the syntax of the language, with progressively more erase marks and crossed statements due to getting a bracket wrong, or some other minor problem.

Note: Yes, I write source code on paper. Alot.

Re: Why We Choose Python

#57
I once joined a project that had been going on for 5 years with >100K lines of Python. At any given time we had more than 25 programmers. In my two years on the project I never had a problem reading someone else's code - it was great for maintainability. Our project was used by hundreds of engineers on a critical path of a multi-billion dollar project. Anyone who thinks Python doesn't work for serious development doesn't know what they're talking about.

Re: Why We Choose Python

#59

I can vouch for 'easy to learn': if you can already program in another language, learning Python is like being reintroduced to an old friend who has grown up quite a bit since you last met him.

I found the opposite. For example, I find it extraordinarily frustrating not to be able to know what kind of object something is by looking at the point in code where it is created; something like variable = somefunction(inputParameter) where variable did not exist before leaves me having to look up the documentation of somefunction to know what kind of object it is returning.

Documentation? We don't need no stinking documentation!

Try this variant:

    variable = somefunction(inputParameter)
    # the next line is a temporary debug statement
    print "variable has the following attributes:", dir(variable)
Or this one:

    variable = somefunction(inputParameter)
    help(variable)      # temporary debugging statement
Or this one:

    help(somefunction)
Or even this:

    variable = somefunction(inputParameter)
    print "the type is", type(variable)      # temporary debugging statement
A lot of API's use built-in objects, so quite often you don't even need anything more complicated than:

    variable = somefunction(inputParameter)
    print "variable is", variable
Using a Python-aware IDE like Eclipse PyDev might help too, but it's been a while since I've personally used it so I can't say off the top of my head what feature you want. Honestly, Python is so easy to use, you don't really need an IDE at all (of course this is just my opinion on something that's purely a matter of personal taste).

Re: Why We Choose Python

#60

Earlier quoted context omitted.

Depends what you call robust. If you mean "strongly typed", PHP and Javascript come to mind immediately.

By robust, I mean the language/compiler has a strong test suite and the runtime is known to work reliably in production settings. I've heard horror stories about Sun's HotSpot JIT crashing frequently, but that was what, 10 or 20 years ago? Now that I think about it, Scala might be a modern example of that, but I haven't kept up with how they might have improved.

In this case, yes, real-world languages have a solid runtime/compiler. Though I'm surprised you have issues with Scala, at least the runtime part should be rock solid, given that it runs on a very much battle-tested JVM.
Post reply on HN