41 comments

[ 5.5 ms ] story [ 99.7 ms ] thread
This is definitely a very soft introduction for beginners to both Python and programming in my opinion. I didn't go past the first two exercise groups.

I would omit the remarks at the beginning about 2 vs. 3 compatibility. Not only is it wrong as an absolute, it doesn't add value to the tutorials. The audience this is appropriate for is unlikely to care or even understand. Simply link directly to the Python 3 version to download.

I recently went through Learn Python the Hard Way (which is currently all written for 2.7), then enrolled in a intro python class at the city college that's all python3. The transition was a bit of a struggle; would have preferred to skip LPTHW for something written for py3+.
https://learnpythonthehardway.org/python3/

Just received an email the other day about the alpha.

This has been my biggest problem with suggesting LPTHW to people. Not just that it was Python2 oriented, but that it was explicitly opposed to Python3.

I'm glad they're finally moving on to Python3.

> I do not recommend Python 3 to any beginner due to serious issues with the design of strings, destruction of dynamic typing in strings vs. bytes, ...

He still doesn't seem to be a fan of Python 3. Not sure if it's a good idea to write a book about a language that you don't like..

It seems like he does not like programming in general:

> I've been programming for a very long time. So long that it's incredibly boring to me. [...] Programming as a profession is only moderately interesting. It can be a good job, but you could make about the same money and be happier running a fast food joint.

This is the biggest problem I have with any of Zed's content. To me it feels like he is saying "learning this stuff is fucking useless. Get a job running a KFC as programming sucks". I mean for God sake how patronising. If I want to learn something I don't need to be told it's pointless and to rub a fast food joint. I really dislike his attitude. Also I hate his "I can't be arsed to explain this bit as I'm bored of teaching you so Google for x y z and read about it yourself. "
It seems he doesn't like anything in general. Good resource, but the hardest thing about getting through LPTHW is reading it.
I love how the Python community subtly works promotion of Python 3 into every single discussion
I love how the Apple community subtly works promotion of the latest iPhone in every single discussion
moreover, Python3 is not the problem, it's the fact that it coexists with Python 2 that is.
(comment deleted)
I'd argue that this isn't especially "for beginners". I know I'm a special case, but you cover more concepts in 18 exercises than I cover in my entire first book (Learn Java the Hard Way; 58 exercises and 250 pages).

Maybe people who already know how to code in other languages but are just trying to Learn Python?

I'd argue a book isn't really comparable to a website, if done correctly. A book needs to be self sufficient. Websites can move faster and suppliment with googling
true but few books are awesome like Python Programming by Mark Lutz ((I forgot author's exact surname, sorry)
Affiliate links pretending to be a useful site. No "About Us" on the site and Whois information blocked by 3rd party service. So much web noise making a fast buck instead of producing a real product or service.
Not to mention what was probably an expensive domain name.

It definitely seems shady to me.

I spent a lot of time making the exercises. Nothing shady :)
Sorry to cast doubt. I forget what it's like for people that don't do this professionally; I could have created all those assignments in 10 hours, tops because that's what I've done for a living for the past 19+ years.

Good luck.

Still not shady if it helps others to learn Python. I don't have an issue that someone gets money for providing tutorials online. And maybe there's a reason why he doesn't want to find his name on Google.

Whois protection makes sense anyway, the amount of spam you get after registering a website is incredible. IMHO it's worth spending $2/yr for that service.

Seems very short on explanation. I believe that "How to Think Like a Computer Scientist" (http://interactivepython.org/runestone/static/thinkcspy/toc....) gives better explanation plus allows testing code in the browser.
Thanks for sharing this. I am currently learning Python and this is my approach:

[1] Work through Learn Python The Hard Way (both online and the book) [2] Build an AI Agent to Solve Raven's Progressive Matrices

Focusing on these two things only provides the knowledge and practice necessary to learn and implement I believe. Obviously, I just started so maybe I'll provide an update once I get along further months from now.

One is left with very little doubt about the quality of such resources, when you see examples like [0]:

  def sum(list):
      sum = 0
      for l in list:
          sum = sum + l
      return sum

  mylist = [1,2,3,4,5]
  print(sum(mylist))
Hint: Observe the name of (1) the function, (2) the parameter therein.

[0] http://askpython.com/functions/

What's wrong with that
They're shadowing builtins. Python's list type can't be referenced by its name in the defined sum function and Python's sum function can't be used in or after the new function's definition.

One could argue that in a source meant to teach Python, it shouldn't use examples that don't follow best practices. I feel that as a resource to, from the page, "learn how to write code, the basics and see examples" that it doesn't really matter too much.

I learned to program in PHP and builtins tripped me up a LOT as a new programmer. Talk about wrapping your head around some things when you're brand new.
I thought GP's issue was that the function is shadowing itself within itself, which I think is worse than shadowing a builtin with a similar function.
I had completely missed that one. That is pretty bad and confusing.
And using "list", which IIRC is a reserved keyword
This kind of thing leads to many "wait, what?" moments... confusing and aggravating to someone just learning syntax.
(comment deleted)
I agree that the choice of names is unfortunate. Still I think it's permissible in example code to redefine functions with your own implementation. At this point shadowing built-ins is unlikely to confuse anybody.
Learning things is fun. Having to unlearn things seldom is. This set bad habits in a discipline where a lot is muscle memory. I don't think it's a good idea.

Furthermore, I tried hard to ignore the glaring similarities between this and Zed Shaw's "Learn Python the Hard Way" from the way the course is structured down to some expressions.

This would have been cool if it at least mentioned the course on the right side pane with the other recommendations.

I recently failed a Google interview. I used Python. I believe I did solve the problem, but my code might have been the deciding factor in rejecting me. My code looked similar to this. For example, I implemented my own `min`. Which did a O(N) walk of the array. Probably a horrible choice on my end. Looking back I should have used more builtins.
For a company that takes around two months to review your profile and/or compare it with other candidates (or whatever they do during that time) I expect less arrogance during these code challenges because I am yet to find a developer who can write code like a robot.
What do you mean arrogance?
Nitpick: The built-in min() is also O(n) on the length of the array, though it will be a bit faster as a built-in C function.

You're probably right that you shouldn't have reimplemented it though - knowing how to use the language and its standard library is a good indicator for real-word experience.

This was for a new grad role though. I'm just about to get out of college. Looking back , I really fucked up by not using Pythonic style. The only reason I chose python is because of it's string handling capabilities, etc as opposed to C - where I'd have to implement boiler plate stuff most likely, and worry about resizing arrays, etc.
(comment deleted)
I started learning python mostly by going through Google lectures by Nick Parlante:

https://developers.google.com/edu/python/

Google Code Jam is very helpful if you like algorithmic programming.

One of the nicest things about python is rich libraries for daily mundane GUI automation: pyautogui, pyhooks, pywinauto, sikuli, etc.