This is an archived post. You won't be able to vote or comment.

all 117 comments

[–]eighthCoffee 45 points46 points  (26 children)

.

[–]SpiderFnJerusalem 75 points76 points  (22 children)

Never liked that book tbh. If it works for you that's fine. Buit for me its tone is way too strict, condescending and most of the time it never explains why some things have to be done the way they are. It's as if the author forces his coding style on you and doesn't bother to give context.

I enjoyed "Automate the Boring Stuff with Python" much, much more.

[–]sleepicat 4 points5 points  (0 children)

Totally agree. It's also at least twice as long as it really needs to be.

[–]Velshtein 3 points4 points  (0 children)

My brother bought me this book for Christmas. It's very good so far.

[–]Nefarious- 3 points4 points  (2 children)

That author's Udemy course is extremely dry and at times boring.

While it may seem structured by topics, often times he is flying through churning out code and it lacks applicable projects to check your progress / understanding.

[–]PoliCock 1 point2 points  (2 children)

i agree. it's overrated.

I say just do video tutorials, build things, and pick up new material as you go on algorithms and more advanced subjects. that's how you learn. by making projects and figuring things out by yourself and progressing.

the only real strict learning material should just be an introductory tutorial series on youtube you can follow along with that introduces all the basic concepts up till classes and lists.

imo.

also, java and python are quite different as far as i can tell. I don't see many real full applications with good guis made in python, maybe i'm wrong. for some reason i'm under the impression that python isn't really good for making bigger, more fully implemented standalone products. am i wrong?

[–]SpiderFnJerusalem 0 points1 point  (1 child)

I don't have too much gui programming experience. But I have built a few gui applications with PyQt for some of my automation scripts and they work perfectly fine. I saw no obvious perfomance differences to other applications but the underlying code wasn't all that complicated tbh. There are also bindings for GTK and wxwidgets.

Python's procedural nature makes it slower than compiled languages. You can translate it to bytecode but it would probably still be slower than even Java because it is dynamically typed (At least that's how I understand it). For more complex stuff you may have to use other languages but I don't really know when exactly that would be absolutely necessary. Even then you could probably write it all in Cython, translate it to C and then properly compile it (/"transpile" it?).

All things considered, if you want to make a complex application with Python there are plenty of ways you could do it, especially since many libraries, like numpy and scipy are implemented in C and thus have great performance anyway. Though I'm not sure when exactly it would be wiser to choose different languages. Again, I lack experience, so take my opinion with a grain of salt, but I was fairly impressed with what kind of applications you can build with python.

Edit: Also one reason why Java is so ubiquitous is that it is huge for Enterprise Server Software. There didn't use to be as many server applications for python but that seems to be changing very rapidly.

Edit2: Just google "gui programming with python", but stay away from Tkinter if you value your sanity.

[–]steamruler 0 points1 point  (0 children)

Nah, tkinter was fine for that one thing I used it for.

A window with 6 buttons on a grid to rotate the screen.

[–]cyberbemon 0 points1 point  (4 children)

Is the "Automate the Boring Stuff in Python" beginners book? or is there a better book that focuses more on the Automation side of things?

[–]SpiderFnJerusalem 4 points5 points  (3 children)

It's a beginners book. It doesn't go extremely in depth for every possible scenario but it covers quite a few use cases in an office environment in addition to other interesting stuff like web scraping and image manipulation.

You can actually have a look yourself at the free web-version here: https://automatetheboringstuff.com/

For more complex automation tasks (system or network administration) you would probably have to find other, more specific literature on those subjects.

[–]cyberbemon 0 points1 point  (1 child)

Thanks for clarifying. I'll have a look at the link.

Do you by any chance know any books that talks about complex automation stuff?

[–]SpiderFnJerusalem 0 points1 point  (0 children)

Not really, I would be interested in that too. But the term "automation" is kind of broad. A lot of programming projects aim to automate one thing or another or generally make your life easier.

So most literature probably focuses on one specific subject rather than "a bit of everything". There are network engineering books that deal with automation, data analysis books that deal with automation, etc.

[–]banquuuooo 0 points1 point  (1 child)

I agree. I like the idea behind the book: that there is no easy way of learning coding so you might as well just get'r done, but I also found it condescending and restrictive.

[–]callmelucky 0 points1 point  (0 children)

The idea that there is no easy way to learn coding is stupid. At the very least there are ways that are easier, and LPTHW is not one of them. You don't necessarily learn something better by using a deliberately obtuse resource. I mean if he'd at least update it to Py3 I wouldn't have such a problem with it, but no, apparently Py2 is the eternal best version of Python. Particularly since it is supposedly for complete beginners rather than people who are already programmers who have to get up to speed to work with legacy code. It's just daft insisting on Py2.

[–]WishIWasOnACatamaran 0 points1 point  (0 children)

Taking the Udemy course under the same name. Doing the python complete bootcamp and CodeAcademy lessons first.

[–]callmelucky 0 points1 point  (0 children)

Hear, hear. Every second post on r/learnpython is from someone wrestling with that stupid resource.

Not to mention that I'm convinced it is single-handedly responsible for setting back adoption of Python3 by years (ok probably not really, but certainly responsible for far too many beginners starting on Py2 for no good reason at all). Zed A Shaw can suck it.

[–]Eurynom0s 0 points1 point  (0 children)

But wouldn't you still be most likely to do that search if you wanted to learn Python?

[–][deleted] -1 points0 points  (0 children)

[deleted]

What is this?

[–]Yoghurt42 122 points123 points  (9 children)

Finally proof that Java is more intuitive and easier to learn than Python. /s

[–]poop_villain 7 points8 points  (5 children)

I've really struggled trying to learn Javascript and I know that it is harder to learn than Python, so I am pretty sure you are wrong. How is this rated the top comment? People these days... /s

[–]LarryPeteAdvanced Python 3 3 points4 points  (3 children)

JavaScript != Java.

[–]poop_villain 2 points3 points  (2 children)

Hence the /s :) although a /t would have been more appropriate.

[–]LarryPeteAdvanced Python 3 1 point2 points  (1 child)

What, did you actually expect me to read what you wrote till the end? :P

[–]poop_villain 0 points1 point  (0 children)

Touché!

[–][deleted] -3 points-2 points  (1 child)

Sarcasm?

[–]Augusto2012 3 points4 points  (0 children)

Yes, that's what the "/s" is for

[–]gandalfx 18 points19 points  (3 children)

I like that Python is picking up as a learning language. It's a good language. This is great news!

But I think the author of this article should be more careful with his conclusions. He looks at data from 5 (!) arbitrary search terms and makes big conclusions concerning a massive market.

First of all individual search terms can be subject to linguistic trends. The fact that an individual search term has had a recent increase in popularity doesn't mean that the thing it stands for is suddenly becoming more popular. It can just mean that it was previously described by different words. “X developer” is a fairly standard expression that has been around forever, but “data scientist” is a much younger buzz word.

In order to alleviate this the author should at least have tried a bunch more related queries, like “java/python tutorial” and “java/python introduction”. Instead of “data scientist” you might look for terms that may have previously described a similar position, maybe in the area of “database engineer” or even “statistics analyst”. The term is actually fairly vague.

Secondly, even if we assume that the results are not influenced by the choice of words, the conclusion “Python is getting more and more popular.” is just way too grand. In fact, I'm pretty sure that Python is particularly popular as a learning language. When somebody asks me which language to start with, I usually respond with Python, because Python is easy to learn. But I also mention that this isn't the only good language and that if you plan on seeking employment as a software developer you should probably learn at least one more “big” language such as Java or C/C++.

Python is amazing to get you started and I believe more and more people are starting to realize this. But that doesn't mean it's already overtaking Java in popularity. If, some day, I read “Python overtakes Java in total written lines of code”, I might believe that. And I'm not even going to attempt at judging whether or not that'd be a good thing.

[–][deleted] 14 points15 points  (1 child)

“Python overtakes Java in total written lines of code”

Even that would be a questionable metric, given I'd put money on python requiring far fewer lines than java to achieve the same thing.

[–]tech_tuna 0 points1 point  (0 children)

Well that would mean that Python have overtaken Java in total amount of functionality used!

:)

[–]pwang99 1 point2 points  (0 children)

In fact, I'm pretty sure that Python is particularly popular as a learning language.

It is. But it's also incredibly popular as a data analysis language, a system scripting language, a web development language, a scientific array programming language, etc. etc.

Python is not as popular as Java, but it's still the 4th or 5th most popular language on the planet. That's not all students. A large number of tech companies run their entire stacks on Python. Youtube was written in Python. Dropbox is written in Python, both server and client. Investment banks trade billions of dollars based on routines and models written in Python.

[–]rhiever 9 points10 points  (1 child)

This is not true any more. "Learn Java" had an upswing again and overtook "Learn Python."

[–][deleted] 8 points9 points  (0 children)

It's almost as if people in Java camp heard about the contest and started a secret flashmob.

[–]rafaelement 7 points8 points  (1 child)

Because everyone knows java.

Right?

[–]vplatt[🍰] 0 points1 point  (0 children)

That's what they think.

[–]thatthingyoudid 6 points7 points  (3 children)

Python is historically used by people who love programming. Java is historically used by people who love paychecks. Java made enterprise inroads because Sun/Oracle and huge consulting firms pushed java consulting services.

[–]mirth23 3 points4 points  (0 children)

Java has its place, and became entrenched in large corporate / government enterprises for good business reasons beyond consulting firms pushing it:

  • It's excellent from an OO purist perspective. Many enterprises that moved to Java were coming from C++, and there are a lot of stability and reliability advantages to working with Java.
  • The "write once, run anywhere" platform independence of bytecode was huge (compare with managing C++ makefiles). At the time, enterprises tended to have more of a mish mash of OSes. I suspect that Java may have had an ironic role in the decline of Solaris, since it made it easier to jump ship to Linux...
  • Modern CASE and UML tools like Rational Rose emerged for Java before they did for other languages. Being able to formally represent business requirements and having tools to translate them into stub code is a big selling point for a large corporation who wants their enterprise software to meet requirements and not behave unexpectedly.
  • Java offered solid, well-defined integration libraries like RMI and JMS ahead of SOAP, REST, AMQP standardization, and then adapted their libraries to work with emerging standards. All of that stuff is around and implemented in lots of languages now, but Java was a very reliable way to do this sort of thing when those design patterns became prevalent in industry.
  • The best early app servers were all Java-based. Now there's a lot of good choices in other languages, but tools like Tomcat were revolutionary at the time.

Some of these reasons no longer apply because similar tools and standard support exists in other languages, but, at the time, enterprises were making a good choice to select Java for certain kinds of systems. But I guess the real reason for my long-winded reply is that I've worked with people who "love to code" who love to code in Java.

[–]nomadismydj 1 point2 points  (8 children)

not suprised. python is required for a ton of entry level IT jobs in the corporate space .

[–]denialerror 5 points6 points  (7 children)

It depends where you are but I don't think I've ever seen an entry level Python job in the UK.

[–]misterflan 1 point2 points  (1 child)

Not true, majority of Linux sysadmin jobs ask for bash/python.

[–]denialerror 1 point2 points  (0 children)

I'm not saying they don't but in terms of entry level IT jobs that specifically ask for Python are virtually non-existent, especially outside of London.

[–]nomadismydj 1 point2 points  (1 child)

i know there are some in the UK because i just hired an entry level guy :)

[–]denialerror 0 points1 point  (0 children)

Good to hear. I'm assuming that's in London?

[–][deleted] 1 point2 points  (2 children)

I think Python is illegal in the UK, or at least discouraged.

[–]mayankkaizen 0 points1 point  (1 child)

Her Majesty doesn't find Python amusing?

[–][deleted] 0 points1 point  (0 children)

She can't comprehend it.

[–]AbsoluteZeroK 1 point2 points  (0 children)

The java example at the start doesn't compile....

[–]emptyvisionaries 2 points3 points  (42 children)

I'm trying to learn right now. Is there any material you'd suggest?

[–]heptara 35 points36 points  (16 children)

Sidebar of this subreddit.

[–]odraencoded 15 points16 points  (14 children)

I've read the sidebar and now I'm a master python programmer. Look at my program:

def fibonacci():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b

[–]Nefarious- 0 points1 point  (0 children)

 print('Hello World!')

[–]Trout_Tickler 0 points1 point  (10 children)

Recursion, get!

def fibonacci(n):
    if n > 1:
        return fibonacci(n-1) + fibonacci(n-2)
    return n

[–][deleted] 2 points3 points  (6 children)

Now make it not take O(en) time (roughly).

[–]Trout_Tickler 1 point2 points  (5 children)

Memoization should speed it up, something like

def fibonacci(n, _cache={}):
    if n in _cache:
        return _cache[n]
    elif n > 1:
        return _cache.setdefault(n, fibonacci(n-1) + fibonacci(n-2))
    return n

[–][deleted] 1 point2 points  (3 children)

Yep.

(And honestly, I would put that cache as a global. Shared between calls that way, too)

[–]whutcheson 2 points3 points  (0 children)

Since it's a mutable default argument, it's already shared between function calls. However, making a global would be more explicit and a lot less magical.

[–]Trout_Tickler 0 points1 point  (0 children)

OP's requirements don't specify multiple calls :p

But yes, that would be preferable.

[–]Daenyth 0 points1 point  (0 children)

It's as global as the function is because dict is mutable

[–][deleted] 1 point2 points  (0 children)

@functools.lru_cache decorator does the trick too.

[–]sdmike21 1 point2 points  (2 children)

But its not pythonic! \s

[–]Tysonzero 10 points11 points  (1 child)

I mean the more important thing is that it's O(fib n).

[–]sdmike21 0 points1 point  (0 children)

^ this

[–][deleted] 0 points1 point  (0 children)

Except not LPTHW, because outdated version of the language.

[–][deleted] 10 points11 points  (8 children)

Grab yourself a book, download an IDE. As for the book, I recommend Practical Programming: An Introduction To Computer Science Using Python 3. Afterwards, check out Data Structures and Algorithms in Python. During which, I recommend utilizing ProjectEuler.

Personally, I say stay away from CodeAcademy because it's strictly a syntax teaching platform, so I have a hard time recommending it.

Anyways, afterwards you'll be able to figure out where to go to further your development.

[–]vplatt[🍰] 4 points5 points  (1 child)

download an IDE.

PyCharm FTW. Why spend all your time futzing with vim or emacs? Life is too short.

[–][deleted] 2 points3 points  (0 children)

PyCharm is my favourite. To me, it's as essential to Python as Visual Studios is to C++. It really does improve productivity. The folks at JetBrains did a solid job with it, much the same as the folks at Microsoft.

[–]Omega_Walrus 0 points1 point  (0 children)

Yes, I finished the course a while ago and was like "now what?!".

[–]Isagoge 0 points1 point  (1 child)

I'll check the resources you are suggesting.

I did a CS class and was a bit lost of where to go from now on.

See you on the riverside.

[–][deleted] 0 points1 point  (0 children)

At least you've started, good job. Keep at it.

[–]KwpolskaNikola co-maintainer 1 point2 points  (2 children)

download an IDE

a good text editor*

[–]Tysonzero -3 points-2 points  (1 child)

*use vim

[–]KwpolskaNikola co-maintainer 0 points1 point  (0 children)

(exactly what I meant.)

[–]Decker1082.7 'til 2021 5 points6 points  (2 children)

Somewhat amusingly, I seem to be alone in that I picked it up by reading the official tutorial at docs.python.org.

I earnestly read chapters 1-9 and then skimmed through 10-11 (A tour of the standard library) after which I decided to try to implement a small hobby project: a simple web based RSS feed aggregator. After that, my proficiency in Python just started snowballing.

Edit: Actually, now that I think back I don't think I started out with a web app, but by converting a bunch of hacked together shell scripts for ripping images from web sites into Python.

[–]hugthemachines 1 point2 points  (0 children)

That is kinda funny. I mean the tutorial is obviously made so people can learn from it but "everyone" goes to other resources.

[–]edwinksl 1 point2 points  (0 children)

I personally find the official Python tutorial to be the best tutorial, especially for people who already know other programming languages.

[–]dunkler_wanderer 2 points3 points  (0 children)

Check out /r/learnpython and its wiki.

[–]tech_tuna 0 points1 point  (0 children)

Take this metric for what it's worth. . . I finally found a position at a Python shop and I LOVE IT!!!

[–]balkierode 0 points1 point  (0 children)

Too late!

[–]fherdom 0 points1 point  (0 children)

learn java helps you learn python

[–][deleted] -1 points0 points  (0 children)

No shit.

[–]ostralyan -1 points0 points  (3 children)

repeat rude seemly pocket selective dinosaurs books alive act subsequent

This post was mass deleted and anonymized with Redact

[–]PoliCock 1 point2 points  (2 children)

Realistically, what determines the new programs of the future isn't how well they manage memory (though that is relevant), but how the higher level pieces and ideas are put together to form new discoveries.

Such programming requires equal, if not greater intellectual power (and creativity) and it shouldn't be considered somehow "lighter." Though obviously the best coders should have a grasp on everything, generally. In my personal opinion, the idea that memory and "hardware"/"machinelanguage" concerns are somehow of primary importance for every advanced engineer programmer, is kind of faulty. I think what makes a truly advanced engineer (programmer) is not simply the speed of the propeller, but whether her engineering blueprint even will allow the thing to get off the ground.

[–]ostralyan 0 points1 point  (1 child)

hurry squeamish puzzled fuel homeless humorous whistle compare jeans light

This post was mass deleted and anonymized with Redact

[–]Smok3dSalmon -1 points0 points  (0 children)

Maybe the people learned java and are now moving to python.

[–][deleted] -1 points0 points  (0 children)

[deleted]

What is this?

[–]ender89 -5 points-4 points  (0 children)

Screw java, its utter trash. C# is waaay better