Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

2nd Edition of Learn Python the Hard Way Released

Soulskill posted more than 3 years ago | from the now-with-upside-down-writing dept.

Python 167

theodp writes "Are you or your kid intrigued by Python, but not quite ready to purchase an in-depth O'Reilly book? Zed A. Shaw's 2nd edition of Learn Python The Hard Way may be a friendlier option. Shaw's path to Python programming is simple: 1. Go through each exercise, 2. Type in each sample exactly, 3. Make it run. If $60 for the hardcover is too much to ask, or $15.99 for paperback, you can spend a measly buck for the PDF/ePub download. Still too steep? OK, there's even a free online HTML edition. After completing the 52 exercises, Shaw's concluding Advice From An Old Programmer says, 'Which programming language you learn and use doesn't matter. Do not get sucked into the religion surrounding programming languages as that will only blind you to their true purpose of being your tool for doing interesting things.'"

cancel ×

167 comments

Sorry! There are no comments related to the filter you selected.

Advice from and old programmer. (-1, Flamebait)

Anonymous Coward | more than 3 years ago | (#36606908)

Some languages are better, python just isn't one of them.

Re:Advice from and old programmer. (1, Funny)

Anonymous Coward | more than 3 years ago | (#36607054)

I have a fever, and the only cure is more COBOL.

Re:Advice from and old programmer. (1)

Tasha26 (1613349) | more than 3 years ago | (#36607090)

Too late! At $1 (£ 0.65) and ease of paypal, I literally just grabbed myself a PDF copy. In my defence, the popular 3D program Blender uses Python.

What format is the PDF in? Kindle? (1)

billstewart (78916) | more than 3 years ago | (#36607250)

When you bought the PDF, what format was it - Kindle-shaped, or letter-sized paper (A4 or 8.5x11 etc.) or something else? If it's Kindle, it looks like a good price.

Also, I was surprised by the terms of the free HTML - you're not allowed to change it! The big reason for reading it in that format is precisely to change it, by copying code examples and pasting them into your Python interpreter to see what they do :-)

Re:What format is the PDF in? Kindle? (3, Informative)

Inner_Child (946194) | more than 3 years ago | (#36607360)

You can always grab the ePub for that same $1 and use Calibre to convert it to a format the Kindle can use. I just bought it myself, looks great on my Nook.

Re:What format is the PDF in? Kindle? (1)

Luke Wilson (1626541) | more than 3 years ago | (#36607964)

Actually you're not supposed to copy and paste the code. That would definitely not be the hard way. You are supposed to retype the examples yourself, just like back when books were print only.

"Old programmer" here too, since 1982 (0, Troll)

Anonymous Coward | more than 3 years ago | (#36607480)

And, for text processing? It's "up there" with the likes of PERL, because of RegExp... good stuff!

* I co-wrote a system to obtain HOSTS file data with my nephew (from DNSBL lists, HOSTS files of others, & other data sources, including my own researches) in Python 2.7x to:

---

1.) De-duplicate it/normalize said data

2.) Alphabetize it

3.) Convert the larger + slower 127.0.0.1 blocking IP Address of the "loopback adapter" address to the smaller + faster & most "universally compatible" 0.0.0.0 blocking IP address

---

For HOSTS files... that's doing so, as I write this, & "automagically", via Python!

Why?

Well - I first used to do it circa 1997-2002 using Access Databases & a SELECT * DISTINCT ORDER BY query system after data import, & then export back to text file for the HOSTS file & yes... it worked, but, it didn't "nab" the data itself automatically & on timed intervals!

So, about mid 2002, I later opted for a Borland Delphi system (because it's fast on strings), & @ the time? I used a "pure brute force" normalization route (slow on LARGE lists, but extremely fast on "smallish ones" (up to 1/2 million line iterms or so)).

That's because in those days?

Heh - That's when a 16,000 line HOSTS file for blocking out adbanners &/or known malicious sites/servers/hosts-domains was "huge"...

Heh - I have, as of writing this & checking the tempfile my system uses before final commission back to the actual HOSTS file here, over 1,459,188++ entries in it... that telling anyone anything?

Not nowadays though!

Fact is, the malware-in-general & online attacks via bogusly scripted sites, botnets, & more problem got bad, and I can tell you this FOR A FACT from when my data started flooding in FAR FASTER than it used to, started around 2003-2004...

I needed something BETTER on large data sets! I was contemplating rewriting the Delphi program algorithm to compensate (took 2 hrs. time on a Intel Core I7 920 CPU).

See - Around the time I got to 750,000 entries though?

The "brute force" deduplication algorithm I used in Delphi couldn't really "do the job" as well as it used to... was great & fast (tops 2-4 minutes on 1/2 million records IF I busted up the data into 48 parts, which the program had the options to do that IF I had lots of data) - this was a "temporary fix" though, vs. an algorithm that wasn't fitting the data set sizes anymore though!

So, sure, I could have rewritten it, but Delphi isn't used as much as it used to be! Time to change...

(BUT, in its day? In, of all places, a competing trade journal "VB Programmers Journal" Sept./Oct. 1997 issue, it KNOCKED THE CHOCOLATE out of both MSVC++ & VB5... by DOUBLE on MATH & STRINGS! Which is, why I used it of course - HOSTS are text data, & composed of strings!)

So... what to do?

Well, my nephew gets the idea to try my idea of HOSTS file processing (he's a junior @ RIT), & to do it in Python

Guess what... it worked GREAT on this size file!

The libs in Python have been written VERY well, lots of "DataStructures coursework" thinking went into their libs (written in C/C++ iirc)

In fact it worked SO well, I decided to take what he had & extend it with errtrapping, better filtration, cleaning up some mistakes he made in filtration, adding console outputs, & better automation with parameter passing functions etc./et al!

Hell of a LOT LESS WORK TOO, than Delphi or C/C++ code, even with their native string functions libs... which are good, but more work (Python turned up to be "VB-EZ" in fact!)

So - I tried Python, for TEXT PROCESSING (when I was actually considering PERL first, actually) & have NOT looked back since!

(Don't knock it, till you've tried it, & with every language, it tends to lend itself WELL, to certain things... for text & string processing work? Python rocks, imo @ least so far!)

APK

P.S.=> What I like BEST about it?

Python is MULTI-PLATFORM, runs just about anywhere really!

Yes... that appeals to me!

It's doing everything I want for HOSTS processing work, & in version 2.7x?? I am happy as a "pig in 'sheet'" using it... r

Regexp was the TOUGH part to get into, but once you're over that "hump"??? It's really good stuff...

Fact is, I am only NOW beginning to truly appreciate what Python can do in fact for text processing work & other areas too (only been using it for around 2-3 months or so though)

... apk

Process Time comparison to old system (-1)

Anonymous Coward | more than 3 years ago | (#36607584)

21++ seconds FLAT now, vs. 1-2 minutes vs. my old Delphi System over rougly 2++ million line items to:

---

1.) Sort them alphabetically

2.) De-duplicate/Normalize them

3.) Convert from std. 127.0.0.1 blocking IP address to smaller & faster "universal black hole" 0.0.0.0

4.) Do so, "automagically" via timed intervals on a Threaded timer system in Python

---

(Yes, I could have rewritten its Delphi system algorithm to correct for LARGE datasets, but Delphi's not as widely used as it was in the mid-90's to the 21st century currently imo - time to learn yet another language I figured (around a dozen now @ this point in time since 1982 coding)).

BIG BONUS & BIG CHANGE in speed for my purposes, & best part?

It's now "write once/run anywhere", a relatively EASY language to pick up, even RegExp once you spend time playing with them that is, AND especially if you've done a few languages over time, & because of Python being available on just about everything there IS out there pretty much - MULTIPLATFORM "PORTABLE"

* And, again: I LIKE THAT!

APK

P.S.=> Once more - For string processing work & text file manipulations? Python's GOOD stuff &, definitely "up there" with PERL on that account/imo @ least!

... apk

Re:"Old programmer" here too, since 1982 (-1)

Anonymous Coward | more than 3 years ago | (#36607618)

...and once word got round of APK's "AMAZING DISCOVERIE!!", Python usage plummeted...

An application of... "ReVeRsE-PsYcHoLoGy" (-1)

Anonymous Coward | more than 3 years ago | (#36607678)

"...detemmulp egasu nohtyP ,"!!EIREVOCSID GNIGZAMA" s'KPA fo dnuor tog drow ecno dna," - by Anonymous Coward on Wednesday June 29, @12:45AM (#36607618) - another done nothing with his life "ne'er-do-well" off-topic troll

"???"

* Uhm, lol... Could we get a translation of that off-topic "troll-speak" of yours, please?

(LOL!)

APK

P.S.=> Yes, it must have just have been another off-topic done nothing of significance with his life troll spewing his b.s. on /., yet again & not contributing to the ongoing conversations on-topic: "Oh well" - & NO biggie!

... apk

I wrote the "reverser" for that, in Python! (-1)

Anonymous Coward | more than 3 years ago | (#36607702)

To pull that off in a fraction of a second, in Python no less!

APK

P.S.=> Like I said - Python's GREAT for string processing...

LMAO - & EVEN vs. "the trolls on /."! LoL...

... apk

Just kidding, but... I think I will now! apk (0)

Anonymous Coward | more than 3 years ago | (#36607716)

Got a nice help online for this also, very cool!

http://pythonconquerstheuniverse.wordpress.com/2009/11/12/how-do-i-reverse-a-string-in-python-3/ [wordpress.com]

APK

P.S.=> One of the things I like about Python is the AMAZING amount of help online there is for it... unreal! Since I like to do "ReVeRsE-PsYcHoLoGy" on trolls? It's an idea... apk

Took me less than 5 minutes... lol! (-1)

Anonymous Coward | more than 3 years ago | (#36607810)

And, here she be, titled TrollTalkComReversePsychologyKiller.py by APK (with a little help from the online help link I put up above, took a bit more but... there you are: Never let it be said I am NOT A MAN OF MY WORD!

---

def reversetrollstring(s):
    trollstring = ""
    for apksays in s:
        trollstring = apksays + trollstring
    return trollstring
apksays = "String to reverse."
print reversetrollstring(apksays)

try:
                        print(5)
                        trollstring = "...and once word got round of APK's AMAZING DISCOVERIE!!, Python usage plummeted..."
                        trollstring = reversetrollstring(trollstring)
                        print(trollstring)
except Exception as e:
                        print(e)

def reversetrollstring(s): return s[::-1]

---

LMAO @ TROLLTALK.COM: Especially for the application of "ReVeRsE-PsYcHoLoGy" vs. them...

* So, never let it be said that Python sucks @ string processing!

APK

P.S.=> Output of that TrollTalkComReversePsychologyKiller.py was: ...detemmulp egasu nohtyP ,"!!EIREVOCSID GNIZAMA s'KPA fo dnuor tog drow ecno dna"

(Dead-Solid PERFECT... by APK)

... apk

Whoops: Pasted the output wrong, here tis! (-1)

Anonymous Coward | more than 3 years ago | (#36607830)

...detemmulp egasu nohtyP ,!!EIREVOCSID GNIZAMA s'KPA fo dnuor tog drow ecno dna

APK

P.S.=> Trolltalk.com? Strikes out, again... vs. "yours truly", & Python!

... apk

Better version (handles quotes via escapes) (-1)

Anonymous Coward | more than 3 years ago | (#36609294)

#TrollTalkComReversePsychologyKiller.py (Ver #2 by APK)

def reverse(s):
    try:
            trollstring = ""
            for apksays in s:
                trollstring = apksays + trollstring
    except:
        print("error/abend in reverse function")
    return trollstring

s = "String to reverse."
print reverse(s)

try:
                        print(5)
                        s = "...and once word got round of \"APK's AMAZING DISCOVERIE!!\", Python usage plummeted..."
                        s = reverse(s)
                        print(s)
except Exception as e:
                        print(e)

---

* Well, some good ALWAYS comes out of the bad, & the trolltalk.com 'trollsquad' around here just made that happen by trolling me, as usual, by ac replies!

APK

P.S.=> So, from now on? Everytime I do a "ReVeRsE-PsYcHoLoGy" post vs. they now? This Python script will do the job saving me time to reverse their words to throw back @ them, in a fraction of a second (& this time, this build has better errtraps, + can handle quotes inside string of their "troll-speak" too - Python's, again, great for string-processing work!)

... apk

Things about trolltalk.com /.ers should know (0)

Anonymous Coward | more than 3 years ago | (#36608082)

NOW - First note that the very SECOND I said "HOSTS FILE", note the reply my init. post got by an Anonymous Coward?

There's a reason for it, read on!

(Especially in my p.s. below where actual PROOF is & this argument with the same AC here today I blew him away on, regarding my Python HOSTS file processing program I noted here -> http://yro.slashdot.org/comments.pl?sid=2265388&cid=36604424 [slashdot.org] ):

NOTE THE MODERATION, to "Insightful"? here in the parent troll's post:

http://developers.slashdot.org/comments.pl?sid=2278690&cid=36606908 [slashdot.org]

And then, the downward moderation by HONEST others afterwards?

Again - There's a reason for it!

It's obviously a troll, & modded up, INITIALLY (but in a cheating way by the trolltalk.com bunch I have caught them in before, see below, keep reading this only gets better):

I.E.-> Trolltalk.com members here mod others down, @ the decent posters' expense no less, & mod themselves up, via nefarious tricks... tricks & off topic harassing trolling + libel I will produce proof of!

So - that all "said & aside":

IF some of you have EVER wondered WHY a post of yours was modded down (especially vs. countertrolling, or tomhudson, for example (there ARE others amongst their bogus group too))?

Don't wonder!

Especially if you "blow the away" many times on tech topics & get their "geek angst up", as I have vs. tomhudson here as an example thereof -> http://slashdot.org/comments.pl?sid=2230966&cid=36418796 [slashdot.org]

ONCE YOU DO THAT?

Well - They will scan for you either by SearchSlashdot, or GOOGLE if need be (or your post history) & mod you down to "oblivion" as they have literally told me they would IF I ever took a registered "LUSER" account here!

E.G.:

---

"First off, why don't you just get an account instead of posting AC? Some (many) of us are tired of you're trolling and would like to be able to mod you down" - by Anonymous Coward on Monday May 23, @01:08PM (#36219132)

FROM -> http://it.slashdot.org/comments.pl?sid=2177744&cid=36219132 [slashdot.org]

---

(I would register here actually, & yes, even IF they down-modded me, because I have hundreds of mod ups EVEN AS AN AC (& we start @ ZERO, unlike registered LUSERS (no, the good folks here are not that - just the trolltalk.com crew)).

So, why don't I?

Well... A gent named Andy K. has "APK" already, & I won't settle for another username (I like being myself online, nobody can take THAT from you anyhow).

Plus, & I'll be STRAIGHT about this: As an AC, I have a very simple & FAST method to post as much as I like, & no dumb discriminatory "10 posts per 24 hour limit" most AC's have that are NOT registered accounts!

So that all "said & aside", you want PROOF of my accusations, beyond that quote above...?

See my p.s. below!

Especially in regards to HOSTS files, myself being modded down for posting about them, & tomhudson + countertrolling MOSTLY & often by AC replies!

(Because I've blown tomhudson's DOORS OFF many times on technical issues when he has trolled me, see link above on THAT note!)

APK

P.S.=> HOW TROLLTALK.COM (tomhudson, countertrolling & others) cheat the moderation system!

(Here is where countertrolling explains what he's doing while he trolls myself to his fellow trolltalk.com friends in fact)

NOW, they do this MOSTLY to harass you, to get you into theirr "journals" they CLAIM are the "most viewed" etc. & highly rated etc./et al!

That's their STUPID MOTIVATION, can you stand it? Tomhudson made that claim to me, said he was "popular" here... b.s.!

(Yea, they might be because they troll folks, draw them into arguments, LOSE them mostly, & claim THAT (some "accomplishment")):

http://slashdot.org/comments.pl?sid=2245866&cid=36491652 [slashdot.org]

And, here's where countertrolling & TROLLTALK.COM's "troll mechanics" for downmodding others is explained in detail by myself when I got rather sick of it happening (for over a year now, & I can prove that too, keep reading):

http://slashdot.org/comments.pl?sid=2271908&cid=36579618 [slashdot.org]

Says it all...

NOW - As far as bogus up moderations, the trolltalk.com bunch (tomhudson, countertrolling, & others) collectively "team up" to upmod one another, in teams, as favors to one another.

At YOUR expense in downmods, & cheating to try to look good...

Again - Note the 0 INSIGHTFUL on the init. ac troll? He did EXACTLY what I said above with his pals... & others here NUKED him for it!

Imo & yes, bad experience + proofs I have on them?

Yes - It's either tomhudson, or countertrolling imo... why, see the above, & this from tomhudson (especially when I even MENTION the word HOSTS file)

---

NOW - Why tomhudson & countertrolling mod down my posts on HOSTS files:

Because they can block adbanners, obviously & better than other tools do like adblock (email is covered too in programs like outlook by HOSTS for example):

"such as I'm doing at http://starmedia.trolltalk.com/ [trolltalk.com] and ran a few banner ads years ago on one of them - by tomhudson (43916) on Thursday June 23, @03:56PM (#36546134) Homepage

FROM http://slashdot.org/comments.pl?sid=2263468&cid=36546134 [slashdot.org]

That says it all really tomhudson - you're a webmaster MAKING MONIES from adbanners, so you hate ANYONE that blocks them!

Well, tough - it's MY MONEY to be online, & I want ALL the bandwidth & speed I pay for... period!

That, & along with the fact you tried to stalk & troll me by ac replies and stated you were trying to start a cooridinated effort with others to do so, harassing myself:

---

tomhudson libelling myself in regards to my professional career:

http://slashdot.org/comments.pl?sid=1992296&cid=35186644 [slashdot.org]

---

You're also libeling myself yet again & lying:

"I have never libeled you, APK. Everything I have written about him is the truth." - by tomhudson (43916) on Thursday June 23, @03:56PM (#36546134) Homepage

FROM -> http://slashdot.org/comments.pl?sid=2263468&cid=36546134 [slashdot.org]

No it is not tomhudson, & that's more lies + libel of myself.

---

You have stated here on this forum publicly I have never worked in this industry:

http://slashdot.org/comments.pl?sid=1992296&cid=35192078 [slashdot.org]

---

And that my programs are only front ends to various things:

http://slashdot.org/comments.pl?sid=2086424&cid=35840802 [slashdot.org]

Yet another utter lie (and libel designed to harm my career obviously).

Some are of course, & so what? Many, in fact MOST, are not.

---

You have said I live with my parents & other things designed to harm my reputation here:

http://slashdot.org/comments.pl?sid=2086424&cid=35840802 [slashdot.org]

Another lie. I own my own home paid in full. You are a person with severe issues of somekind I am certain of this by this point.

The list goes on, but as anyone can see reading you have issues, and that you have done so by using anonymous coward replies to harass myself as well:

---

Wait until he starts on another kick, then reply to him as an AC. It's the new meme. - by tomhudson (43916) on Sunday May 09 2010, @08:29PM (#32150544) Homepage Journal

http://slashdot.org/comments.pl?sid=1646272&cid=32150544 [slashdot.org]

---

HOWTO: trolling the hosts file guy in one easy step

The next time you see a post by him, just reply anonymously. And to really mess with his head, reply anonymously to your anonymous post, disagreeing with your first anon post (extra points if you claim in the second post that you're him - that REALLY sets him off). He'll accuse you of being me by tomhudson (43916) on Saturday April 16, @01:38PM (#35841122) Homepage Journal

http://slashdot.org/comments.pl?sid=2086424&cid=35841122 [slashdot.org]

---

if you're going to tell this guy to stop spamming his hosts file crap, make sure you do it anonymously by tomhudson (43916) on Saturday April 16, @12:45PM (#35840680) Homepage Journal

http://slashdot.org/comments.pl?sid=2086920&cid=35840680 [slashdot.org]

3 times tomhudson? For over a year now also?? Appears you've degnerated into a cyberstalker tomhudson, and even trying to get others to do it with you!

---

TOM HUDSON'S "FAIL LIST" ON DISPROVING MY POINTS ON HOSTS FILES NUMEROUS TIMES:

(Since HOSTS can block adverts online/adbanners so you get more speed, &, so you are protected vs. malicious content in online adbanners also)

---

tomhudson bullshit on HOSTS is outnumbered 30:1 vs. apk evidences:

http://slashdot.org/comments.pl?sid=2087330&cid=35847946 [slashdot.org]

---

tomhudson BURNED on DNS vs. HOSTS and CPU cycles/memory & more used on HIS "ideas" vs. HOSTS vs. apk's ideas:

http://slashdot.org/comments.pl?sid=2087330&cid=35879374 [slashdot.org]

---

tomhudson BURNED & RAN on HOSTS vs. VIRUSES vs. myself yet again:

http://slashdot.org/comments.pl?sid=2088808&cid=35877448 [slashdot.org]

---

tomhudson says "hosts are so 90's" & apk's fellow RESPECTED security person wrote a noted article on them in 2009: (based on his readings of MY posts in forums no less)

http://slashdot.org/comments.pl?sid=2088808&cid=35876806 [slashdot.org]

---

* That says it all!

(Talk about low, and bogus! They've been @ this with me, see the dates on tomhudson's quotes, since MAY LAST YEAR NO LESS, "CyberStalking" me, libeling me, & harassing me, & more... I've had it!)

... apk

Heh: I see PyThon fans took care of the troll (0)

Anonymous Coward | more than 3 years ago | (#36609392)

Advice from and old programmer. (Score:-1, Flamebait)

Is now the moderation on his post, when it was this before:

Advice from and old programmer. (Score:0, Insightful)

---

* So, as the saying goes: "The community takes care of its own"

(Good job fellas)

These trolltalk.com pests are EXACTLY what I said they were in my post about them here:

http://developers.slashdot.org/comments.pl?sid=2278690&cid=36608082 [slashdot.org]

That showed how they operate unfairly against myself, & probably others here too... & what they do AND how they go about doing it, in down-moderating others, & modding one another up in teams (even if their post is a troll or just plain useless b.s.!).

* Trust me: Unfortunately, I know, 1st hand - They've literally been doing it to me for over a year now here on /. forums

(Just because I "blew them away" here -> http://slashdot.org/comments.pl?sid=2230966&cid=36418796 [slashdot.org] shown, & many times for their attacks on myself on HOSTS or Windows - talk about "geek angst"...)

APK

P.S.=> These trolltalk.com pests that infest the /. (slashdot) forums (mainly tomhudson &/or countertrolling)? Victims of their OWN "geek angst" & absolutely NO morals/scruples/principals/ethics whatsoever...

... apk

Re:Advice from and old programmer. (1)

Joce640k (829181) | more than 3 years ago | (#36608612)

Agree. I'm always being told how wonderful/portable it is but every time I try to run a Python program I get "wrong version" or something.

Chapter 0 of the book has "Make sure you install Python 2 not Python 3.". Uhuh, there's a language I want to invest some time in. Not.

  Is there a reason why the language designers didn't put some kind of versioning into their language when they took the decision that backwards compatibility wasn't important to them? Some sort of shebang on the first line with the version number...? It's not difficult.

The other setup advice, ie.:
Open Edit->Preferences select the Editor tab.
Change Tab width: to 4.
Select (make sure a check mark is in) Insert spaces instead of tabs.
Turn on "Automatic indentation" as well.

Doesn't inspire me to learn Python either. Why impose a rigid spacing structure on a language in a world where tabs aren't standardized (and never will be)? Brackets (or whatever) aren't difficult.

I grok that Python is great for I'm-too-busy-to-learn-a-proper-language programmers to knock batch scripts together quickly but it's not a language for serious work (ie. programs that take more than a day or so to write).

Re:Advice from and old programmer. (1)

joss (1346) | more than 3 years ago | (#36608782)

So, your post comes down to "I've never used python, let alone programmed in it, but I know enough to insult those who do".
I programmed in mostly C++ and java (with some lisp and ML) for 20 years before I tried python, and when python is a little sluggish for my needs, I fall back on them but I hardly ever need to. Maybe you're the one who can't be bothered to learn something new and are looking to justify that to yourself.

Python the hard way? (0)

Bowling Moses (591924) | more than 3 years ago | (#36606926)

Is it as hard as donating your liver [youtube.com] , or is only as hard as getting slapped with a fish [youtube.com] ?

This sounds like a good start (2)

billstewart (78916) | more than 3 years ago | (#36607088)

A month or so ago I decided to pick up a Python book at the Borders-is-dying sale, and while it's from O'Reilly, the book is too much of a reference - a lot of bottom-up "here's are six different list-like things" and "nobody expected the Spanish Inquisition, which is why you need to use this method to catch the exception it throws, but you can change that by overloading _ _ that _ _ method name's variable __pope__ or using _ComFyChaiR_ instead, but you can't set __pope__ to French, because that object uses __antipope__ instead, though in later versions you can modify it by using Cardinal()."

A friend of mine pointed me to python.org's tutorials [python.org] ", which were going to be my next step, but this looks pretty simple and accessible too.

Re:This sounds like a good start (2)

Toksyuryel (1641337) | more than 3 years ago | (#36607230)

A good, free book I've been learning from is http://diveintopython3.org/ [diveintopython3.org] I find it to be much better than this book. This book gives really bad advice. For example, claiming that "vim and emacs are for professional programmers only" completely disregards that the only way to get good at either of them is by USING them for a while, a good long while, which would go so well with the message he claims to be sending with this book. Instead of stopping to learn them later, which could take months, you could be learning them concurrently with Python (which is in fact what I am doing right now). Advising not to learn Python 3 AT ALL is similarly bad advice- it's that sort of mentality that causes the adoption rate to be so slow in the first place. Learning both side-by-side would be much preferable, and then you could use your new skills to help port all the old libraries lying around to Python 3.

Re:This sounds like a good start (1)

Anonymous Coward | more than 3 years ago | (#36607334)

This book is aimed at beginners, people who may have no coding experience whatsoever. Not people switching from other languages.

Anyone who recommends vim / emacs to absolute beginners should be shot. They bought the book to learn python, not vim / emacs.

The reason Zed Shaw wrote this book was because he thought Dive Into Python was crap: http://oppugn.us/posts/1272050135.html

Re:This sounds like a good start (1)

lee1 (219161) | more than 3 years ago | (#36607592)

I think Dive Into Python is excellent and Shaw's objections are unjustified. Pilgrim's method is to show you a program that you're not expected to understand immediately and then explain it line by line. Shaw thinks this is too confusing for beginners, and is a bit of an hysterical ass about it.

Re:This sounds like a good start (1)

wisty (1335733) | more than 3 years ago | (#36607690)

Which of Shaw's objections?

That DITP uses ODBC as "your first python program"? Good call, ODBC sucks as a way to introduce python. Something URL or HTML based would be 10 times better.

That DITP uses advanced inline stuff in the first example? I'm ambivalent. It can help to "dive in" then explain later.

Shaw's hard-man personae? OK, it's a bit over the top. But if Zed Shaw comes out with "I don't think this is the most appropriate example." rather than "DITP should be shot in the fucking face."; nobody will think he's seriously objecting.

Re:This sounds like a good start (0)

Anonymous Coward | more than 3 years ago | (#36608466)

For example, claiming that "vim and emacs are for professional programmers only" completely disregards that the only way to get good at either of them is by USING them for a while, a good long while

You mean for eight or more hours a day, five or so days a week? Like a professional programmer would and a dabbling amateur certainly wouldn't?

You're an idiot.

Copy typing (1, Redundant)

rogueippacket (1977626) | more than 3 years ago | (#36606946)

How is that the hard way? What ever happened to sharpening your teeth on man pages and samples written by people far better than you?

Re:Copy typing (1)

Nursie (632944) | more than 3 years ago | (#36607050)

Or even just using the big, free programmers handbook for any language you can think of - Google.

Re:Copy typing (1)

greg1104 (461138) | more than 3 years ago | (#36607124)

The hard way part is where you're given exercises that require extending upon the example given. Providing exercises that are just the right difficulty level for someone learning, easy enough to solve and internalize the learning but not frustrating, is a very difficult thing to do as a technical author. I haven't looked at the book enough to comment on how well it does it that everywhere, but the few examples I checked look well constructed so far.

Also, to address your other comment, Python is one of those languages where looking at code produced by people much better than you can be overwhelming. If you're trying to learn how to do simple work iterating over a list for example, you probably want to just learn that directly--even though someone far better than you might approach the same problem by using a lambda function.

Code by people much better than you (3, Interesting)

billstewart (78916) | more than 3 years ago | (#36607302)

One of the things I really liked about C was that once you've learned a few basics like how pointers and structs work, looking at code written by people much better at C than you just makes sense and comments like /* you are not expected to understand this */ are quite rare. That wasn't as true about C++ or Java, where many kinds of things are readable (after getting the basic "object" stuff down") but some of the template stuff is too obscure. It wasn't true at all about APL or PERL :-)

I was expecting Python to resemble LISP with a different syntax, but it's looking a lot messier than even Common LISP, and of course a lot of the moving parts are hidden in the large number of pre-written modules that come with Python.

Re:Code by people much better than you (1)

Caesar Tjalbo (1010523) | more than 3 years ago | (#36609340)

I was expecting Python to resemble LISP with a different syntax, but it's looking a lot messier than even Common LISP, and of course a lot of the moving parts are hidden in the large number of pre-written modules that come with Python.

I don't know why you expected that but I fail to see how whitespace looks messier than parentheses. The hidden moving parts come with a high level language, it's not supposed to be as basic as C or C++. The downside is that not needing to understand the low level operation can lead to not being able to understand the low level.

Unfortunately, there's no shortage of beginner books for Python but resources for intermediate/advanced programmers are harder to find imho. One is essentially forced to study code written by (hopefully) better programmers.

With a title like that (1)

Anonymous Coward | more than 3 years ago | (#36606956)

I expect the language laid out in monospaced ASN.1 tables from the get-go.

Re:With a title like that (1)

greg1104 (461138) | more than 3 years ago | (#36607068)

I was hoping they'd used some Python fork where the lexer was replaced by one using APL characters or something.

Sexually suggestive title (0)

Legal.Troll (2002574) | more than 3 years ago | (#36606982)

is just something I would like to draw everyone's attention to

Languages are different (3, Interesting)

gweihir (88907) | more than 3 years ago | (#36606994)

They can be in your way, they can make you jump though hoops, they can require you to create so much noise that you need tools to write anything in it (java is a prime example). If you are a truly good programmer, you want a language that does not tell you how to do things and just lets you do what you think is right. Even if that language has less extensive libraries than others.

Personally, I like Python, Lua and C at this time. Python does OO but does not force a specific, limited model on you as most other OO languages do. The one thing that comes close is Eiffel, but at the price of the compiler needing global scope. Lua is just plain elegant minimalistic and again supports OO, but as you see fit, not some restrictive inheritance model. And C just lets you do what you want, very fast if you know what you are doing, although OO, while feasible, has no language support at all. But often you can do without in C anyways. (Yes, even people that understand and like OO sometimes find that not using it is better.) In addition, all three languages are light-weight.

As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.

I also have observed that most of the Java crowd never manages to get to the level of being even mediocre programmers. To me these people look more like "library call sequencers" that could not ever do anything useful without these libraries and development tools that automatize a lot. Quite often this leads to slow, complex and insecure solutions, where the code is basically unreadable due to too much code, to many layers, too much abstractions and no insight on the part of the programmer. Sometimes Java code is 95% clutter and noise. This problem is less pronounced with other languages. One piece of advice I therefore give to anybody that wants to learn programming is to avoid Java like the plague. This is definitely only a language for quite advanced programmers, although the typical Java programmer is very far from that indeed.

Re:Languages are different (1)

JonySuede (1908576) | more than 3 years ago | (#36607034)

This is definitely only a language for quite advanced programmers, although the typical Java programmer is very far from that indeed.

as a Java programmer let me tell you that this proposition evaluate to true !

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607094)

Whenever the subject of programming languages comes up, it seems there are always those who like to take a random dump on C++. I wonder how many of these critics ever bothered becoming proficient in the language. If they did, they would see that it promotes large-scale framework or application development (hundreds of thousands or millions of LOC, often spread across dozens of shared libraries or DLLs) that would require extraordinary effort if done in C, without the overhead/requirement of a virtual machine.

Re:Languages are different (1)

gweihir (88907) | more than 3 years ago | (#36607160)

Thank you, I have learned C++, have the standard and consider it unsuitable for almost any task, except maybe an OS kernel. (Which was the original target AFAIK.) A combination of C and OO capable scripting is far more powerful, but requires you to actually know what you are doing on a conceptual (not language) level. I have used this approach with very good success and all of Perl, Python and Lua for the scripting. I saw what happened when my tools were ported to C++. Essentially they became hard to compile, hard to maintain and hard to understand. The mistake was to port everything to C++, both the scripting layer and the C layer.

C++ is acceptable, if you have a toolmaker using it to create libraries. But it offers little advantage over C in this role and quite a few disadvantages.

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607214)

An OS kernel (and device drivers) seems to be one of the few system programming tasks for which C++ is not in fashion, because of the hidden overhead of object assignment statements, copy constructors and the like. User interfaces, whether GUI or CUI, are probably not the strong suit for C++, with the notable exception of shrink-wrap desktop applications like MS Office (they are just plain faster than Java or .NET GUI's, regardless of what anyone says about performance parity).

Re:Languages are different (4, Insightful)

greg1104 (461138) | more than 3 years ago | (#36607192)

Java as a base language is just fine. The problem is that the sort of problems people like to solve with Java involve things like database interaction, web applications, and user interface construction. And doing all those things turns Java programming into a giant library exploration exercise.

Many other languages end up falling into the same trap if you try to push them toward the same things Java aims at. Python for example has a pretty weak database interface layer. If you want to build a non-trivial DB app, you're likely to add both a database driver plus an ORM solution to make that work sensibly. As a PostgreSQL developer I run into psycopg2 + SQLAlchemy as an example combination. The resulting code is arguably no less "library call sequencer" than a similar solution built using JDBC + Hibernate. And the Java one also fits together into all these other "enterprise" app widgets--application servers and database connection poolers for example. You can do all that in Python, too, but you'll find yourself wandering into the same scale of library mess in the end.

Building an application development framework toolkit that doesn't feel like your language has been turned around to suit the needs of the library is a hard problem. I think one of the reasons Rails has become so successful is that it did a better job than most of avoiding that problem (albeit while giving you a whole different set of problem trade-offs to worry about instead).

Re:Languages are different (1)

TheReaperD (937405) | more than 3 years ago | (#36607668)

As a person about to get into database + html design an maintenance, I would like to work with PostgreSQL. What language(s) would you recommend for the front-end interface?

Re:Languages are different (1)

greg1104 (461138) | more than 3 years ago | (#36607842)

I work with people who have built successful web application with PostgreSQL as the database store using Ruby + Rails, Java + Tomcat, and Python + various additions; at a really high level, building extensions to Django is even a popular option. Which is preferable really depends on where you intend to go with this. If you want a spot with a smaller web company, Ruby would be more likely, and giant companies tend toward Java. I can't think of a good way to stereotype the companies that prefer Python, but they are out there too.

Do what I did (0)

Anonymous Coward | more than 3 years ago | (#36608618)

Use sharepoints/ms access and get a promotion! I am a techgod in the eyes of computer illiterates!

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36609614)

Emacs. And no, I'm not kidding.

Re:Languages are different (5, Insightful)

Raenex (947668) | more than 3 years ago | (#36607336)

They can be in your way, they can make you jump though hoops, they can require you to create so much noise that you need tools to write anything in it (java is a prime example).

While I'll admit that Java has too much boilerplate, tools are good regardless of any language you use. You don't need tools to write in Java -- people managed before fancy IDEs came along. However, because Java is statically typed, it lends itself to more powerful tools. This is really helpful as projects get bigger.

I also have observed that most of the Java crowd never manages to get to the level of being even mediocre programmers.

Oh please, cut the bullshit bashing. I could say the same thing about Python programmers, but that's just throwing insults around.

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607600)

The company I worked for specially put that OO was a naughty word in their job advertisement to scare away Java programmers, because in the experience of my bosses, Java programmers tend to mediocre at best.

I have to say I agree.

Re:Languages are different (2)

m50d (797211) | more than 3 years ago | (#36608094)

You don't need tools to write in Java -- people managed before fancy IDEs came along.

I'm pretty sure anyone who did that will be taking early retirement for their RSI. Java has its place but writing it unassisted is literally physically painful.

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607366)

When Java first burst on the scene, I joked in a "ha-ha only serious" kind of way that it would be a career goal to never write any Java. So far I've succeeded. It seems like the threat of "you must do Java" has passed. Posts like this make me feel pretty good about never having to deal with it. It sounds like there will be a lot of legacy Java out there though. Java==COBOL.

Re:Languages are different (1)

MareLooke (1003332) | more than 3 years ago | (#36608562)

With all due respect but Java > COBOL still holds. Ever tried writing a GUI or OO code in COBOL? No? Pray you can keep it that way.

Re:Languages are different (1)

Anonymous Coward | more than 3 years ago | (#36607468)

I like python too. My *ONLY* bitch about it is beginning and ending tags that are non existent. Indent level? Really? I can NOT tell you the number of times this has created a bug for me, because the spacing was off. Had one 'flavor' where if you mixed tabs and spaces in the same file (one dev liked tabs the other spaces) or didnt put tabs on empty lines it would cause the python interpreter to go into lala land.

That is *THE* one thing wrong with python. What is this punch cards? Seriously? Indent level? Did I step back into the 60s or something?

I disagree with your C++ statement. I know it is 'cool' currently to rag on it. But it is just as slim or overweight as any other language out there. I have seen abominations written with it. I have also see works of art. You can write crap code in anything.

Re:Languages are different (2)

Capsaicin (412918) | more than 3 years ago | (#36607800)

I like python too. My *ONLY* bitch about it is beginning and ending tags that are non existent. Indent level? Really?

I think we all felt that like at the beginning. Now I get really annoyed when I have to use curly braces.

I can NOT tell you the number of times this has created a bug for me, because the spacing was off. Had one 'flavor' where if you mixed tabs and spaces in the same file (one dev liked tabs the other spaces) or didnt put tabs on empty lines it would cause the python interpreter to go into lala land.

You need a get text editor. :p

Seriously though this isn't a major problem if you take a few steps to avoid it. For a start, make sure your text editor will substitute any tabs you might accidentally put into python code with four spaces. Say you use vim or a derivative (I use gvim), put a line in your .vimrc file which will do this automagically, ie au FileType python set shiftwidth=4 expandtab (you also need to make sure .vimrc has :filetype on with pure vi you have to use a hack of setting ts really wide (as there is no et). But whatever text editor you have you ought to be able to set this up.

Secondly if you are working with someone else's code check for mixed tabs and spaces by running python with the -t or even -tt switch at the cmd line. If there's a problem just do a quick sed s/\t/ /g src.py > src_fixed.py or do this in your editor.

Once your work environment is properly set up this problem simply vanishes. With time you will come to appreciate the clean code this affords us. Marking blocks by indentation is both easier to type and because it enforces good indentation practice, easier to read and maintain. I had a similar problems with the python idiom (not enforced) not to use accessor methods, but to access attributes directly. Until I realised the properties overcame any tight coupling issues and allowed for changes in object level implementation without breaking any dependencies on that object, all the while resulting in code that is much easier on the eye.

What is this punch cards? Seriously? Indent level? Did I step back into the 60s or something?

I've been trying, in vain, to find that Dijsktra quote about how indentation might in the future be used to mark off blocks ... did I just imagine it? Suffice to say that in the 60s, 70s and 80s they could only dream of such syntactic simplicity. This is nothing like column specified Fortran. If that is truly your "*ONLY*" bitch, then with a bit of workflow setup and some more experience using the language, you are about to fall seriously in love!

Re:Languages are different (1)

GPLHost-Thomas (1330431) | more than 3 years ago | (#36607868)

You need a get text editor. :p

No, the fact the language doesn't deal with the real programmer's life issues with (eventually) bad text editor, or simply because there will always people with bad or diverging habits is python downside. The fact that one may or may not use a text editor that you consider "good" or that you think tabs or spaces are the bad way is irrelevant. You may "like it", and I can see why (like it's forcing people into doing good indentation), but do not dismiss the issues associated with it.

Non issue (3, Interesting)

Capsaicin (412918) | more than 3 years ago | (#36608062)

No, the fact the language doesn't deal with the real programmer's life issues with (eventually) bad text editor, or simply because there will always people with bad or diverging habits is python downside.

In the same way that the the it is difficult to drive nails into wood with a nail file is the downside of a nail. Once you apply the correct tool in the correct fashion the problem vanishes.

Really all you have to do is alias python to path/python -tt and there is no problem only a syntax error. Or Alternatively, I have a "bad habit" I tend on occasion to leave the semi-colon off the end of the line when writing in Perl or C. Thus both Perl and C's "downside" is that they "[don't] with the real programmer's life issues .. simply because there will always people with bad or diverging habits." Makes sense to me.

The fact that one may or may not use a text editor that you consider "good"

I wrote "... whatever text editor you have you ought to be able to set this up." If you can't then the editor is not "good," but not as a function of my personal aesthetics, but due to its lack of fitness to do its job. Are there really programmer's text editors out there that cannot substitute a tab for four spaces throughout a file?!!

You may "like it", and I can see why ... but do not dismiss the issues associated with it.

After 2 or 3 months annoyance with the tabs/spaces "issue" followed by about 10 years withoIn factut even noticing any, I think I'm entitled to dismiss the "issues associated with it."

As it happens I wasn't dismissing the issue, I was offering advice about how anyone still suffering from this issue could dismiss it.

Re:Non issue (1)

Hognoxious (631665) | more than 3 years ago | (#36608510)

Alternatively, I have a "bad habit" I tend on occasion to leave the semi-colon off the end of the line when writing in Perl or C.

The subtle difference being that a semicolon is detectable by the venerable mk1 eyeball, therefore you don't need to apply any of the bandaids you suggest.

Re:Non issue (1)

Capsaicin (412918) | more than 3 years ago | (#36608614)

The subtle difference being that a semicolon is detectable by the venerable mk1 eyeball, therefore you don't need to apply any of the bandaids you suggest.

Yes I agree, the invisibility of different kinds of white space, and not the failure of a language to make allowance for a programmer's bad habits, is the source of this "issue." However, to characterise my suggestions as "bandaids" is emotive misdirection. The issue is trivially dealt with: Set up your tools properly and it ceases to exist. Editors are highly configurable. They are so for a very good reason. Use the force.

Re:Languages are different (3, Interesting)

Nursie (632944) | more than 3 years ago | (#36607546)

Python's good.

It's quite refreshing to go to a language where (as someone with a lot of experience in programming but not much with python) with such flexible syntax that "I wonder if I can write it this way?" usually works.

And as for rapid prototyping it's great. A couple of evenings and 500 or so lines of python and I can have something that would take me weeks in C. Of course in C I would have had more fine grained control over behaviour and I do run up against barriers in python every so often.

The major downside for me is the GIL. For anything processor intensive you have to work around the language to use the resources of a modern system, rather than work with the language.

Re:Languages are different (2)

abigor (540274) | more than 3 years ago | (#36607884)

The multiprocessing module is your friend. When it comes to Python, forget threads.

"multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine."

Re:Languages are different (1)

Nursie (632944) | more than 3 years ago | (#36608156)

Yes, you're probably right, I ought to take the time to learn that interface next time.

At that point in my last project (yet another fractal browser) I switched to C++ and OpenGL/CL...

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607554)

Your comments strike me as somewhat unusual. You seem to recognize the value in abstraction, but then continue on to denounce it when bad programmers use it poorly. The problem is that understanding is not something that everyone is well-suited for, especially understanding a raw logical system like the computer. And understanding is something that must occur to write good code. Good code doesn't make it to execution by mistake. Sure, you can mistakenly write good trivial applications that do some basic processing and output a result. But any sufficiently complex system does not reach a high quality without understanding.

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36607890)

Haskell. Now.

Re:Languages are different (0)

Anonymous Coward | more than 3 years ago | (#36608244)

You can say what you want about Java but it is increasingly the standard in a wide range of commercial and academic fields.

Java is simple, fast, consistent, standardized, and cross-platform. You can write everything from embedded applications to highly-multithreaded server code in Java. It is not a perfect language, and it's not the right language for every job. But for a great many tasks it's a fine tool.

Calling Java developers 'mediocre' is a cheap shot, and it's wrong. Almost all of the best programmers I know write Java on a regular basis, although none of them would pretend that it's the only choice or even the best choice in every case.

Truly good programmers understand that writing code that's easy to understand is more important than doing 'what you think is right'. Your design is not so cleaver to outweigh the disadvantage of no one else being able to understand your intentions. Java encourages consistency (because the class library gives so many examples of the canonical way to do things), simplicity (because the language is simpler and better defined than most), and documentation (because of Javadoc).

Re:Languages are different (1)

PixelJaded (1904696) | more than 3 years ago | (#36608924)

As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.

I'm sure that since you have recommended the abortion of C++, the people who wrote Webkit, Firefox, Microsoft Office, Open Office, KDE (and most of its associated apps), Doom3 Engine, Unreal Engine, Call of Duty, Super Mario Galaxy, Halo (and every AAA game ever basically), etc. will realise their incompetence / lack of experience and switch to C, Lua or Python since those are your personal preferred languages "now".

C++ is a heavy-weight language, but it does not generate heavy-weight or poorly optimized code. If that were true it would never have been used for Symbian, Android, every modern game engine, Internet Explorer 4 running on 486s, etc. Last year I was using a modern C++ compiler to target code to embedded 25MHz 386s and no optimization work was required to handle thousands of transactions per second. The C++ compilers today actually generate faster code now than they did when the 386 was in its prime. The core design of C++ is extremely elegant once you have an appreciation of the difficulties involved with balancing type safety, performance, meta-programming and other concepts that become significant when writing large, high performance applications. It does a good job of elegantly solving problems that few if any other languages even attempt.

C++ is not the best tool for every job, and certainly not a useful tool for amateur programmers, but it's a fantastic tool nonetheless. Your personal lack of experience does not make it a bad tool for use by professional programmers who are qualified. Its like trying to claim a heart surgeon's instruments are worthless for saving lives simply because you are not skilled in operating them.

I also have observed that most of the Java crowd never manages to get to the level of being even mediocre programmers.

C++ and Java are both widely used internally at Google, Oracle, IBM, and C++ is used heavily at both Microsoft and Apple. When you say java programmers (like those at Google) rarely rise above being mediocre programmers while complaining that C++ is too difficult to learn, your arrogance is matched only by the irony of your words.

Re:Languages are different (1)

jgrahn (181062) | more than 3 years ago | (#36609186)

As to C++, I think that abomination would have been better aborted before birth. You need to know far too much about its internal execution model to write efficient code. At the same time, it is not light-weight anymore.

I'm sure that since you have recommended the abortion of C++, the people who wrote Webkit, Firefox, Microsoft Office, Open Office, KDE (and most of its associated apps), Doom3 Engine, Unreal Engine, Call of Duty, Super Mario Galaxy, Halo (and every AAA game ever basically), etc. will realise their incompetence / lack of experience and switch to C, Lua or Python since those are your personal preferred languages "now".

C++ is my favorite language too, but let's be honest -- lots of software which sucks has been written in C++. It's a language which has had the misfortunate to be hyped in the past, and co-hyped with Object Oriented Everything.

On the other hand, when people like the grandparent can claim to like C and still call C++ an abomination I can only attribute that to ignorance. Just see what a typical non-trivial C program uses instead of the standard C++ containers -- typically a mess of buffer overflows, memory leaks or homegrown type-unsafe and inefficient containers. I'd rather see that complexity *once* in the language, than N times with a myriad variations in the programs.

From lesson 0 (4, Funny)

xs650 (741277) | more than 3 years ago | (#36607016)

"A programmer will eventually tell you to use Mac OSX or Linux. If the programmer likes fonts and typography, they'll tell you to get a Mac OSX computer. If they like control and have a huge beard, they'll tell you to install Linux. Again, use whatever computer you have right now that works."

Re:From lesson 0 (1)

TomHeal (2261306) | more than 3 years ago | (#36608122)

"A programmer will eventually tell you to use Mac OSX or Linux. If the programmer likes fonts and typography, they'll tell you to get a Mac OSX computer. If they like control and have a huge beard, they'll tell you to install Linux. Again, use whatever computer you have right now that works."

I run Windows because I like to play games :)

Other Free High-Quality Tech Books/Writing? (2)

theodp (442580) | more than 3 years ago | (#36607018)

Philip Greenspun has some good titles: Philip and Alex's Guide to Web Publishing [greenspun.com] (dated, but I paid cash money for it back in the day), Software Engineering for Internet Applications [greenspun.com] , and SQL for Web Nerds [greenspun.com] . If you find yourself in the DB2 world, Graeme Birchall's DB2 SQL Cookbook [verizon.net] is a must-have.

Pro Git (1)

MrEricSir (398214) | more than 3 years ago | (#36607866)

Pro Git [progit.org] is a great resource if you want to get into Git. (You can buy a dead tree version as well.)

Only a limited starter no Python (1)

nikunj (40577) | more than 3 years ago | (#36607060)

Looks like a good attempt on programming, but if I am starting on Python today, I'd prefer using the current version.

This is a good price-point; yet, if you want to do anything more than an evening with Python, try...

http://diveintopython3.org/ [diveintopython3.org] or
Computer Programming for Kids http://cp4k.blogspot.com/ [blogspot.com]

Re:Only a limited starter no Python (3, Interesting)

gweihir (88907) | more than 3 years ago | (#36607102)

I have been doing Python 3 for some time. The language is better than Python 2, but you still frequently run into things that are not ported yet. So I would definitely advise either to learn Python 2 and have a look at 3 or the other way round.

For larger projects, I would advise to still use Python 2 at this time, but with a style that allows an automated upgrade later on. This will mean not using some Python 2 features.

Re:Only a limited starter no Python (-1)

Anonymous Coward | more than 3 years ago | (#36607188)

Nobody is using Python 3 for anything that matters, and even Google has no plans to move to Python 3. There's simply no compelling reason to port to Python 3. They broke backwards compatibility, didn't remove the GIL, and made the mainline implementation even slower...

Re:Only a limited starter no Python (1)

im_thatoneguy (819432) | more than 3 years ago | (#36608096)

I loved this website:
http://www.trypython.org/ [trypython.org]

It's an interactive class on Python and sounds a lot like Learning Python the Hard Way.

Exercises not all that good (2, Informative)

Warlord88 (1065794) | more than 3 years ago | (#36607070)

I am a novice level programmer in C++/Python and I thought I could benefit from this book. But the exercises seem to be ridiculously simple and it seems a book only suited for someone with zero or negligible programming background.

Re:Exercises not all that good (3, Interesting)

gweihir (88907) | more than 3 years ago | (#36607114)

... it seems a book only suited for someone with zero or negligible programming background.

It is. There is a place for such books as well. It does not hide this fact either.

Re:Exercises not all that good (2)

Warlord88 (1065794) | more than 3 years ago | (#36607132)

My bad. I never thought Slashdot could run a story on a programming book that I find it easy!

Exercises that good (2)

JeremyBanks (1036532) | more than 3 years ago | (#36607710)

That is the idea. The first sentence from the site:

Have you always wanted to learn how to code but never thought you could?

and then from the next paragraph:

...At the end of LPTHW, you'll know the basics of coding...

Re:Exercises not all that good (1)

phantomfive (622387) | more than 3 years ago | (#36608030)

It's a great book. It is a simple book, but it explains it well. I may send it to the next person who asks me how to be a programmer, and see what they do with it.

Re:Exercises not all that good (0)

Anonymous Coward | more than 3 years ago | (#36608136)

I agree, fully. This is something I may give to 12 year olds after they complete a round with Guido van Robot. Glad I saved myself a buck with the free HTML!

Hey, me lesson 18. Me guru Python man. ... NOT!!!

[captcha says "aghast" - all to accurate for the occasion]

Forget that, go OCW and GPL book (2)

x1n933k (966581) | more than 3 years ago | (#36607142)

Check out MIT's OCW. Free lectures with a GPL Python programming book that does an excellent job at explaining programming and the Python language. The lectures are bad quality but the projects are good for practice.

Misleading (0)

Anonymous Coward | more than 3 years ago | (#36607150)

Anyone else think this was about watching Monty Python on VHS?

Re:Misleading (2)

greg1104 (461138) | more than 3 years ago | (#36607236)

Oh, you think watching Python on VHS is the hard way, do you? Why, in my day, if we wanted to see a good Monty Python skit we had to go kidnap the performers, construct a set, and buy enough booze to get them drunk enough to perform. VHS? Luxury.

I thought that was a joke. (1)

Animats (122034) | more than 3 years ago | (#36607358)

I'd heard of "Learn Python the Hard Way", but I thought it was a joke.

If you know any other programming language, Python is very easy.

Re:I thought that was a joke. (1)

garaged (579941) | more than 3 years ago | (#36608828)

Totally agree, and the best thing about python is that you usually can get very readable code often with fewer lines than the corresponding alternative you already know. Much like going from bash to perl on a complicated script, I would say

Re:I thought that was a joke. (1)

maxume (22995) | more than 3 years ago | (#36609002)

The book is aimed at people that don't.

Confused by the title (1)

FrootLoops (1817694) | more than 3 years ago | (#36607718)

Learn Python "the Hard Way" to me implies an advanced book. It seems they meant "Learn Basic Python Well". I kind of prefer this title, too--it's much friendlier for the apparent target audience [learnpytho...ardway.org] , even if it's not as catchy.

Re:Confused by the title (1)

Permutation Citizen (1306083) | more than 3 years ago | (#36608574)

Yes, the "hard way" doesn't mean it's advanced, it just means you have to type again and again boring things because it's supposed to be a good learning method.

Just go through the python tutorial, it will be more effective on every aspect.

Many thanks! (0)

Anonymous Coward | more than 3 years ago | (#36607730)

This was an outstanding post!

I learned Python... (1)

sconeu (64226) | more than 3 years ago | (#36607874)

By watching The Life of Brian, Monty Python's Flying Circus, and Monty Python and the Holy Grail

Re:I learned Python... (1)

Tumbleweed (3706) | more than 3 years ago | (#36607946)

By watching The Life of Brian, Monty Python's Flying Circus, and Monty Python and the Holy Grail

That would be "Learning Python the Completely Different Way".

It is not just the language (1)

NicknamesAreStupid (1040118) | more than 3 years ago | (#36608008)

It is the libraries, frameworks, and targets. These are the difference between just learning a language and having grown up with it.

O'Reilly = crap (0)

Anonymous Coward | more than 3 years ago | (#36608106)

O'Reilly only publishes crappy titles these days anyway

Louis Vuitton (-1)

Anonymous Coward | more than 3 years ago | (#36608128)

Louis Vuitton( ) Chanel() Hermes () Gucci()Chloe()
Bvlgari() Coach()Prada) Rolex()

URL: http://www.lv-bag007.com

'learn new languages in about a day".... Bullshit (2)

cruachan (113813) | more than 3 years ago | (#36608354)

Most of this "advice" is bullshit. The "line I've been programming for a very long time. So long that it's incredibly boring to me. At the time that I wrote this book, I knew about 20 programming languages and could learn new ones in about a day to a week depending on how weird they were. " gives it away.

Sure if you've got a background covering C you can pick up those languages based on C syntax pretty quickly - in terms of writing raw statements - but that means very little as most of the heavy lifting these days is done using the supporting libraries. Sure myself I picked up C# syntax in about that, but groking .Net to a productive level takes a fair bit longer. Even Javascript, which appears very simple for someone with a C background is deceptively simple to think you've got but you're probably missing out on the subtleties whole protoypical inheritance model. And then there's C++. Can anyone who doesn't code C++ as their day-job for less than two years really claim to have C++ and completely under their fingers?

And we haven't even considered more unusual things like Haskell or Prolog, or even Lisp where it's not just a question of the syntax. Sure if by 'picking up' you mean getting to the point of being able to code Quicksort then yes, but otherwise - well I call bullshit. And I've got over 20 years experience and an average of one language a year over that (but I'd only claim to really have half a dozen completely understood).

Just snagged a copy (2)

bazmail (764941) | more than 3 years ago | (#36608400)

This is exactly how I like to learn, a dew lines about the code, the code, and expected output. Its concise, no crud in there. Its a format i'd like to see more of. I remember reading a C++ book, one of those monster ones from the late 90s that used up about 50 pages printing out encoded resource files, pages and pages of non-human readable crap. (Being a nub at the time I actually typed a lot of it out)

even a blind chicken sometimes finds a kornshell.. (1)

muckracer (1204794) | more than 3 years ago | (#36608468)

> 1. Go through each exercise, 2. Type in each sample exactly

> Do not get sucked into the religion surrounding programming
> languages as that will only blind you to their true purpose of being
> your tool for doing interesting things.

Yes, but to type in the programming exercises, do you recommend using vi or emacs? :-/

Re:even a blind chicken sometimes finds a kornshel (0)

Anonymous Coward | more than 3 years ago | (#36608546)

GNU Emacs, of course.

Re:even a blind chicken sometimes finds a kornshel (0)

Anonymous Coward | more than 3 years ago | (#36608698)

Just use 'cat > program.py'.

Re:even a blind chicken sometimes finds a kornshel (1)

Spacelem (189863) | more than 3 years ago | (#36609054)

Yes, but to type in the programming exercises, do you recommend using vi or emacs? :-/

The author suggests gedit, for all platforms, which is a fair enough suggestion. However he then insists on using spaces over tabs, without any explanation of the relative merits, thus already choosing a side in yet another programming disagreement. A simple "choose one and stick to it" would have sufficed.

Personally If I follow the book I'll be using vim + tabs, because those are what I'm used to and prefer, but that's just me.

"in-depth O'Reilly book" (0)

Anonymous Coward | more than 3 years ago | (#36608478)

I've never seen an in-depth O'Reilly book. They all seem to be printouts of man pages. Does anyone have a list of gems from O'Reilly that they'd like to share because I found most of their stuff a waste of time.

All Python programmers used to work at Google? (1)

PeFu (90322) | more than 3 years ago | (#36609306)

Cited from http://learnpythonthehardway.org/book/ex50.html [learnpytho...ardway.org] :
"Other Python programmers will warn you that lpthw.web is just a fork of another web framework called web.py, and that web.py has too much "magic". If they say this, point out to them that Google App Engine originally used web.py and not a single Python programmer complained that it had too much magic, because they all worked at Google. If it's good enough for Google, then it's good enough for you to get started. Then, just get back to learning to code and ignore their goal of indoctrination over education."

Hmmm... I remember times when Guido v.Rossum, Tim Peters and others were working at a company called BeOpen.com ... may this shows my age.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?