Live data from Hacker News

Python 2 vs. Python 3: A retrospective

dropbox.com

1–10 of 113 posts

Re: Python 2 vs. Python 3: A retrospective

#7
post #5

Now that I get to use Go, I have no desire to go back to python. I think I'm not alone, and that python will soon enough become the new perl.

Python was never the right answer for the cases Go solves (OCaml was a better choice 5-10 years ago, and nowadays there are plenty of options). But it's still the best language around for where you just need to write a one-off script as quickly as possible (in that sense it's always been the new perl).

Re: Python 2 vs. Python 3: A retrospective

#8
The one thing I wish they could change in the future is forcing list and dictionary iterable same syntax:

instead of writing

for index, element in enumerate(some_list)

for key, value in my_dict.items()

they should unify and make items and enumerate default behavior. i.e.

for index, element in my_list:

for key, value in my_dict:

I really don't see the benefit of not doing this as default behavior. I always find if I need to loop a list there is a good chance the index can help, and even if I don't need it it doesn't hurt to have one either. Simple is better. And the whole looping dict and get back the key only sucks too because you often need the value as well so you essentially do dict["key"] but why not just default return both key and value?

Re: Python 2 vs. Python 3: A retrospective

#9
post #7
post #5

Now that I get to use Go, I have no desire to go back to python. I think I'm not alone, and that python will soon enough become the new perl.

Python was never the right answer for the cases Go solves (OCaml was a better choice 5-10 years ago, and nowadays there are plenty of options). But it's still the best language around for where you just need to write a one-off script as quickly as possible (in that sense it's always been the new perl).

For a one-off script I still prefer Perl. But where I run into Python more is scientific computing. It seems to be making inroads into areas that previously would've only used Matlab. Haven't seen any Go in that area yet. Of the new entrants, Julia seems to be building buzz.

Re: Python 2 vs. Python 3: A retrospective

#10
post #5

Now that I get to use Go, I have no desire to go back to python. I think I'm not alone, and that python will soon enough become the new perl.

Python should not directly compete with go. A sure sign of an inexperienced dev is "why I moved from Lang x to Lang y". You should use and know multiple languages, and know where they fit in. That said, for a lot of cases I think Go steps in where python comes up short, which is definitely performance and concurrency. But if I'm doing something that's too complicated to fit easily in a shell script, but doesn't warrant a lot of time, the brevity of python wins every time.
Post reply on HN