Hacks: What do you mean when you say, “I want to learn programming?”

6

Do you want to grok Abstract Syntax Trees and learn how to optimize tail recursion?

- OR -

Do you want to be more technical so you can better understand and manipulate the technology in your ecosystem?

This question was inspired by the varied responses to Brian’s question from May 13th about what to teach Librarians in a two-hour, intro-to-programming session.

Out of the five responses (in the first 19 hours) I think my answer is the most accurate AND the most impractical. It is essentially the equivalent of:

  SCENE: Man and woman standing on train platform.

  WOMAN: "Excuse me, Sir? Can you tell me the time?"

  MAN: LOOKS AT WRISTWATCH, THEN WOMAN.

       "Yes, I can."

       RESUMES READING NEWSPAPER.

Correct, but not helpful.

I’d like very much to be helpful. It would be illuminating to know what problems you are trying to solve when you think “I need to know programming.”

Maybe you don’t need to know programming. Maybe you just need to know how to frame the question so it can be answered by a program (or a programmer).

Maybe there needs to be course that teaches pseudocode for journalists.

So, Hacks, why do you want to learn programming?

Tags: asked May 14, 2010

Leave a Reply

12 Answers

7

Perhaps obviously, I believe the answer to this question differs dramatically from person to person, even in the same newsroom. That's why I think it's so hard to teach an intro.

For me, personally, at first I wanted to know enough to be able to communicate with programmers and understand what was possible. Knowing the difference between what would take a day and a month. What was worth me doing with basic tech skills vs. what someone could do faster programatically. That's a great way to start.

I ended up applying my journalistic curiosity to the skills behind the programming, though. Not enough to know you could develop a graph based off of variables calling a database, and that you could avoid making new graphs by hand every time news updated. I wanted to know the ins and out of how to do it, but didn't want to deal with it myself. That was Level 2.

Once I got a glimpse of how to do it, and felt the satisfaction of figuring something out, I wanted to develop it and make it happen. Now, I'm learning to be a programmer for news. This is Level 3.

There's an infinite number of levels ahead. I can't even tell you all the problems I want to solve, because I don't know what exists, still don't know the limit of what's possible. That's part of the fun. Perhaps the skill I need most is knowing how best to go about learning more. My current issue is improving my ability to structure complicated programs, and write functions in a more concise and efficient way.

Despite where I am now, if you tried to teach me about lists and dictionaries when I was back at Level 1, I bet I would have bailed. I think formal intros are good for a push in the right direction, but going really deep is something you have to commit to on your own.

Leave a Reply

120
4

It's worth considering the large difference between what I call "plumbing" programming and actual computer science.

Most web developers, (for the most part, I include myself in this), spend nearly all of their time making various libraries working with other libraries, getting data from one place to another, and presenting data. As much as I understand tail recursion (and actually, I don't grok ASTs), as a developer I don't need those skills, and journalists need them even less.

The best developers (as opposed to hardcore "computer scientists") I know exercise skill in understanding which libraries in their box of tools best apply to the problem at hand, and are then efficient at "plumbing" them together.

Whenever I've worked with journalists who are interested in being able to program, it's because they've seen several tools that they know could work well together, but they don't know how to make that happen. I think these are the skills that are most worth passing on.

markng
100
  1. and I guess I think the answer is “somewhere in between”. Some journalists are better off with an understanding of what’s possible, and some better with the ability to create working prototypes.

  2. well, actually, I’m a developer. (and re AST, I understand what it is, but I’ve never attempted to work with one :) ). My comment is more about what journalists I’ve worked with have been interested in.

  3. So, is it fair to roughly categorize your response in the “wanting to be more technical” camp?

    (*lagniappe:* AST is to program code as DOM is to HTML page)

Leave a Reply

100
3

Mark, this is a great question. When I was taking early classes in computer science I remember a teacher describe functions (and later, objects) as black boxes. You input things into the black box, "something happens," and then you get an answer. The goal of computer science is to make these black boxes. You reduce complicated problems (sorting things, routing airplanes) into algorithms/functions/classes that take inputs and give answers.

I think when most people are talking about "programming," however, they're talking about USING the black boxes rather than building them. They want to learn what it means to query an API and put it onto a map, or make a word cloud -- what Mark Ng called "plumbing."

I think the specific application of programming varies by project, but generally falls into one or more of three categories: collecting information, analyzing/organizing information, or presenting information.

While I think most people hope to achieve plumber status of programmer, there's definitely a group out there who simply wants to know how to communicate with the plumber and know whether they're getting ripped off.

I guess at the end of the day we're all black box plumbers?

Leave a Reply

115
2

The person asking the question should have a clear set of goals.

I would frame what I want to learn in three ways. I want to learn how to:

  1. Think computationally
  2. Think like programmer
  3. Use different web scripting languages (specifically PHP and JavaScript).

Besides maybe not knowing what they want to learn, hacks sometimes also don't know what certain terms mean. For example, I've heard people call HTML "programming" instead of markup.

Leave a Reply

544
2

Probably the primary thing I'd want to do is scrape websites for information... Followed closely with mashing different sources together... Followed closely by visualisation.

Getting more ambitious, I'd like to create tools that allow users to interrogate and mix data in similar ways.

At the moment I'm trying to get my head around Ruby on Rails and Python primarily.

  1. Thanks – as my objective is understanding rather than employability knowing something about both is probably most useful. My learning of Python is very much geared towards Scraperwiki rather than anything from the ground up, so it’s likely that I’ll end up going deeper with Rails. In other words, at this point I guess I’m learning enough about both to decide which one I take on further. I’ll see where things take me – enjoying it so far.

  2. Paul: I suggest you pick one language and go deep. There’s not a lot of call for a beginner to know multiple programming languages, so figure out for which one you have the best support environment and dive in. Certainly, if you post your questions here, there are folks who know both languages and others.

Leave a Reply

30
2

For me its about control.

I want to remove the layers it takes for me to disseminate information. I don't want to have to rely on a designer or programmer for anything.

Leave a Reply

30
2

When I first said those fatal six words ("I want to learn to program") I was thinking about cleaning and manipulating data -- essentially automating some of the excel tasks I was doing to clean up a big dirty dataset into something I could work with for a sweeps story. I imagine I'm not the first to think that; but what that works out to -- text processing and database interface -- was a good place to start learning.

The other thing that newbie geeks, including myself, always seem to find sexy is scraping online databases. My first real effort at web programming came when the state Department of Justice told me they wouldn't release a copy of their Megan's Law database (you know, the same one they ALREADY PUT ONLINE behind some god awful 1998-looking asp-and-arcIMS-powered sort-of-searchable front end. Yeah, that one...). Never underestimate the inspirational power of anger -- it taught me to use urllib2 and Beautiful Soup.

Though actually, what I was REALLY thinking when I said "I want to learn to program" was that scene in Terminator 2 when John Conner hacks the ATM.

Leave a Reply

40
2

As a Python developer, I've used BeautifulSoup and LXML to parse HTML pages grabbed from the web As mentioned above, BeautifulSoup has made some compatibility missteps in version updates, and LXML is generally considered faster, so I'd generally recommend LXML first.

LXML requires C libraries, while BeautifulSoup is pure python, so installing is sometimes a challenge: Mac users especially used to hit problems with running installer packages, although I think that is mostly past history, but if you run into problems, google for install lxml mac and if you still have problems, post a top-level question here and we can assemble instructions under a clear question header.

I learned to use BeautifulSoup from some of the interesting applied tutorials in the O'Reilly book Programming Collective Intelligence which provides an interesting balance between teaching coding (for people with moderate past Python experience) and teaching algorithms and advanced big-data-processing strategies (a lot less background in that is necessary to understand the book.) One reason I'm enthusiastic about this book is that it provides a good introduction to BeautifulSoup and several other real libraries and information services, in parallel to the declared subject matter.

Regarding PHP, I'm a novice at best. I haven't used this tool, but Daniel Berger offered it to the NICAR-L list in a similar thread:

http://sourceforge.net/projects/simplehtmldom/

Leave a Reply

351
1

I do a lot of work with data in a very small newsroom. Our editors have expressed interest in us doing more with visualization, but my skills are limited.

When I say I want to learn programming, I mean, I want to look at Flowing Data's tutorial on heat maps using R and be able to follow along.

I want to open up an API key and not have it read like gibberish.

I want to be able to see .GPX and KML files and be able to work with them (no more hand plotting on Google Maps for idiots, please)

Right now I'm in a place where I understand a little, and can group vis softwares and database managers into "things I can do" and "things I need to learn up in order to do" - the trick is getting to the next step. I'm thinking of starting with learning javascript?

  1. Chrys, Greg, Mark – thanks this is all really great advice. I really appreciate it! The resources are great, they’re getting bookmarked NOW.

  2. If your concern is that you can do the tutorials, but feel fuzzy on deep understanding, read documentation, go to workshops and meetups, Google a lot, and find people who have the time and willingness to coach you. DevChix is an active community of women developers who want more women to become good developers (http://www.devchix.com/). They’re starting an experiment in pair programming. Pick a skill you’d like to get really good at, and see if someone can help.

  3. For those new to development, the next step is best driven by “I have something I’d like to do. How do I do it?” And really, only way is to find help and do it.

    re: FlowingData tutorial, Nathan, who is a smart and excellent human being, handholds readers through the process. Do the lesson with his dataset to get things rolling. Once you succeed, try with other datasets.

    API key: Do you mean the API itself? The key is usually an authorization code that allows you to use the API.

    GPX & KML: Download Google Earth, which will display KML files. Then read this thread: http://cwu.me/bPGGXy

  4. Emma, have you seen the H&H thread on data visualization?

    http://help.hackshackers.com/questions/36/basic-data-visualization-tools

    One thing I suggest there are SIMILE widgets, with more on them in this comment. http://help.hackshackers.com/questions/194/canvas-vs-flash-or-flash-to-canvas-export-but-canvas-really-what-do-you-thin/196#196 SIMILE is well-documented and there’s a lot you can do using the framework they provide with basic knowledge of JavaScript.

  5. Emma, have you seen the H&H thread on [data visualization][1]?

    One thing I suggest there are [SIMILE widgets][2], with more on them in [this comment][3]. SIMILE is well-documented and there’s a lot you can do using the framework they provide with basic knowledge of JavaScript.

    [1]: http://help.hackshackers.com/questions/36/basic-data-visualization-tools
    [2]: http://simile-widgets.org/
    [3]: http://help.hackshackers.com/questions/194/canvas-vs-flash-or-flash-to-canvas-export-but-canvas-really-what-do-you-thin/196#196

  6. You might get a lot of mileage from learning R, or Processing (processing.org).

    They are both programming environments and are used for visualization. So, you’d get better at programming and have some useful output.

  7. Thanks Joe. I’m hearing on two sides – a) Javascript is a good place to start, but then from others, b) it may not be the best place to start. Thanks for adding your two cents. I have a very loose sense of what end-products I’d like to be able to have a hand in, but less sure of which tools I need to get there.

  8. Emma, I am not sure that learning Javascript will specifically help you. It doesn’t connect to anything else you listed.

    Regarding R, I’m a newbie to it, although I’m an experienced programmer. I found some decent online documentation, and found O’Reilly’s “R in a Nutshell” to have some nice tutorial work. I’m also looking forward to participating in Chicago’s new R Users’ Group—see if there’s one in your town.

    In my experience, API keys are *supposed* to look like gibberish! :)

    And don’t let me stop you from learning JS. I’m just pointing out it may not be what you need.

Leave a Reply

30
1

Good question. I want to learn for a couple of reasons, but mostly because certain problems arise in my daily (online) life that require solutions that don't exist. At least, not to my knowledge... In some cases, programming can help.

The first - and only - tool I ever built is a pretty simple one. And it's a case that illustrates my motivations to learn pretty well. I wanted a service that would give me RSS feeds for a single search term across many platforms (Twitter, Delicious, YouTube, Google News, Yahoo News, and some Asian equivalents). By using some simple string replacement, the result was this. I tried using simple pie to parse the resultant feeds on the bottom, but with no luck so far. My code is here if anyone wants take a peek (please don't laugh!). I think a tool like this - if built properly - would be super useful for research.

  1. Have you looked at Google Reader? You might find it does what you need.

  2. Rick: I think it would be great if you could articulate more what problems you’ve run into and post it as a top-level question here so that people can see it better. You’re more likely to get help and you’ll leave a trail for the next folks that come along…

Leave a Reply

247
0

Emma, have you seen the H&H thread on data visualization?

One thing I suggest there are SIMILE widgets, with more on them in this comment. SIMILE is well-documented and there's a lot you can do using the framework they provide with basic knowledge of JavaScript.

Leave a Reply

544
0

I'd like to answer this from a skewed position: I want to teach journalism students some foundation skills in programming. Why? Because if they have some basic knowledge (like what I got in a FORTRAN course as an undergrad), they will find it much easier to tackle whichever language turns out to be useful the first time they really want to do a project.

Right now we have smart students who are good at design, majoring in journalism, and interested in doing some data visualizations or interactive projects -- but they've never been introduced to any kind of programming at all. I want them to see that it is not as hard as they imagine it to be. I want them to see, for example, how a loop automates a task that otherwise would be impossibly long, and understand that it could also be useful for so many other tasks.

I don't want to force them to simply do a programming project. I want them to understand the application of programming basics to a myriad of diverse problems.

Like Emma Carew, I think JavaScript might be a good starter language -- especially given that students can execute it without having root access on any server.

Leave a Reply

30

Your Answer

Please login to post questions.