Live data from Hacker News

The Case Against Python 3

learnpythonthehardway.org

61–70 of 281 posts

Re: The Case Against Python 3

#61

Howdy Zed, there's a small typo in your printf statement. As written, x = 'Zed' print f"Howdy {x}" Should read, x = 'Zed' printf "Howdy {x}" I was under the suspicion that, "f" was some sort of operator or something, much like q is for Perl, print q{Howdy Zend};

nope it should be

print(f"Howdy {x}")

It's a new python 3.6 feature called f-strings/string interpolation

https://docs.python.org/3.6/reference/lexical_analysis.html#...

That said in python3 print is a function not a statement and requires parenthesis so he still has a typo.

Re: The Case Against Python 3

#62
I run Repl.it (https://repl.it) and I have an interesting stat. Python3 has been loaded 3.6x more times than Python2 (500k vs 140k) just in November, and it's been used in 5x more classrooms (https://repl.it/classroom).

* two caveats:

- we have Python3 listed on the languages page whereas you'd have to click around or search to get to Python2.

- we have slightly more features on Python3 like live pylint and ability to use modules

Re: The Case Against Python 3

#63
Wow, this guy seems really pissed off.

But I must admit, it is nice having all those python developers distracted by working on another language and leaving 2.7 in its current state of perfection. I wonder if this has actually helped increased the use of 2.7, not having endless "improvements" tacked on. It sounds like this could be one of those weird laws of the computer age. I dub thee "Shaw's Law".

Re: The Case Against Python 3

#65
post #5

On the other hand, I never suggest Learn Python The Hard Way or Codecademy to any new programmer, because I don't want them to ask me down the line "why you directed me to an obsolete Python course?". I think I'm not the only one. So I'm not sure what's the net result of those decisions made by the two sites, do they really help in keeping Python 2 alive?

FWIW, I do recommend Zed's book. Many, many people have benefitted from Python The Hard Way.

I have too, but I learned Python in a time where learning Python 2 was still politically correct.

Re: The Case Against Python 3

#66
I honestly don't get how this is still even an issue, if you're stuck with libraries that haven't been migrated to Python 3.x you have my sympathy - but I have had 0 need to touch any Python 2.x code in over 3 years - in fact, all of the Python code I have deployed at work is Python 3.x only.

Python 3 is a non-issue in my eyes, the only reason I don't use it more is because there's only one other developer on my team that knows Python well enough to maintain anything if I get hit by a bus - Python is "weird" for everyone else because we're mostly a .Net shop, so unless I'm writing an ansible module I use Kotlin and Spring-Boot or ASP.NET so my team can easily pick it up in the "snuxoll gets hit by a bus" scenario.

Re: The Case Against Python 3

#67
> The strings in Python 3 are very difficult to use for beginners. In an attempt to make their strings more "international" they turned them into difficult to use types with poor error messages. Every time you attempt to deal with characters in your programs you'll have to understand the difference between byte sequences and Unicode strings.

The author has this exactly backwards. It is Python2 that makes the weird distinction between the string and the unicode type. Strings (and bytes) in Python3 are done (almost) right. (I say "almost" because Python bytes are constrained to be 8-bits wide, but that is not a serious problem.)

He also clearly doesn't understand Turing-completeness.

Re: The Case Against Python 3

#68
post #54

"It's sad to watch Python destroy itself because it's such a great language, but that seems to be where things are headed." The author has a point here. I've been programming Python for about 10 years now. Really concerned about the future of the language. Languages like Node and Go are progressing rapidly, but what's happening to Python? I used to complain about Node, but with the latest ES6/ES7 improvements it's ac…

Node is an interpreter for the v8 JavaScript engine and it uses a language named JavaScript. There isn't a language named node :) I've done Python about as long as you but also like Golang for things Python is awful at.

Javascript is a colloquial name for what is formally known as ECMAScript. There isn't a language named JavaScript :)

Re: The Case Against Python 3

#69
post #3

Python was one of the first languages I've tried I actually enjoyed programming in. I hope to continue leveraging my investment in learning python by using it for a long time. So far I haven't been forced to use Python 3. I've tried a few times but always found it easier to just go back to python (2.7). I figure eventually I have to use Python 3 but at this point, my life has been fine without upgrading to python3.

I think Python is amazing to get small stuff ip and running and quick scripts, but it quickly becomes a nightmare as the project scales up.

Why would you say that? The main Python project I work on is 271k LOC... no problems here.

Re: The Case Against Python 3

#70
post #3

Python was one of the first languages I've tried I actually enjoyed programming in. I hope to continue leveraging my investment in learning python by using it for a long time. So far I haven't been forced to use Python 3. I've tried a few times but always found it easier to just go back to python (2.7). I figure eventually I have to use Python 3 but at this point, my life has been fine without upgrading to python3.

What did you find difficult about Python 3?

I switched around 3.1, though granted I was still a novice programmer then and didn't have to port any legacy code. I had so many issues with Unicode in Python 2 (some may have been my own ignorance at the time, but with 3 a lot of those issues magically disappeared). Since text processing / NLP is my main focus, it was an easy decision to switch.

Post reply on HN