26 April 2014

The poster!

Finally, my poster for PyCon 2014!

The idea

Follow the arrows to plan your excursions among the red (very important) and green (but do also this, sooner or later) topics. Solid arrow: you will need to know the first topic to understand the next one. Dashed arrow: the first topic could help you understand the next one.

The resources

Below each topic, a list of the resources where you can study the topic. The best ones for each topic are marked in boldface. The resources have been reviewed on this blog, and they are

And more

The blue boxes on the top left corner represent five useful topics that don't belong in a particular path; sometimes (command line, git, regular expressions) are not to be studied in one session - or maybe not even in consecutive sessions. Get there, but you will get there when you will get there.

And now...

(Click for a larger image. If you want an even larger version, drop me an email.)

And yes, that's Grumpy Cat. My secret weapon.

22 April 2014

Kick the black dog (a long personal post, but hopefully also useful to other people).

[The poster will be in the next post. I felt that I should write this, and then Easter got in the way.]

I really enjoyed PyCon 2014. But I never loved PyCon 2014 with an all-consuming passion. And this is well.

I was sometimes tired at PyCon 2014. I was certainly tired as I came back home from PyCon 2014.[1] But I was never tired and sad beyond anything in this world at PyCon 2014, or after. And this is very well.

I had a couple of worries at PyCon. I never panicked uncontrollably and without a cause. It was a good feeling.

I loved not being exhilarated but enjoying my time. I even loved being under the weather or worried, because I was a bit down but not crushed. It was well, it was so good.

I'm bipolar, I've got bipolar disorder.[2]

Not so long ago, I was in a really bad place. It took more than I expected: I felt better in August, but I overdid myself and I got stuck back until Christmas. But around Christmas it looked as if things started falling into their place.

Now I'm managing.

I still have to be aware at all times: stop alcohol that moment before; if you're tired above that level go straight to bed and call it a day; if you start laughing that uncontrollably keep an eye on yourself, even if you're watching Some Like It Hot. Learn to find that that, push it and yourself but not beyond that, don't take it badly if you get it wrong. Take your medications, morning and night.

But I'm managing. As in: I've never been better in years.

I'm just a bit torn between enjoying reading books[3] and being able to follow what happens in TV series[4] even more because I know how much the mind can be in a terrible state, and being quite scared because I know how much my mind didn't realise the terrible state in which it[5] was.

As far as work is concerned, I'm just happy. OK, no: I'm worried about the Years I Wasted Being Ill, as usual.[6] But I'm so happy. If I managed to stay afloat during that time, now that I'm well I feel that I can do so much. So healthily. So well.

A whole conference, and I'm just tired because of some work, jet lag, a bad flight and two days preparing what turned out to be a fantastic almost-seven-hours-long Easter lunch for eight people.[7] Never happened before. It's going to happen again. I can't wait.

And (no spoilers, but) I have projects. Things to work on. And I can do it. No, I'm not setting the bar too low: I'm counting my blessings.

Because I've been lucky, blessed, whatever you call it. I had support from many people and from the system (thanks, NHS). I didn't have many sources of stress that others may have; my medications don't give me terrible side effects[8]. But, in the end all that matters is here: I'm well. Not so bad, at least. (I'll be better as soon as I'll overcome the bagnacaoda[9] leftovers.)

So, here's the Attempt at Socially Useful Part of this post:

  1. Mental health issues are bad
  2. Don't even try to deny it
  3. As in "think of the children with cancer,[10] you're just being difficult, get over it"
  4. But they're not invincible
  5. Even when they're incurable, they are (often) treatable
  6. But you have to do something about it
  7. As in avoiding the whole "medications and doctors are evil tools" thing
  8. So, try to get help
  9. And, if you can, remember to fight for people that aren't able to get help
  10. Like people that cannot afford to see a doctor
  11. (Yes that was a hat tip to free health care)
  12. And if you have a mental illness, remember that
    1. You are not alone
    2. It's not shameful to be ill
    3. (My grandmother never said that someone had cancer. She just said that someone had "a bad illness." As if there were good illnesses.)[11]
    4. Yes, it's bad
    5. But you can fight it and win
    6. Because it's not you, it's it
    7. No matter what it puts in your head
    8. And I'm here, cheering for you


Although, if you want to continue the discussion in the comments or drop me an email - feel free.

Now I should really study Django. The tutorial by Tracy Osborn at PyCon was really illuminating.

And I should write something to deal with footnotes in my posts, I guess.


The title is a reference to how Winston Churchill used to call his depression. Which proves that you might win the Battle of Britain but not completely overcome depression. Sometimes one has to settle.

[1] Consider that the journey back home included: a US border control agent calling the paramedics because I had all the symptoms of a heart attack; said paramedic being French-speaking and not knowing the word "spleen," as in "I don't have a spleen"; signing a form to get home as soon as possible; three hours on the tarmac; back to the gate; a change of route so that I could avoid New York, that was shut down due to bad weather (the guy behind me in the queue looked incredibly like Theon Greyjoy from Game of Thrones); yet another wait; a flight with a lot of turbulence; the worst food I'd had in a while; a four-year-old screaming in my ears for about five hours out of the seven when we were in the air; a mother of said child that acted as her four-year-old were as incontrollable as a six-month-old baby, so much that the flight assistant (who bore a striking resemblance to the director of Torchwood One from Doctor Who) gave up telling her to keep her boy still and seated for landing.

[2] Note on ableism/disability rights/that-sort-of-things. "I've got bipolar disorder" or "I'm bipolar": the issue is complex. How much the mental illness is part of your mind, and how much of your mind is part of you? And even if it isn't: how much an experience such as a mental illness defines someone who has dealt with it? I'm OK with both phrases, but be aware that it's a minefield.

[3] The Lord of the Rings (appendixes included); Harry Potter (all seven books, crying like a baby); God Believes in Love - Straight Talk about Gay Marriage (by Gene Robinson, one of my heroes); Redshirts (by John Scalzi, and you should read it because it's beautiful); The Importance of Being Earnest (which has some absolutely hilarious subtle gender-swapping moments I didn't remember); Il corpo non dimentica (by Violetta Bellocchio, it's available only in Italian - so far; if you read Italian I wholeheartedly recommend it: it's amazing, and I'm not saying it just because I know the author), Marvel: the Untold History (I'm still in the middle of it), Young Avengers written by Kieron Gillen (my welcome-back-home gift from my own best husband in the world).

[4] After a thorough rewatch of Buffy and Angel, Fringe.[4.1] Next: catching up with Agents of S.H.I.E.L.D. and maybe Mad Men from scratch.

[4.1] If I ever get my hands on an unlimited amount of money, I want Nina Sharp's stylist to design my outfits.

[5] "It"? "She"? If I'm "she" shouldn't my mind be a "she"?

[6] And anyway I'm telling the whole story (or at least a good part of the story) of my 20kg medical record in instalments in this great web magazine (in Italian; but if you read Italian...).

[7] Hey, the title of this blog is not just a random quote from Grace Hopper.

[8] If you've ever watched Silver Linings Playbook[8.1]: the scene in which the main characters compare the side of effects of psychiatric medications embarrassing everyone at the dinner table rings so true to me.

[8.1] Good film, and it's amazing how it's able to tell a story about people with mental health issues avoiding to fall into stereotypes. (I won't expand or I'll never finish this post.)

[9] Bagnacaoda: Piedmontese dish. It involves garlic, anchovies, butter (a lot of butter), oil (a lot of oil). But, you see: it's eaten with vegetables (dipped in the "bagna"), so it must be healthy. Right? I can give the recipe in the comments, if you wish.

[10] And as a "cancer survivor" I can guarantee you that cancer patients are less than amused to be used for your inspiration porn.[10.1]

[10.1] You should really read the article I just linked.

[11] As JK Rowling (via Albus Dumbledore) says: "Fear of a name only increases fear of the thing itself."

13 April 2014

After the poster.

Thank you to everyone who dropped by. Thank you if you let me guide you through the map in the poster, if you took the handout, if you just looked at my Grumpy Cat telling you to test your code.

You'll be able to see and download a version of both poster and handout here in the next days.

And things might evolve into something more...

When I grow up.

[Puts on her best wise auntie look.]

Growing up is also about choices.

[Wise auntie look comes crashing down.]

No, I'm not that good at following my own wisdom. I want to do everything, at once.

But you should also find out which way is your way. Start with your strength first, feel great, then challenge yoursef out of your comfort zone later.

For instance, let's say that you want to move your Python knowledge to yet another level.

But the further you go, the more the roads you see in front of you.

So now it's time for a test. You know, like those "Which Star Wars Character Are You?" tests. But simpler.

And let's hope that this time I don't come out as Greedo.

Q1: Where did you sit when you were in school?

  1. First row. Hand up.
  2. Last row. Under the radar.
  3. School?

Q2: Pick one light reading.

  1. War and Peace. And without skipping the philosophical digressions.
  2. Harry Potter.
  3. The Evil Genius Guide to Taking Over the World.

Q3: Are you still here?

  1. Of course. I don't leave what I'm reading behind.
  2. Uh... yeah?
  3. [Silence. Somewhere someone's smashing something to see how it works.]

Results! Majority of...

  1. Have a cookie. Yes, you can have it. Go to Think Python: How to Think Like a Computer Scientist. You will be thorough, as usual, and patient. You will come out of the book with a methodic understanding of concepts with some theoretical background (you're allowed to peek into appendices before the end and see what the big-Oh notation is), the satisfaction of overcoming the tricks of many nice exercises, and a beautiful vocabulary (courtesy of the glossary at the end of each chapter).
  2. Have a cookie. Yes, you can take a cookie for each one of your friends. Bring them all here, while we're at it. No, I'm not sending you to the principal's office. I'm sending you to the intermediate projects of the Python Workshops that you can find via those great guys at OpenHatch. Some projects of the Boston Python Workshop are here; but you can find more, and they're always growing. If you're lucky (and, mostly, US-based) you can go and play with your friends live! at one of these workshops. But I guess that just the idea of making your own game of Snakes beats that tic-tac-toe that you were playing with over there.
  3. Have a cookie. Come on, come here. Please. I'll be quick. Have a cookie, yes. I know you're thinking about how to steal the jar. But I have something better for you: go to newcoder.io and see if you can get those tasty cookies. They're not easy to get. You have to deal with the world out there. You'll have to get your hands dirty, I'm afraid. I bet you... Hey! Where are you?

No majority?

You got me. Have all the cookies, you deserve them. Now throw a dice with a number of faces that is a multiple of three to choose between the options above.


Now have fun. Whoever you are, Python's got something for you.

And after you had fun your way, explore the rest. Challenge and surprise yourself.

Let's learn Python and grow up.

My poster at PyCon 2014 will be tomorrow (today, in EST) at 10:00am. Come and say hello.

12 April 2014

An official tutorial (and a gentleman).

I have fond memories of The Python Tutorial on python.org. My first Python textbook was Learn Python The Hard Way, but as you might have gathered, around the tenth chapter of printing text I was a bit dispirited. So I went for something that sounded short, to the point, and a bit official, even dry.

The Python Tutorial was a great help. I read (more on this "read") it, I found what I wanted to know: that's the way you write a while loop, this is the way you define a function, classes are written according to this syntax. Then I moved on, keeping the website as a go-to reference for my little doubts.

I've just gone through it again, and I realise that I was saved by my worst flaws. No, not from, by.

First of all, I can be restless: I got to Defining Functions I enjoyed it, then I peeked into the next chapter and I saw Data Structures, I thought that was useful and quite easy to understand, and that section on Lambda Expressions in the middle of the two left my radar.

Then there's the fact that I knew something about programming. It was in Java, it was very little, but it was more than zero. This means that I knew the names of the topics: if I wanted to write was a while, I knew to look for "loops." (Actually, the while is covered in an example in the chapter before loops. The organisation of the topics is not the strong point of The Python Tutorial.)

Even how I didn't know very much played in my favour: it that the scope of my quest to do what I already knew wasn't so wide to get myself lost in small(ish) details.

So I found The Python Tutorial a great tool, under these two conditions: some (even very basic) background in code, some tendency (ability?) to skim and overlook topics that you'll get back to at a second reading. Also, the topics are many but the pace is quick, and the examples are simple: it's a perfect complement to Dive Into Python 3.

Looking again at The Python Tutorial after using it as a "beginners' text" was a bit a "Princess and the Frog" story: you think that you're over what's in there, then you find out that there's a lot more. The most important thing is in the URL: it's the official tutorial on the PSF website, so it's a gateway for the official documentation.

And there are many other good reasons why The Python Tutorial should always be there in your bookmarks: that drop-down menu (on the upper left of each page) that takes you from the page in Python 2.x to the same page in Python 3.x; the glossary (again, both in the 2.x and 3.x flavour).

So: this official tutorial can sound (or even be) a bit aloof sometimes. But you can (and shall) become fond of the company of this gentleman.

10 April 2014

The Big Jump.

So, are you ready for the next level?

So let's Dive Into Python 3.

You should know how to deal with an if or with a loop, in Python or in another language. You should have learned what a function is. You should have an idea of what "Object Oriented" means. You should be able to keep cool when you see that there's a parallel with a language you don't know.

So you dive straight into the good stuff. In detail.

I said "in detail": the chapters are quite long. But they're well subdivided into sections, so if you don't have to swallow everything in one gulp. I'm looking at you, dear chapter on regular expressions.

And since we're on the subject of chapters and sections: Dive Into Python 3 is probably the most pleasantly readable textbook that I have met. There are the collapsible tables of contents; there is just one column, so you're not distracted from what you're studying. The font is beautiful and easy to read.

Another great idea: the difficulty of each topic is marked at the beginning of each chapter. I think that difficulty is always quite subjective; but it's always good to remark that sometimes prerequisites are harder than more advanced topics.

And then there's the text itself. The writing is conversational but precise; it takes you seriously and it doesn't make you feel stupid if you don't know something. The examples and the snippets of code are neither trivial nor unnecessarily convoluted, and they are cleverly annotated outside the code itself.

So: if you're already comfortable with programming, if you automatically go beyond the "reading" part of teaching yourself into the "writing code and playing around with it" part, here's a fantastic book for you.

Now you might wonder where's the catch. There's mostly one: Dive Into Python 3 is, well, a textbook on Python 3. This means that you have to look elsewhere for Python 2.x; but if you're comfortable with Dive Into Python 3 you shouldn't find googling "Python 2 and 3 differences" too hard. I recommend this page on python.org, that being the website of the PSF is trustworthy by definition. Dive Into Python 3 has an appendix on the 2to3 script; but it's an appendix, and it's marked as "very difficult" in a book that is already not so easy.

Another possible issue is that you cannot really skip chapters. Sections, maybe. But you have to follow the path that's been laid down in the book. This is not a bad thing; but if you're reading something at this level you might sometimes wish to have the chance of a more flexible syllabus. But, on the other hand, if you're at this level you can realise when you have to go back and where to; so no harm done.

One last thing: there are many links from which you can take your study to a deeper level, so you can complement the somewhat "cookbook" flavour of Dive Into Python 3 by looking at the official documentation or even at a good post on a blog. But beware the "Problem with Wikipedia"...

6 April 2014

You and me.

Codecademy sweeps you off your feet. At least, as you might have guessed in the last post (sorry for the hiatus), it swept me off my feet. But you need a quiet bedroom to rest after the most amazing party, to regain the strength you need to plan the next one.

Welcome to Python for you and me.

Take a seat. A cup of tea, possibly caffeine-free. Reorganise what’s your mind has devoured.

The topics are already there for you, clearly subdivided into short chapters. Nothing too theoretical, mostly to-the-point examples that will immediately bring back to your mind what you’ve studied, or make you wish to learn more about something you haven’t seen before.

It’s great if you want to revise the very basics. It’s even better if you’ve never met the topic: you are likely to get the general idea of it, the sketch of a map to help you not to get lost when you will bring your study to the next level.

That’s basically the best and the worst about Python for you and me: it’s simple. It’s unthreatening, in the best meaning of the word, so you don’t spin into "I’ll never get this!" mode. But you must be wary of complacency. You read a chapter, then the other, then the next: everything is calm and quiet. So quiet that you don’t check if you really understood what you read. The code samples are simple. (I just tried to say the last sentence out loud, my tongue is tied in a knot. Let’s move on.) The lack of exercises is tempting you into not challenging yourself.

I love Python for you and me. It’s the reference text to keep on your (metaphorical) bedside table: you revise your background, you go back and forth a few chapter to get some context, you check your general position. It’s the perfect companion for Codecademy or Learn Python the Hard Way: I suggest a combination with the latter if you like the Hard Way and you don’t mind (or even enjoy) being taken between two opposite poles; if you like a more playful or relaxed approach, I would pair with the former.

Last but not least: don’t underestimate how far the book will take you. Under the unassuming look you will find an amazing guide to PEP 8 guidelines, a great introduction to testing (and since you will already be nervous because if test will fail, the relaxed approach of Python for you and me will be a real help), the basis of structuring and releasing a project (and since you will already be self-conscious of the big step, the Python for you and me style will put you at ease).

All in all: a fantastic resource. The soft bed from which you rise so much more rested, before moving on to the next level.

And now, on to the next level.

2 April 2014

Do you want to build a project? (Come on, let's go and play.)

This time I'm going to play it safe. Maybe too safe. But hey - I've always been against criticising something just because it's fashionable.

So, let's talk about Codecademy: the Python track and beyond.

I was wary of Codecademy. Exercises without apparent theory? Mmmh. A little stern teacher inside me kept repeating me sermons about pampering myself too much. But then, at PyCon 2013, Jessica McKellar introduced Python for beginners with the hands-on Codecademy tool. And I fell in love.

Codecademy is the Addictive and Playful Way to approach the Hard Way. It's the cool aunt who gives you her Led Zeppelin CDs, teaches you not to give up listening even if it's not what you're used to, but never brags about "in my times". And as an icing on the cake she tells you about her escapades when she was listening to that song.

You do your exercises and you don't fool yourself into thinking that you know how to do something just because you read the theory. Even better: your exercises are checked as soon as you've done them, so you know if you know or you don't know. You soon become committed not to lose your winning streak, so you exercise every day. You want to grab those nice colourful badges, so you challenge your fear of not being good enough.

And you learn. Not so slowly, and surely.

The topics are introduced at a fundamentally constant pace. If you pick up the basics quickly, you can dash through the first tutorials and then take your time to absorb the harder stuff (and since the track touches concepts as far as lambda expressions, the harder stuff is not always so intuitive). If you are the kind of student who gains velocity over time, you can spend your first days to get acquainted with the first concepts and then enjoy the more complex ideas.

After you've learned your concepts (even if you didn't notice that you were learning, you were too busy solving the problem at hand), for each section of the track you have a project to put in practice everything: a project on larger and more satisfying scale than an "exercise section" in a traditional textbook, but small enough not to derail you in an overwhelmingly ambitious plan. (There isn't one for the Advanced Topics, but once you'll be there you'll be old and wise enough to take care of yourself. It would be nice, but that's a minor issue.)

And then, you go beyond! The community gives you nice projects. You can give back to the community with nice projects.

You try your skills at dealing with APIs, and you learn the wider concepts you need for those APIs.

You learn to ask questions and get answers (and that's another skill, and a most useful one) discussing with other students in the forum: a good practice for when you will eventually interact with others on Stack Overflow.

To top it all off, you have a glossary that will help you in those "I knew what this word meant"/"How should I say that?" moments.

Theory and practice, play and commitment. You have it all. You just have not to fall into the trap of "it's not serious if it's not painful."


The title of this post is a reference to my favourite movie of this past winter, the story of a young woman who learns to control her power and to put it to a better use, for the fun of everyone including herself. Here's something to show you its funny side:

1 April 2014

I did it my (hard) way.

Let's start this series by gambling all my credibility.

[Deep breath.]

[Another deep breath.]

[Yet another deep breath.]

The hard way is not my way.

There, I said it. And now, please, let me defend my position.

I know that Learn Python The Hard Way is one of the, if not the, most common answers to the question "I want to learn Python, can you suggest me a tutorial?" - so I don't doubt that there are people who find it extremely helpful. And I don't think it's a bad book; but I think that it has some serious limits.

Learn Python The Hard Way reminds me of Gioacchino Rossini's joke about Richard Wagner: "a composer who has beautiful moments but awful quarter hours."

Here's an example of a beautiful moment; even better, a deeply wise one:

As you study this book, and continue with programming, remember that anything worth doing is difficult at first. Maybe you are the kind of person who is afraid of failure so you give up at the first sign of difficulty. Maybe you never learned self-discipline so you can't do anything that's "boring." Maybe you were told that you are "gifted" so you never attempt anything that might make you seem stupid or not a prodigy. Maybe you are competitive and unfairly compare yourself to someone like me who's been programming for 20+ years.

Whatever your reason for wanting to quit, keep at it. Force yourself. If you run into a Study Drill you can't do, or a lesson you just do not understand, then skip it and come back to it later. Just keep going because with programming there's this very odd thing that happens. At first, you will not understand anything. It'll be weird, just like with learning any human language. You will struggle with words, and not know what symbols are what, and it'll all be very confusing. Then one day BANG your brain will snap and you will suddenly "get it."

(Emphasis mine.)

I cannot find a single fault in this passage.

It's encouraging and it keeps you grounded at the same time. It spells out the incredibly important study trick of "your tutorial is not a TV series, spoilers are good." It reminds me of what John von Neumann once said, that in mathematics you don't understand things, you get used to them (something should be taught to every child, to dispel that horrid idea that "I don't understand this" means "I'm hopelessly not good at this").

I want to stand up and cheer.

But then there are the quarter hours.

Twenty. Nine. Chapters. To. Get. To. See. An. If.

Twenty. Nine.

This self-discipline borders on masochism.

As someone who always finds it easier to solve other people's problems than to imagine brand new problems (although I'm good at finding the problematic limits of any solution; but I digress) I truly appreciate the incredible amount of exercises that the book offers. But there's a terrible side effect of this "old master teaches young apprentice by the way of apparently mundane and repetitive tasks" approach: the young apprentice becomes so diligent that they never step out of line. It's not just a matter of being overwhelmed by the amount of lines that you have to copy: it's ending up depending on the teacher even to break the toy to see what's in there.

Perhaps I'm giving for granted the desire to rebel. The joy of "hey, let's see what it happens if I turn left instead of right as you told me!" The mindset of not taking anything for granted.

(I'm not sure whether the paragraph above is more introspective or paradoxical.)

If you don't have this questioning instinct, it's likely that Learn Python The Hard Way is the perfect book to kickstart it; and since this instinct is a fundamental tool in any scientific and technical field, The Hard Way could be a very good way to start your journey into programming.

By the way: The Hard Way will also take you quite far if you stick with it. Many of the topics in the poster are there.

I still think it's very hard, if not altogether impossible, to teach rebellion - especially through discipline. But maybe it's just my hedonism, all play and not enough work, no reverence to my betters.

You decide. I'm off to boost my rebellious feelings with some Wagner. The last quarter hour of The Valkyrie. Beautiful opera about a girl rebelling to her father to obey her father's wishes; it's worth sitting through all four hours (plus intervals) of it. By the way: have I ever told you that I love Wagner much more than I like Rossini? Personal taste can be so strange and, well, personal.

Everyone has their own way, after all.

Unfortunately necessary disclaimer: let's not go into the "Wagner and politics" or the "Wagner was an [expletive] who lived on his friends' money while having affairs with their wives" issue. At least, not here.