Archives for : May2013

Code in the Classroom

This is an excerpt of an article by Jon L. Denby of NYU explaining a Coding 101 course using our curriculum. If you’re interested in using Codecademy in the classroom, get started here.

“If you don’t speak ‘computer’ in our current economy, it’s a little like not being able to read the street signs; it’s a major handicap,” says Leibovitz.

Thankfully, there is no shortage of students eager to learn.

Leibovitz’s first class, co-taught with programmer David Hu in fall 2012, had only 50 seats available. They were all reserved in less than three minutes of class registration opening, and the wait list grew to 120 students.

While teaching courses at NYU Steinhardt like Video Game Theory, Video Game Industry, and Digital Literacy, Professor Leibovitz realized that many of his students lacked an understanding of how digital systems actually worked. He was looking for a simple way to teach his students computer programming when he stumbled upon the Codecademy website:

I realized it was a really, really good solution for several reasons. First of all, it was something that was modular. You could do it on your own time. You could do several units, or all the units or tracks. It really gave you options. It was also based on real-world, complete projects—I mean every single track that you have there is based on building a game, building a tip-calculator, building a Blackjack game, building a choose-your-own-adventure game—all kinds of real-world projects. It was written in this language that I thought would resonate tremendously well with our students because it was down to earth, it was English, it was easy to understand.

Continue reading here.

Getting Comfortable in the Terminal: Linux

This is a guest post by Daniel Seymour, one of the Codecademy moderators, with editing help from Alex Craig and Dustin Goodman.

“I see a blinking cursor. WHAT DO I DO?!”

When you hear the word “command line”, “terminal,” or “little window that tells a computer what to do but only has a flashing cursor in it,” what comes to mind? Do you scream and hide under your bed? Or do you look at me inquisitively and wonder why I would bring such a scary thing up?

I hate to tell you this, but you MUST conquer your fear of the terminal (if you have a fear) and learn how to use that annoying little window with a flashing line in it. A *nix (Unix (like Mac), Linux) system is an operating system that can enable you to do some rather amazing stuff quite quickly, if you know what you are doing in the terminal. Before I start throwing terms at you I need to define a few.

Basic Terms

OS:Operating System, the program that tells the different pieces of hardware how to work together to make a comprehensive system.GUI:Graphical User Interface, essentially the little window that has buttons you can click that often hides the power of the terminal.Terminal:Part of the computer that allows you to issue commands to the computer and directly interface with the OS.Executable:Executable file, file used to execute a program on your computer.

Now that you have a rudimentary computer vocabulary, you can start conquering your fear. I use the terminal all the time and am able to do basic things faster, such as pushing to Github, connecting to a network, etc. I currently use a command-line-based Linux distribution. On the rare occasion that I have to use Windows, most of the basic jobs of the computer, such as connecting to a wifi network, take so long that I feel like I am waiting for a marathon to end.

Step 1: Find your Terminal

So how should you start conquering your fear? I would suggest finding the terminal on your system. For this first part, I am going to assume that you are using a Linux distribution such as Ubuntu, Linux Mint, Fedora, OpenSUSE, or Debian (to name a few). On any regular GUI-based Linux system, go to the applications menu and search for terminal. When you find it, open it and stare at that blinking cursor for a few seconds while saying, “I will learn to use this thing.” (You can skip the staring if you want.)

Step 2: Start an Application

The most basic operation that a user can do from the terminal is start an application. On almost every Linux system, simply using the name of the executable in the /usr/bin directory will start the application. For example, starting the Firefox web browser simply requires typing “firefox” into the command line and pressing enter. You should now see a session of Firefox launch on your desktop. Congratulations! You just executed your first command from the terminal!

Note: Launching an application from the terminal will lock that terminal instance so that you cannot do anything else with it. If you want to be able to use the terminal for other activities, trailing the application executable name with a “&” will put the process in the background of the terminal and you will be able to use the terminal for other things.

Step 3: Get Specific

Launching an application is not all that the terminal can do. You can launch applications and tell the application to edit such and such file (in the case of a text editor, such as Nano, Vim, or Emacs. Nano is the default terminal text editor for most Linux distributions) or you can tell a web browser to launch such and such a web page. For example, the command:

firefox www.codecademy.com

will launch a session of firefox and open the session on the Codecademy home page.

Step 4: Entering Commands

Now that you know how to launch an application, you will also need to know how to traverse the file system straight from the terminal as doing so is a big part of many operations that are done in the terminal.

To start off, enter the command pwd. You should now see something along the lines of

/home/{username}/

The above command stands for Print Working Directory so the directory that you see posted to the terminal is the directory that the terminal is currently in. Now enter the command “ls”. You should now see something along the lines of:

Desktop/ Documents/ Downloads/ Music/ Pictures/ Videos/

And all of the other folders that your home directory contains. The ls command can be thought of as standing for LiSt the contents of the present folder.

A Brief Note on Flags

Before we go any further, you will need to know about flags. Flags are options that are passed to a command that extend the command to accomplish another task at the same time.

Now type the command ls -a (-a meaning all). You should see everything that you saw using the ls command but also you should see a bunch of folders and files that begin with a .. These extra files/folders are “hidden” so as not to clutter up your home directory with files that you may only open once in the life of the computer (if that). As you may have guessed, the difference between a hidden and not hidden file is the beginning dot. The dot tells Linux to hide the folder/file.

Step 5: Change Directories

One last command that you must know to be able to start using the terminal effectively is the cd command. If you type cd by itself, you most likely will go back to your home directory or nothing will happen. This is because the cd command stands for Change Directory.

Because you didn’t pass cd an argument, the terminal has no clue what folder it should enter. The most important cd arguments that you will need to know are {childFolderName}, .., . and ~.

{childFolderName} argument tells the terminal to enter the folder in the current directory by the name of {childFolderName} .. tells the terminal to go to the parent folder of the current directory . when used in conjunction with /{folderName} tells the terminal to enter the child folder of the current directory by the name of {folderName} ~ tells the terminal to go back to the home directory (/home/{username}).

Other Useful Commands

Here is a list of other commands that you will probably find useful:

mkdir “Makes” a directory in the file system at the specified filepath. rm Deletes (“removes”) the file at the specified file path. rmdir Deletes the directory at the specified path. man Opens the MANual pages for the specified command or application. For example, man ls will open the man page that contains all of the information and flag options for the “list” command. This is especially useful to see if a program offers any extra functionality or to figure out how to configure a program.

That’s it! Now you’re ready to get started in your terminal.

Bringing back keyboard shortcuts

Since introducing the new coding interface the much loved keyboard shortcuts have been amiss. Now we’re bringing them back.

Here’s a cheat-sheet you can follow

Reset ExerciseCompletely messed up a solution? Start fresh. * Windows: Alt-R * Mac: Option-R

Next ExercisePeek at the exercises ahead. Get excited by what the section has in store you! * Windows: Alt-P * Mac: Option-P

Previous Exercise Want to retrace your steps to solve the current problem? Revisit an exercise to see all you’ve done! * Windows: Alt-O * Mac: Option-O

Save and SubmitReady to see if it works? * Windows: Control-Enter * Mac: Command-Enter

That’s it! To start using them, go try out an exercise like this one in JavaScript.

To infinity, and beyond!

Designer Olivia Cheng and her Codecademy team’s project Mars Watchtower was selected as a winner for Virtual Participation in the International Space Apps Challenge. We interviewed her to find out how the magic happened.

What led you to apply for the hackathon?

I saw it on Twitter and thought to myself, “Wow, it would be so awesome be involved in that” and then, “Well, why not?” I couldn’t attend any of the physical hackathons, but I saw there was a virtual location option. Couldn’t hurt to try!

How did you find your team?

I reached out to the Codeacademy group The Open Source Project to see if anyone would be interested, and got positive responses. I thought it would be a good fit since any project submitted to the Space Apps Challenge would be open source, and our team ended up with 5 members total.

What was it like to working together virtually?

I always planned on contributing to one of the GitHub projects started by the group, but I hadn’t expected to work with other members in real-time—there’s a big difference.

Because of the time zone difference, we took shifts coding—one of us about to sleep would fill the other people in on the progress and what tasks remained. There were hiccups, of course—occasionally someone would accidentally overwrite another person’s code, and sometimes a whole page of code would get wiped if Cloud9 IDE crashed while saving (oops!).

Any advice for people who want to do a hackathon?

Plan well. Do as much planning as possible ahead of time or in early hours because you have limited time to do what you need to get done. If you’re in a team, have a project manager to coordinate everyone’s efforts. Collaborating online can be a lot harder than in person, especially when you can’t just walk over to your teammate to quickly discuss something, so set up a workflow ahead of time.

We ended up using Workflowy for managing tasks and Cloud9 IDE for sharing code. Cloud9 IDE allowed us to write, edit and run our code with other team members simultaneously without the hassle of setting up individual local environments.

So… what’s next?

I’ll keep the project up on GitHub here so that team members (or anyone else) can continue to contribute. Although we didn’t win any global awards, our work paid off—we were selected as one of four winners for Virtual Participation.

As for the Codecademy group, I’ve been talking with the leaders of The Open Source Project and there are some ideas floating around to kickstart some projects in a hackathon-style… so we’ll see where that goes

How Knitters are Human Computers

This is a guest post by M.K. Carroll, Crochet Editor at Cooperative Press and Knit Edge magazine. Have something you’d like to share on our blog? Drop us a line.

It’s a popular hobby, practiced by people all over the world. At its most basic, it’s a loop of string and two pointy sticks. The loops can be combined in various ways to create a wide variety of things, from the practical and useful to the whimsical and just plain weird. In other words, knitting is a lot like coding.

Say what?

*k2, p2, 2/2 LC; rep from *, end k2.

What you see above could be described as a line of knitting code: a set of instructions that you can use to execute a row of knitting. Combined with additional lines of code, these instructions (commonly referred to as a knitting pattern) can be used to create a recognizable item, such as a sweater or a pair of socks.

Knitting — like coding — gives you the freedom to create

You can buy a sweater ready-made with a lot less effort than it would take to knit one, but there are a lot of reasons why you might want to knit that sweater yourself, like having one that fits you perfectly. You could also spend a lot of time trying to find one to buy, or a lot of money getting someone else to design and knit it for you. Sometimes – like learning how to code – learning how to create is how you get exactly what you want.

One line at a time…

Knitters and other “yarncrafters” (like crocheters and weavers) understand what it means to build something one stitch (bit) at a time, and yarncrafting pattern designers (coders) know what it means to code, use an API, design, test, debug, and maintain the source code – even if they don’t realize it yet. Daniella Nii says that:

“Just as in coding, attention to detail and syntax are crucial to a successful execution of a pattern (program). An overlooked parenthesis, comma or repeat can result in a piece of code that doesn’t compile and will interrupt the flow of the program, possibly discovered when the next line of instructions will not work with what the knitter has on the needles.”

Knitters know how to learn and “speak” a different language already, and learning how to code could mean being able to design and build the knitting app they want, without having to hope that someone else will. Not bad for something that starts with two sticks and some string!

Know how to knit? Learn how to code!

If you are a yarncrafter, you are already predisposed to learn how to code. Do you think it would be awesome to play a video game based on knitting? You can learn how to make one. Would you like to sell your crocheted mustaches on your own website? You can learn how to build a website and storefront too. Do you think PlaceKitten is an awesome API, but would be improved with yarn? You can learn how to use APIs to make the app that you want, instead of settling for an app designed for someone else.

Know how to code? Well…

If you are learning how to code and enjoying it, you may also enjoy learning how to knit, crochet, or spin. After all, if you want to build a website to look and function in just the right way for you, you may also be the kind of person who would want to knit a pair of Dalek patterned mittens that fit you perfectly.

Thanks to the yarncrafting coders LeTonBeau (on Ravelry.com), Daniela Nii (nikkisstudio on Ravelry.com), and Megan of stockinettezombies.com for volunteering to check my analogies and make sure they were accurate!

Looking for a Few Good Fellows

We’re looking for a few good fellows to come join our team!

The Codecademy Fellowship gives curious college students the chance to spend one year as professional software engineers working at a startup driven to change how people learn.

This spring we’ve had the pleasure of having Bob & Louis with us. Learn what they have to say about the experience below!

Meet the Current Fellows

Louis, MIT ’14

Bob, UIUC ’14

Why were you interested in becoming a Codecademy Fellow?

Bob: It seemed like an incredible opportunity to work with a very talented team working on a great mission.Louis: Gaining some practical industry experience that would apply some of the things I learned in school seemed like a great next step to shape my career.

What projects are you working on at Codecademy?

Louis: I am working on the interactive evaluation environment for languages like Python, Ruby and recently released PHP.Bob: I’ve spent most of my time here building the new Learning Interface.

How has the fellowship met your expectations?

Louis: They have been more than met. My expectations were to work with smart and driven people on problems that challenged me and gave me the opportunity to learn.Bob: Definitely. It’s an incredible learning experience to ship code everyday at a fast paced startup like Codecademy.

What is the best part about living in New York?

Bob: The energy of the city really is undeniable. There’s always something going on, new things to experience and learn.Louis: It’s been exciting to be part of the diverse and growing tech community in New York.

Any advice for future fellows?

Louis: Think about yourself and your education critically – what are you good at, where do you lack experience? The fellowship is an opportunity to learn things that you couldn’t learn in a classroom or internship.Bob: Be very specific with your application. Show us your personality, emphasize what makes you unique.

Codecademy Meetups!

Editor’s note: This post is about our NYC Meetup. You can find a Codecademy meetup near you on our Meetup page! To get help hosting a meetup, reach out here.

Learning to code on your own can be tough.

That’s why each month we host meetups for people to come and learn together. This month we were lucky enough to have journalist and Code Year veteran David Bauer come and present.

tumblr_mn89ufJmIj1s0a0dko2_1280.jpg1280x956

David wanted to do something better with code than creating arrays of zoo animals; so he decided to create Instacurate to visualizes tweets using Twitter’s API. (To learn how to use Twitter’s API yourself, try out this course.)

After a brief Q&A we broke into groups to explore the questions the group most wondered about:

1. What language should I start with?2. How do I get started coding on my own computer? 3. What should I make with what I’m learning?

If you can learn, you can teach, and this gave everyone an opportunity to help out. Bravo!

Until next time, happy coding!

How to Outgrow the Fear of Starting

Why did you want to learn to code?

I’ve always been the type of person whose mind is continuously racing with startup ideas. My wife is forced to act as the sounding board for all of my hair brained schemes, and I’m always sure to remind her when a startup is successful with “AN IDEA I THOUGHT OF AGES AGO!” At some point, I decided (she decided) if I wanted to stop talking and start doing, I’d need to learn to code.

When looking around online at the available options, I really wanted something hands-on and not just endless video tutorials. Codecademy definitely fit the bill.

Where did the idea for Outgrow.me come from? And how did you get started?

As an avid backer of Kickstarter and Indiegogo projects, I would often wait months for projects to fulfill rewards, and I’d sometimes miss campaigns and have no way to follow up on when the product I wanted would be available. I saw a need for an online marketplace for crowdfunded projects and decided to make it my first project, Outgrow.me

When starting with Codecademy, I was amazed at how quickly I was able to pick up the information. After just a couple of weeks I was convinced I had amassed a huge wealth of knowledge (I didn’t) and was fully capable of launching my first website (I wasn’t). What I didn’t know yet I figured I’d be able to learn on Codecademy while working on a project simultaneously (this turned out to be true!).

What kept you going when you hit problems?

Blind determination. I set my mind to it and decided nothing was going to stop me. In a very genuine way, at no point was failure on my list of options.

What are your own plans next with regards to code?

I’m really focused on learning Rails and APIs with the new tracks made on Codecademy. I’m working on a new, more complex project and I’m excited for what’s to come!

What are the first steps you’d recommend for someone who’s interested in learning to apply programming in their work?

First, just start. Start somewhere. Start anywhere. Just start! Second, stay positive. It’s easy to get overwhelmed and give up when the going gets tough. The key is to stay positive. The worst thing for a project is negativity. A favorite quote of mine: “Think good and it will be good.” – Rabbi M. M. Schneerson.

Get started today with JavaScript! Or if you have a story you’d like to share, let us know.