What Language Do You Need to Know?

This is a post by Eric Weinstein, creator of many Codecademy courses and a current student at Hacker School.

There's a lot to learn when it comes to coding. How do you know where to start? Should you learn HTML or JavaScript? What's the difference between Python and Ruby? What are "client-side" and "server-side" languages, "front end" and "back end" and how are they different? Hopefully this quick post will help you choose the language best suited for what you want to do.

To edit webpages

If you're interested in creating a static website or a single webpage, you should start with Web Fundamentals of HTML and CSS. HTML stands for Hyper Text Markup Language and describes the structure of webpages. CSS stands for Cascading Style Sheets, and controls their appearance — for example, the font color or the position of text on the page.

To make them interactive

If you want to give your website behavior—think automatic Twitter updates, your Facebook notifications, or the ability to drag and drop elements of your LinkedIn profile—then you'll want to learn JavaScript and jQuery. JavaScript is a frontend, or "client-side" language which means it runs on the web browser of the person visiting your site. jQuery is a library of specific JavaScript tools designed to make website interaction more awesome.

To store user information

If you want to develop a full-blown web app that lets users log in and saves information for them (such as tweets, Facebook posts, or Codecademy badges), you'll want to learn a backend, or "server-side" language like PHP, Python, Ruby or JavaScript (it's ambidextrous). These languages run on the computer where the website code lives, also called the server. You can accomplish the same things and build the same kinds of projects with each of them, so go ahead and pick your favorite!

Which language will you start with?

Floor Drees: How to Learn by Teaching

This is a guest post from Floor Drees, who is organizing a beginner's course in Python in Vienna, Austria on July 20th.

Floor

Who are you and what are you about?

My name is Floor (yes, really) Drees, and I'm originally from The Netherlands. Currently I work as a tech reporter and developer evangelist in Austria, and make time to organize and coach at Rails Girls events, and co-organize the vienna.rb meetups and PyLadies events on the side.

After learning Rails, why did you decide to pick up Python?

For me, learning doesn't stop when you kind of understand one language. If anything, I learned a lot from looking at Rails and Java code at the same time! The similarities and differences help you get the hang of it.

You're just starting out with this language yourself — why teach it to others?

I'm somewhat confident with HTML, CSS and Rails and I like to share my experience when it comes to learning and teaching programming. I genuinely believe that teaching skyrockets your own learning curve and would encourage everyone to start coaching beginners, even if you feel you are still a beginner.

How did you start organizing coding events?

I tend to challenge myself and my ability to learn quite a bit — when I first thought about tackling Python I soon found myself starting my own PyLadies chapter in Vienna. PyLadies is this great worldwide network that empowers female coders in the Python community.

python

I boldly decided to list a beginners workshop on Meetup.com and then of course needed to come up with a program. After going through the Python track on Codecademy I decided I wasn't going to come up with something more fun to do — with such a great resource around, why not use it?

What can beginners do to get better at coding?

One fun way to better your programming skills is CheckiO, a web-based game where you need to code Python to get to the next level. This startup from the Ukraine lets you to challenge yourself and your friends to write more elegant code in a fun way.

Learning on your own tends to get lonely, so I'd advise anyone to look for user groups in their city. The Python community is very friendly and it shouldn't be a problem to find a mentor who is willing to answer your questions when you need.

Any parting words?

If you happen to be in Vienna next month, stop by our Pyladies event! Contrary to the name, anyone can apply to attend. We invite experienced Python developers to help you out, along with great sponsors and coaches for lightning talks. There will be cookies. And Codecademy stickers. ;)

The NSA, Code Literacy, and You

Whatever we might think of Edward Snowden’s release of classified documents detailing the NSA’s snooping on America’s - well, everyone’s - communications, at least we all now know what’s going on.

Sure, most of us on the coding side of the screen already knew the deal. I haven’t found a programmer who was surprised by the news that our emails, text messages, and phone calls are being logged and stored. If anything, most of them are surprised that the general public seems so shocked. What were people thinking? That Google just gives us services like Gmail for free? We pay for this stuff - not with cash, but with our data.

None of our data may be so interesting in itself, but when it’s combined with everyone else’s it reveals a whole lot of information about us. Using factor analysis and other statistical techniques, big data can identify members of a population who might be about to purchase a new car, trying to have a baby, or even about to change political affiliations. No logic is required; the people and machines analyzing big data sets don’t care about why one set of data points might indicate some other data point; they only care that it does.

As long as corporations from Facebook to Twitter are collecting and using this data, why shouldn’t government get in on the act? Instead of looking for potential car buyers or new mothers, however, government is looking for potential terrorists. Or at least that’s what they say. In reality, the sample size of known terrorists is so small that it’s essentially impossible to draw statistical conclusions about their data. The only way to know what they’re saying is to listen to what they’re saying. Luckily (or terrifyingly, depending on your perspective) voice calls can be scanned for keywords as easily as a text document. The conversation can then be parsed by humans to determine whether there’s a threat.

The big news here, if any, is that now this stuff is public knowledge. Most of my friends and colleagues knew about government surveillance of digital communications, already. Some former students had even told me about installing switches at cell phone companies to be used for government snooping. Others helped write the database architecture for facilities that store voicemail long after it has been “deleted” by its recipients. Most of them were relieved that the information they were afraid to leak themselves is finally out.

But they aren’t the only ones who had foreknowledge of this recent leak. Pretty much anybody who knows how code works was prepared for this sort of revelation. Because becoming code fluent is about more than simply knowing enough javascript to get a job. It’s a way to become familiar with the operating system on which the human drama is playing itself out.

Moreover, the better you understand the programs and platforms you use - and the permanence of almost everything you do online - the better equipped you will be to choose what the data watchers know about you, and what they don’t.

May the digitally illiterate proceed at their own risk. Once again, you have been warned.

Three Ways Coding Kickstarts Your Career

Whether it's moving up in your job or getting a new one entirely, there's always a way to put code to work for you. Here are three ways users have applied their new skillset to take them where they want to go.

1. Find a new job

liz

Liz was laid off from her administrative position this past November, and at 55 — without a college degree — she needed a way to make her resume stand a chance. Key web coding skills such as JavaScript, jQuery, Ruby, HTML/CSS, and Python helped shoot her to the head of the queue. What else? "My daily hard work on Codecademy gave me a feeling of competence, which helped me to be confident and knowledgeable in my interviews."

Find out how she did it

2. Land a promotion

tim

Tim's office at the University of York uses Google Forms to automate housing transfer requests from thousands of students. After a few lessons he used JavaScript to write a Google Apps Script that sends a confirmation email as well, and that project slowly grew into building an entire dashboard to manage the transfer process from start to finish. The result? A nice promotion to the Data Analysis team, and a big boost of confidence.

Read his story

3. Become a developer

jenni

While working in the music industry, Jennifer started dabbling in web development and noticed that the hours seemed to pass quicker than before. She decided to move from a full-time position in music to working as an intern and studying in the evenings — but, she says, "this really accelerated my learning. During the day, I continued to improve my HTML and CSS skills while I worked on the Codecademy JavaScript and jQuery coursework in the evenings." Slowly but surely she became a full-time staff developer and now works at a SaaS startup.

Get her tips

Angie Chang: How I Learned to Code

What did you study in college?

After barely passing the Computer Science major requirements at UC Berkeley, I decided to focus on easier topics to graduate with: English and Social Welfare.

How did you get into tech?

When I graduated I had years of building websites under my belt, so my first job was at a venture-backed startup. I quickly learned how lonely it can be as a woman on an all-male engineering teams, so I went on to start Women 2.0 to meet like-minded entrepreneurial women in tech, and then two years later started Bay Area Girl Geek Dinners to meet even MORE of them! Women in tech DO exist in droves!

Angie

What are you currently working on?

Currently I'm working to change the ratio of women in engineering as Director of Growth at Hackbright Academy. An accelerated software development program solely for women, we attract students from all over the world and pair them with software engineer mentors to help them find work in tech. Now our students are working at partner companies and commanding some pretty impressive salaries after graduating from the 10-week program.

When did you get into programming?

In high school we got AOL at home and I was fascinated by the Internet. I looked at the HTML behind the simple webpages in 1999, and learned to write my own code and put up webpages. As a shy and quiet student, I supported my friends in leadership positions by creating their websites, and they started referring me to paid positions. And so it goes.

How did you learn to program?

Learning to program is simply being curious about how things work. How does this webpage render? What makes that do that? You peek behind the curtain, like they did in Wizard of Oz, and find that it's lines of code that eventually make sense after you do a lot of Googling and asking questions.

mentoring

Google is a great resource for learning to program, as well as simply hanging out with other people who like to code. When sitting next to another person on their laptop coding (I think we call this "co-working" now), you can ask questions aloud and have them answered right away.

Your 140 character tip for aspiring founders?

Just start asking questions out loud - over Twitter, Facebook, LinkedIn - and you will learn from the answers you receive. Start iterating on your idea, and it will snowball.

Every Child Can Learn To Code

We are proud to partner with Google and Mozilla in supporting Code Club UK as it expands across the globe. We’ve seen the impact coding has on children first hand at Codecademy, and we are excited to watch Code Club open in more countries.

Github

Code Club UK is a volunteer network of after-school coding clubs that exposes children aged 9 to 11 to programming. Their open source Code Club World initiative now extends the same opportunity to children everywhere, with materials in Norwegian, Ukranian, German, Brazilian Portuguese and Dutch — as well as hosting them on GitHub for programmers worldwide to translate and use in their own coding clubs.

Their mission — "to give every child in the world a chance to learn to code — complements our own and we can't wait to see everyone, young and old, have the opportunity to learn to program. Onwards!

Your Guide to Semicolons in JavaScript

This is a guest post by moderator Alex J. If you see him in the forums, say hello!

When do you need a semicolon? Here's a handy cheat sheet...

Required: When two statements are on the same line

The semicolon is only obligatory when you have two or more statements on the same line:

var i = 0; i++        // <-- semicolon obligatory
                      //     (but optional before newline)
var i = 0             // <-- semicolon optional
    i++               // <-- semicolon optional

Optional: After statements

The semicolon in JavaScript is used to separate statements, but it can be omitted if the statement is followed by a line break (or there’s only one statement in a {block}). A statement is a piece of code that tells the computer to do something. Here are the most common types of statements:

var i;                        // variable declaration
i = 5;                        // value assignment
i = i + 1;                    // value assignment
i++;                          // same as above
var x = 9;                    // declaration & assignment
var fun = function() {...};   // var decl., assignmt, and func. defin.
alert("hi");                  // function call

All of these statements can end with a ; but none of them must. Some consider it a good habit to terminate each statement with a ; – that makes your code a little easier to parse, and to compress: if you remove line breaks you needn't worry about several statements ending up unseparated on the same line.

Avoid!

1. After a closing curly bracket

You shouldn’t put a semicolon after a closing curly bracket }. The only exceptions are assignment statements, such as var obj = {};, see above.

// NO semicolons after }:
if  (...) {...} else {...}
for (...) {...}
while (...) {...}

// BUT:
do {...} while (...);

// function statement: 
function (arg) { /*do this*/ } // NO semicolon after }

2. After the round bracket of an if, for, while or switch statement

It won't harm to put a semicolon after the { } of an if statement (it will be ignored, and you might see a warning that it's unnecessary). But a semicolon where it doesn't belong (such as after the round (brackets) of an if, for, while, or switch statement) is a very bad idea:

if (0 === 1); { alert("hi") }

// equivalent to:

if (0 === 1) /*do nothing*/ ;
alert ("hi");

This code will alert "hi", but not because 0 equals 1, but because of the semicolon. It makes JavaScript think that you have an empty statement there, and everything to the right of it is treated as no longer belonging to the if conditional and thus independent of it.

Of course there's an exception...

An important quirk: inside the () of a for loop, semicolons only go after the first and second statement, never after the third:

for (var i=0; i < 10; i++)  {/*actions*/}       // correct
for (var i=0; i < 10; i++;) {/*actions*/}       // SyntaxError

How to fix your semicolons

The JavaScript syntax proofing tool JSLint, which is built into the Codecademy code editor, does a pretty good job of finding unnecessary semicolons – or missing ones.

It'll show you yellow warning triangles in code lines. Hovering the mouse over a triangle will tell you if there's a missing semicolon or an unnecessary one. You can generally trust those warnings until you develop an intuition of where to use semicolons and where not to.

Getting Started with Git

This is the first of a three post series by one of our moderators, Joah Gerstenberg.

What's git?

Git is a Version Control System (VCS), a tool used by coders around the world to keep track of their code and the changes they have made to it. A VCS will save a snapshot each time you check your code into the VCS, allowing you to go back to any revision along the way and restore your code to the way it was then.

Every programmer should use a VCS.

Here's why:

Ever made change to your code, but just after you saved the file, you realized that you made a horrible mistake and you need to go back? A VCS lets you quickly jump back to before you made the mistake.

Ever wanted to be able to prove (or disprove) that one particular line of code is breaking your project? A VCS lets you see multiple revisions of your code to enable you to do just that.

Ever wanted to try out a new innovative feature in your project without accidentally messing up the project altogether? A VCS lets you create parallel deviations to your code which can later be merged into the final project.

Step 1: Download git

Although not alone with alternatives such as SVN or Mercurial, Git is by far the most popular VCS available.

Get started with git by downloading the appropriate package from Git's Download Page for your OS. Git installs by default as a command-line tool, so follow the appropriate instructions to access the git command line for your OS (in Mac and Linux, simply go to the Terminal).

From there, all you need to do is cd into the directory your code is stored in, and git init. That will initiate a versioned git repository in the current directory you are in.

Step 2: Add a new revision

When you are ready to add a new revision to the git repository's records, simply (while cd'd into the git repository) git add what you want to add to this specific revision. For example, if your folder was like this:

- Code # <== this is a git repo
|- index.html
|- js
 |- script.js
|- css
 |- style.css
|- img
|- .git # <== this is a hidden directory, but exists if {Code} is a git repo

And you just wanted to add the changes in /js to your current revision, simply use git add js, or if you wanted to just add the style.css file, you would use git add css/style.css.

Step 3: Commit your revision

Git uses the term "commit" for the different versions recorded to connote that you are "committing" the current code to the pretty-much-permanent record held by the git repo. Once you have git add'd the files you want to be a part of your next commit, simply use git commit -m "Your Commit Message Here".

Git highly recommends that you include a commit message as a part of your commit, so that you, and anyone else looking at your code, can easily recognize what the current version of the code does. One less-known trick that you can use while using the git command line is that you can use git commit -m "" --allow-empty-message, and bypass having to supply a message with your commit.

Step 4: To the Internet!

By following the above instructions, all your code and commits associated with it will be stored locally on your computer. This is perfectly acceptable, but in my next post I'll discuss the more popular approach; storing your code online with a service such as GitHub.

Getting Things Done > Grade Point Average

This post by Alexis Ohanian, co-founder of reddit, was originally published on LinkedIn.

Graduation

We're a generation in debt.

I had a world-class education at the University of Virginia. I met my reddit co-founder Steve Huffman there on move-in day. That chance encounter changed both of our lives. I had some awesome professors. There was the fortuitous trip to Waffle House that convinced me I wanted to be an entrepreneur, not a lawyer. I've written the book about internet entrepreneurship I wish I had back then. But my kids won't have the same education I did. And that's a good thing.

A year ago I sat on a panel at the White House for a room full of deans from universities across the country. We were tasked to talk about entrepreneurship and how to better prepare our nation's undergraduates for an uncertain job market.

"A critical skill I see in great entrepreneurs and employees alike is resourcefulness. Resourcefulness doesn't come from case-studies, it comes from doing things."

This turned out to be quite the applause line.

Paul Graham says the best founders are "relentlessly resourceful."

I've been thinking about that day in D.C. ever since.

Getting Things Done > Grade Point Average

I'm an employer and I don't really care where you went to school or what your GPA was -- I want to know what you've done. Paid off student loan debt by tutoring computer science in New York? Rock on. Raised $20,000 on kickstarter for a daft punk tribute album? Awesome! Started the 'dear photograph' meme? Splendid! Blogged years worth of eating across the world and now creating food-tour-guides? Now we're cooking with bacon.

Read the full article


How Kids Can Learn to Code

Designer Jeffrey Karl illustrated a Codecademy Kids for the iPad app to help more kids learn how to code. While not developed (yet!), his ideas show how to get any child interested in coding.

Why do you think kids should learn to code?

It's not that you need to master code, but everyone should know the basics. I had heard about how the country of Estonia mandated that elementary school students learn how to program, and also how there are not enough code literate people. There's a big barrier to entry to learning how to code - so how do you lower it?

How do you get them started?

One way to make kids excited about coding - or learning anything for that matter - is providing context for whatever subject it is you want to teach them ("If you learn this, you'll be able to..."). Let them know that if they code they'll be able to make their own games, or code their own website, or maybe just having fun with a more game-like or story-driven experience will be enough.

Coding is intimidating even to adults - how does this app help?

I wanted it to feel very tactile, like a child's arts and crafts project — each interactive element in the app is something to move around.

App

I used drag and drop (roughly borrowed from Scratch) to simplify the experience. I had the idea of having pre-made tools; for kids, they don't need to know the intricacies of writing code. So say you want to write an If / Else function in JavaScript. Drag and drop a function from the toolbox onto the looseleaf paper, then go back and grab the If / Else bit and drop it inside of the function. You'll see them expand so you can look at syntax. In the beginning, it's more the structuring of code that matters.

Without badges, what's the motivation for kids to do lessons?

Instead of getting badges for the sake of badges, in this app you're getting robot parts so that you can build a robot of your choice.

Robot

A robot represents a course. We need help building this robot and you do that by completing the lessons. There are different sized lessons so that you can add a leg and an arm, and it's fine to add three arms to make a really big robot (or a really long lesson) too! Each of the sections highlights a different part of the body.

As a game designer, how do you keep kids engaged?

I recently saw a talk given by Sebastian Deterding. He stressed that gamification is more than badges, leaderboards and points; it's about providing a meaningful experience for the user. One way to do that is through creating a fun story. This was basically the solution I used with Codecademy Kids for the iPad: the current system of badges aren't really related in any meaningful way - save the overlapping skill set it takes to complete each. Providing a storyline where kids can help this friendly character, Ratchet the monkey, build the individual parts of a robot is one way to contextualize these lessons for children.