What students said about this course in spring 2014

These are bona fide, unedited student comments from the official UF student course evaluations site. Those with no answer or “n/a” or “none” have been omitted. Students were all undergraduates in journalism or advertising who had no previous programming experience. Only eight students were enrolled in this course.

Qualities of instructor which contributed to success of the course:

“Her enthusiasm and clear description of the course and how much time we would have to devote to it to be successful.”

“She is very passionate about the course and the material which makes me what to learn more about the material as well.”

“Her enthusiasm for the subject material and our understanding of it made difficult course material easier to understand. She was always willing to give additional help, even outside of class and after work hours. The class was also broken down really intelligently so that we had a good foundation for more difficult material later in the course.”

“Ms. McAdams encouragement to play with code helped with my success in this course.” Continue reading

How we use algorithms

Many students had difficulty figuring out how to code the number guessing game in class on Monday, Feb. 24.

You already know ALL of the building blocks of programming. This is (pretty much) everything:

  • variables
  • functions
  • if statements
  • loops (for and while)

So here is something else to think about:

Algorithms

An algorithm is like a recipe: a step-by-step process for performing some activity. You may look at an algorithm as the steps your program goes through to solve a problem. For example:

High Score Algorithm

  1. Game is over
  2. Compare player’s score to high score
  3. If player’s score is greater than the high score then the high score variable is reassigned the player’s score
  4. Display new high score

There are algorithms that exist for many common programming problems such as sorts and indexes. (source)

This is the problem-solving method you will need to develop. When I told you “break it down,” this shows one example of breaking down a problem that needs to be solved. What do I want to do? I want to tell the player if she has the high score. How do I find out of she has the high score? And so on.

You must first reason through the TASKS you want to do. THEN think about the code you will need to write to make it happen.

Example

Imagine a dice-throwing game: Any player who gets doubles will win.

  1. Player throws two dice.
  2. Computer throws two dice.
  3. Did both get doubles? (What happens?)
  4. Did only one get doubles? (What happens?)
  5. Did no one get doubles? (What happens?)

Now, the algorithm:

  1. Throw two dice for the player. Save two numbers, possible 1 through 6 for each.
  2. Throw two dice for the computer. Save two numbers, possible1 through 6 for each.
  3. Compare two faces of the player’s dice to check for doubles.
  4. Compare two faces of the computer’s dice to check for doubles.
  5. If no one has doubles, announce or print that.
  6. If both have doubles, announce that it is a tie.
  7. If the human has doubles, announce that the human wins.
  8. If the computer has doubles, announce that the computer wins.

The order of 5 through 8 might change, depending on how you want to write your if-statement.

Here is another example (a very simple one).

You can do this in either Python OR JavaScript! Give it a try!

Double major in journalism and computer science

This quote —

… the fields of mathematics, statistics and computer science are ever more important to the emerging fields of data journalism, information graphics, and news applications. That’s where the jobs are. That’s where the industry is heading (arguably, already it’s already there). That’s the new quality and standard to which we need to hold journalism.

We’re never going to fill these jobs or really make impact in this space and push forward if we don’t properly teach and prepare the young’uns coming up. Myself included.

— comes from an article written by a journalism student. You should read it:

Re-thinking J-school, by Katie Zhu.

Do you feel like writing code is still hard for you?

In this very amusing blog post (you must read it to the end!), by student Michelle Bu, you’ll find out how hard her first coding experience was for her:

21 Nested Callbacks

I was laughing out loud as I read it.

I’ve realized that with each piece of code I’ve written since my triangles, I’ve only gotten better at “Googling it,” debugging, and being generally competent about miscellaneous programming topics–and it’s all because I saw each and every silly project through. — Michelle Bu

So 21 months ago, she didn’t even know how to write a loop. Now she’s a Ph.D. student in computer science.

Here is her first attempt (21 months ago), and here is her new, responsive, fabulous version.

Check out Michelle’s Projects.

Other ways to learn Web stuff

CodePen’s Pattern Rodeo offers you a fun way to test your skills. The weekly contest ran for four weeks. Each week had a different theme. Check out the winners! When you click the winner’s name, you can see (and copy) his/her CSS and JavaScript.

CodePen is a website where you can view other people’s CSS and JavaScript and HTML. It’s a great place to explore. You can look around as much as you want without signing up for an account. Or sign up (it’s free) and play there yourself.

Another fun place to play around is Mozilla Thimble. Some of the stuff here is too simple for you now, but there’s lot’s of good HTML know-how here that might be new to you. For example, learn about CSS positioning by playing with zombies!

Another part of Codecademy is the APIs section. There are projects here that let you use Python. There are some other projects for JavaScript. In these projects, you can learn how to build apps. Yes, apps!

Thinking like a programmer

One thing I hope you will get out of this course is an understanding of how programming (and programmers) work. This is valuable even if you don’t actually do programming yourself.

I think the ability to mark-up some HTML and understand why <span>, <div>, classes and IDs are important for CSS and Javascript is essential for anyone publishing on the web.

But my answer is that no, journalists don’t all need to be able to write programs, but the ability to think like a programmer is an invaluable skill.

That quote comes from Do journalists need to learn to be programmers? Yes. And no. — a 2010 article by journalist-programmer Martin Belam.

More recently, Belam wrote about how two journalists described their newsroom at the Financial Times of London (this is the British Wall Street Journal) and how they handle data graphics and other interactives: “Data Journalism: not the job of one department” – Emily Cadman & Martin Stabe at Hacks/Hackers London.

Tips for your Python work

I try to avoid making too many posts on the course blog, because I know some students find it annoying. Usually I will post only once a week, now that we are under way with the course — but this is an exception.

How to Properly Comment Your Code is a handout from an MIT course called A Gentle Introduction to Programming. You should look at it.

Python Comments

Comments in your code are not for me, the instructor. They are for YOU. When we learn a new programming language, we must figure things out as we go along. Writing clear, helpful comments will help you learn.

In professional code, comments are also useful for coders who come later and need to use or revise the code that someone else wrote. That will not be the case with your early code exercises, but you should know that comments are not only for beginners.

Why would a journalism student learn to code?

This is a good question. If you don’t know WHY people are urging journalists to learn how to code, you probably wouldn’t work very hard to do it yourself.

The biggest reason, maybe, is that code is what determines HOW journalism stories speak to people.

In this interview, the design director for BostonGlobe.com explained how code and design work together in journalism.

Later, that same design director (now in a new job at Northwestern University) explained why journalism schools must teach students to code.

When then New York City mayor Michael Bloomberg said he wanted to learn how to code, the Internetz went a little crazy with reactions. Then there was this reaction to the reactions:

Six Reasons a Non-Computer Nerd Might Want to Learn to Code

I think a good perspective for journalists and journalism students to adopt would echo this statement by Zed A. Shaw, a programmer:

People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines.

People who can code have something extra to offer. In a highly competitive job market, that’s a really good thing. Especially for a journalist!