Show HN: Codecademy.com, the easiest way to learn to code
codecademy.com
codecademy.com
its obvious something is great when you instantly think why the hell hasn't everything been like this all along.
Back in the early '90s I had a book called Master C, which came with a floppy that ran a similar type of tutorial.
http://www.amazon.com/Waite-Groups-Master-Book-Disks/dp/1878...
Seems like a long gap between then and now.
Also, please let me request a course on Clojure. That would rule!
It's a small price to pay, really, for the power to make some really complex things a lot easier, even if it's a bit weird at first.
After a while, it won't even seem weird any more.
I am going to test how many students at our high school can get interested in programming after trying out Codecedemy.
"name".length.
This is because the prompt said: Well done! How long is your name? Find out by typing your name in quotes and ending it with .length.
For me, that'd be "Ryan".length.
Apparently its not clear enough what is code and what isn't. While you and I can tell that the last period belongs to the sentence and not the code, it was a bit confusing for her. Perhaps putting the code in a different font (as well as the current highlighting) would do the trick?I think that if this is aimed at beginners it needs to be dumbed down more--I am a reasonably intelligent absolute beginner curious about coding and whether I'm interested in learning some, and in this lesson you have completely lost me; I no longer understand what I am doing or why, and I don't know how to proceed:
Everything we've talked about so far has one value. But what happens when you need to store an ordered list of values? You use a data structure known as an array.
The editor now has an array named numbers with the numbers 1, 4, and 6 (look at how we set the values). To access a particular value, you can use the name of the array and its position, or index (they start with 0). To get the number 4 from the array numbers, you would write numbers[1].
Try writing a line that will set the value of a variable called six to third number in the array.
I feel like there is not enough building on the previous lesson and not enough practice/repetition for me to get a toehold on what I'm doing/learning before moving on to the next thing. Here you have already moved me up to a level of abstraction where I cannot continue the exercise without seeking outside help (from Google, a book, a friend...).
And my hint is: To do this exercise, you have to declare a new variable (using var six =) and set it equal to the value of the array (done with numbers[2]). Remember: array indexes start at 0, not 1.
I'm totally lost. This hint is not helpful to me and there are no more hints. I'm stuck and can't continue within the lesson itself without more hints, exercises or explanation.
Also, I think this is brilliant <3. Keep going.
An array is a variable declared with square brackets around all the data, with a comma in between (delimiting) each positioned slot of data.
Example:
var array = ["data1", "data2", "data3"]
In this case, we've created an array containing text strings. It could just as easily contain integers, or as you will see demonstrated a little later in the course, other variables, including other arrays.Then, in order to retrieve or modify a piece of information from the array, you reference the array variable with the array position you want in square brackets.
Example: To get the "data1" string from the above array, use the variable like this:
array[0]
To get an alert dialog with the "data2" string, the code would look like: alert(array[1])
You can easily modify a piece of data in the array using this technique. For example, to change the string "data3" in the array to "third", the code would be: array[2] = "third"
If you would like to add a new piece of data to the array, you could do the following: array[3] = "fourth"
Note that this would require that you know the size of the array and that the position [3] is an available slot. A simpler method of adding data to an array is to use the .push function as such: array.push("fourth")Back in the real world, I see non techies deal with lists every day. Ordered lists. Given a list, with numbers in the margin, they can easily answer "Who came first?" or "What's next on the list?", or "What's item 5 on the agenda".
But noooo. We have to call them arrays. Lists are something else. o_O
The way I would describe an array to a novice is that it's a more complex and potentially useful type of variable
Fuck me no!!!! Shut up Moss!
For example, I could make an address book array with multiple data points as such:
var addressbook = [{"firstname": "John", "lastname": "Doe", "phone": "555-555-5555", "email": "johndoe@host.com"}, {"firstname": "Jane", "lastname": "Smith", "phone": "666-666-6666", "email": "janesmith@host.com"}]
Then, I can retrieve a piece of information like Jane's phone number like this: var janesnumber = addressbook[1].phone
Arrays are very powerful tools, especially once you start referencing other arrays in them, as it allows complex organization of data without always needing to resort to a database solution, with a whole new language to learn. var six = numbers[2]
I am not sure where the hangup is, considering I just copy-pasted that from two parts of the hint. Have they described arrays to you yet? Perhaps the problem is that they insufficiently described what an array was and what it did? I have not tried to use the site, so I'm not sure.I'm not sure how much I need to know or understand about them at this point, either--I speak some human languages that are not my native tongue and I was very lost when I first began learning them and relied heavily on memorization. What I need is just to be able to follow along well enough to produce an answer and for there to be enough repetition and regurgitation that things start to gel if I keep it up.
This wasn't clear enough for me to be able to continue with the lesson; I was literally stuck since there weren't any more hints or resources (though I have since downloaded an e-book ;). Perhaps it would be good for there to be a cheat revealing the answer and additional problems that appear whether or not you fail the first time.
This format is excellent and the site looks great. More coddling, please!
That got me thinking, just about every intro to programming book I've seen explains arrays with a picture. I then thought to do a Google image search for JavaScript array and found this:
http://www.webreference.com/programming/javascript/diaries/1...
Would that have helped? (I also wonder if that's a good tutorial as well.)
It seems the focus at Code Academy is on doing, which is fantastic, but more (any?) images will help get the point across faster, esp. for visual thinkers (like designers, who are the perfect audience for learning JavaScript).
ERROR: Cannot read property '_id' of undefined
In my opinion, exploration in this context is extremely important. The guided tours are nice, but I'm confident that you don't want to limit people's use of the siteAlso, "You're doing great! To continue, you'll need to register or sign in. Otherwise all that awesome progress you've made will be lost. Sign In\Register (it's free)" was a complete surprise, and felt like a roadblock (in spite of the "it's free" message.
If a user types through enough of the pages to get this message, they probably are enjoying the site and want to keep working with it. Why not include a "Not now" option in this dialog?
That way they can choose to join when they step back when they are done and say "Wow, that's a nice site! I want to come back later and keep working on this. I guess I ought to register!", rather than a "Meh, I've only invested 2 minutes, guess not".
The "You're doing great! To continue, you'll need to register or sign in. Otherwise all that awesome progress you've made will be lost. Sign In\Register (it's free)" dialog is most definitely a road block as there were no links available to go back to the home page.
Only two options were sign in or register. So yeah, there should be a cancel, or return to homepage
I love this. Keep doing what you're doing, expand the library in a few months and contact foundations like Rockefeller for financial support if you need it.
Kudos! I'm excited.
we'll update the dialog as well.
really appreciate the feedback! feel free to email more to me - zach (at) codecademy (dot) com.
One thing I'd change is this error message which is not really an error message : "ERROR: Sorry, that's not correct. Please try again."
It appears every time I try some command which is not exactly the next step defined in the tutorial. It kind of feels like an old school tutor forcing me to follow a rigid book exercise and discouraging experimenting.
If you want me to complete the tutorial, don't move the progress indicator until I complete the next step, but please don't scold me with fake errors :-)
One thing I've been craving for is a place where I can jump in and get a quick primer on some random topic from another programmer. Think SO in real-time. I know there's IRC, but it's not very user friendly and I don't want to hop around different channels to ask different language questions.
If you build a truly social and interactive site for learning programming, I'd use it a lot.
Good luck!
we're opening it up to free programming asap and we're going to stop the fake errors thing.
this is exactly what we're planning on doing - let me know if you'd be interested in creating a lesson or if you have other feedback - zach (at) codecademy (dot) com.
Are you on twitter?
Starting with Javascript is definitely the way to go, as I strongly believe it's the language of the future (and right now actually). One request for courses would be intermediate/advanced javascript for people that already know how to program.
Also I think you should reach out to library developers (backbone, underscore, jquery, etc) so that instead of having a static readme/how-to they can create a course on how to use their library. I know that would get me up to speed on them a heck of a lot faster and would be super useful.
@zds: Any plans to make this an online course submission, or do you want to filter everything through emails?
I really well done flow (like this one) reminds me just how fun it is to learn something when it is presented well. I am ashamed to say that if I had to teach someone, say Java, I wouldn't know how to present it in a fun, non-crushing manner.
I am glad there are people out there working on resources like this.
Any thoughts/plans to go that route?
I always loved that, and I think this has a lot of potential. Tomorrow being Whyday, I think I'll send this to some people to try and spread the joy of programming.
I do think that the parentheses and semicolon stuff might appear sort of abruptly for the completely non-technical, but it's hard for me to judge, really.
Imagine a customer that is really happy with what you provide. Do you really believe that this person is unable to recommend it to others without your help?
What these logos tell me is this: You believe your site isn't good enough that people will take the 2 minutes to talk about it, but you hope that if you make it easy enough to just click a button, masses of these low-involment-recommendations would somehow make up for it. Which they never do.
Great concept otherwise, congrats.
var number = prompt("Guess what number I'm thinking of between 1 and 10!");
if(number === 7) {
print("You got it!");
// Change the following line.
} else if () {
print("Close! Try guessing a little higher.");
} else {
print("You were way off! Sorry...");
}
prompt returns a string, but then attempts to compare it with === with an int, which clearly doesn't work.This is a really awesome site though, and I'm really excited to see it grow with more and more lessons.
var response = prompt("Do you like me?");
if (response = "yes") {
print("i like you too!");
}
It passes because assignments return the value of the variable assigned, but it should fail the exercise, since it's conceptually wrong.I think basic programming is actually conceptually easy. I remember being frustrated by not understanding the lingo and I think that's where a lot of people starting off get hung up, too. What's the difference between a syntax error and a runtime error? Or an exception? What happens when the compiler spits out some gobbletygook, and now I'm digging through a manual written for people who already know how to program.
In this sense the Codeacademy poses similar hurdles. It will report an Error, without giving more context. Why is it an error? Did I quote something I shouldn't have? What does unexpected token mean? OH, I left off a quote.
i.e. instead of "Error: Unexpected token ILLEGAL", a better message (perhaps linked from the strict message) would be "The program interpreter couldn't understand what you meant because it was expecting to see some syntax or punctuation that didn't exist. Common reasons are unpaired quotes, braces or parentheses"
Because the environment is already somewhat controlled, the helpful messages can have a narrower, clearer scope. Overall Codeacademy is great; I'm recommending it to a lot of people.
We ended up initially putting you into an introductory prototype when you first start an account where we bring you up to speed on what our tool can do in terms of writing HTML before we go further and show you more about how our tool is special.
Strangely, after launching in the Chrome Web Store, we started getting a lot of feedback from people who had stumbled into it and were discovering HTML for the first time through our getting started guide. They don't have a clue what "HTML prototyping" or "interaction design" is, but they love learning about "how to make websites" with Handcraft.
Just thought I'd share. Great work with Codecademy! I'll be keeping my eye on it and might start forwarding people over if they get stuck with what we have on offer.
Small bug: On http://www.codecademy.com/programming-intro/4#!/exercise/3, it says "We've given you an example for the first one", but there is no example.
myFullName = "Thomas Edison"
But it's reminding me of making sure my variable names are correct, so maybe: myFullName = myName lastName
That doesn't work.Because I'm a programmer, I know that the + operator concatenates strings, but I don't think everyone will think consider that, and it hasn't been mentioned at that point.
Was that on purpose?
When I was setting out to learn programming, I bought every book I could lay my grubby teenaged hands on about the language. Knowing the name of the programming language allows you to ask questions about it of other people and the Internet.
It's a CLI-based interface, not a click-based interface, which is a welcome change and a good thing for beginning programmers to learn.
But still there were problems: the CLI did not recognize my keyboard layout. I could not type quotes, so I couldn't even say my name... Too bad, looks cool.
No better way to learn than by example, and you can take a lot more from it than reading a 20-odd page tutorial.
This may be a matter of opinion, but I think the order in which new concepts are introduced could be tweaked. You're first introduced to string literals. Then variables are introduced. Then it's back to string literals. Then some variables. Then a tiny bit on numbers which suddenly shifts back to string literals in the same lesson.
It seems that introducing the concept of variables is a little premature in those first four lessons considering they're rarely, if at all, manipulated, and aren't applied consistently enough to really understand what they're for.
A suggestion is to gently scold users who do a variety of "bad javascript" things. You may want to let them know that what they did works, but may cause problems somehow.
The first item that comes to mind is accidentally making global variables by leaving out the `var` when creating new variables.
Also encourage users to end lines with semicolons (maybe only when using an editor).
Currently, if you do these things you can pass the exercises anyway. Arguably you shouldn't be able to pass "Let's Try That Again" in "Variables" if you do it with a global variable.
I made several attempts as "Lesson 8: Take a While", all fulfilling the brief, and all telling me "Oops, try again".
I wasn't even being particularly perverse on all of them. In fact, when I did try being perverse, I got it to pass even though it technically should have failed.
This is an example of perversely passing:
var times = 0;
while (true) {
print( "hello" );
if(times >=100) {
times = 2;
break;
}
times += 1
};
The brief is "Your turn! Let's make a while loop that prints "hello" twice. It's outlined in the editor."(nice work btw)
What I find to be even greater is that as you run through the thread of comments, zds is responding to feedback and then going back to Codecademy.com to actually incorporate it on the fly.
It's 10 hours since this was first posted and I just read some comments on "you should be able to skip registering until later" and it's already available when you get to Lesson 3.
A great way to listen to and incorporate the right user feedback into your application quickly and effectively.
Really good stuff!
We need help though! If anyone wants to contribute lessons, feel free to drop me an email - contact (at) codecademy (dot) com.
Additionally if the user actually does this, they don't get an error and instead get something they probably don't expect:
> "asdf".toUpperCase
==> function toUpperCase() {
[native code]
}
Maybe sometimes don't always output the evaluated result of what the user typed. Or just output an error also with it. > o = {}
> o.o = o
==> [object Object]
ERROR: Maximum call stack size exceeded
This isn't totally unusual; `window` has several self-references, for example, and hangs for several seconds.But I was wrong. My instinct tells me this can be the way to get wanna-be young coders excited about programming. Reason being is teenagers/young adults can feel like they are actually talking to a person, not a machine.
(I am the programmer of 5 websites/apps/plugins and a high school sophomore.)
One thing to improve, make the program sound the nice guy it sound when the user does things right. I tried doing something wrong and presented with just an error. Probably not good for the type of audience that would embrace this.
`> 2w2 ERROR: identifier starts immediately after numeric literal`
Wishing very good luck.
Also it is not that original:
http://tryhaskell.org/ http://tryruby.org/
In fact theres already a javascript one: http://tryjavascript.devfu.com/
But it does seem friendlier somehow that the others.
Overall, an amazing website!
2 bugs I hit were the lessons not saving upon completion & if it hits an error, it froze the window which I had to close (Chrome running on Lion)
Proof of completion: http://www.codecademy.com/users/4e4da1c233a5480001000221
Please, visit http://ocw.mit.edu/courses/electrical-engineering-and-comput... instead.
I've never done Javascript before (although I do or did Python/C/C++/D/Pascal/AHK), this will be interesting. Great job!
Having this to review with will be handy.
thanks for checking us out.
Most there dont know how to code, but none too surprising none were interested in creating a service to learn how to code. I'm not bitter that my idea wasn't selected as these non-coders wanted to create a fashion site or the AirBnB for restrooms (HA) :)
Well Im going to get started on that idea I proposed a few months ago. Besides this Ive seen some other things popping up that show a real need for such a service.
My wish for your site is to have a log in option so I can save my scores and it remembers what I did with each lesson.
Good luck!
It'd save a lot of annoying c'n'p if you could fix this. Cheers
R.
Some more informative messages would be helpful. Some errors are genuine errors while others are simply an issue of not typing in precisely what the lesson wants you to type in.
Or a new competitor?
It is really fantastic - the subtleties of dealing precisely with a computer (syntax) are often hard to get across, but I like how this eases them into it - but doesn't hide it away with visual programming. One of the greatest pieces of advice I was given before I started programming was that a computer will not tolerate mistakes, fuzzyness, vagueness. It will do your bidding, but no more.
it's a rails project.
By the way, the design is very nice.
On the other hand, I've had a great experience with Codecademy, though I haven't spent a bunch of time with it yet.
What are you plans with it for the future?
Please add more courses :D
Looks great, looking forward to seeing it develop!
It should be more explicit that this site is teaching Javascript (are you teaching other languages? it is not clear) and it is for complete beginners, and that the site creators make some very patronizing assumptions about the students.
This is like clicking on a link to "poetryacademy.com" and finding a site that is teaching you how to sing the alphabet song.
I think it is arrogant because it is claiming to be teaching how to code, when it is not doing anything of the sort. I think it is supremely arrogant to not even mention that it is teaching javascript specifically, making it sound like you could learn how to code in general from the site, when it covers only the most basic of basic topics, and then covers them wrongly. I think it is taking the wrong approach towards teaching someone how to code, in a manner that only someone who doesn't know how bad they are at coding would do. I think people need to understand that learning how to code takes a long time and a lot of hard work. I think the site does too much hand holding and is way too slow .. it is like saying that if you want to learn how to fly to the moon you just have to practice jumping higher and higher, it is like saying if you want to write the next great novel you should keep singing the alphabet song until you know all 26 letters .. it doesn't work and it's giving false hope to people who are not trying hard enough, making them think that they can put in the little little bit of effort that this site asks of them and they will be able to succeed in learning how to code.
If I had to teach someone programming from scratch, I would definitely start off with some basic theory of computation stuff, get some basic concepts in on what a state machine is, what are the differences between a deterministic finite automata, nondeterministic finite automota, and a turing machine, then with a basic understanding of what a turing machine is, we can get some C in, learn the basic memory model, what is stack and heap, then gain some basic understanding of typing, difference between static types and dynamic types and why it is important to know about types, which makes so much more sense once you understand what is going on with the heap and dynamic memory allocation and so on, then we can go on to the concepts of abstraction, state change, and so on.
1. I think you have a good argument concerning how they may seem to be belittling the complexities of programming. Again, I'm interested in seeing where they will go from here... I believe they have a good (early) start, and I believe the worth of the site will be determined by how effectively it can teach anything beyond the very very beginner level.
2. The site just recently was made available -- it's clearly not 100% complete. HN has submissions of half-complete (or <=MVP) stuff all the time. This, and the fact that there is no business model present, the fact that the lessons stop at a very abrupt point, and the fact that the authors here are so eager for feedback, I believe renders the harshness of your harsher arguments unhelpful.
3. How you suggest one would teach someone programming from scratch I think would work for very few people (though if done well, I have no doubt it would work for some). I think a majority of people you would try that strategy on, how I am perceiving it anyway, would lead to burn out and people end up hating programming before much time was up. In fact, I believe that approach is one taken so often in school, and look where it has brought us... a majority of people hate math, hate [insert random science subject], and hate [insert nearly any academic field sometimes even including the one they majored in]. How is it that we fail so horribly as to often cause such strong aversions to certain subjects, or rather what we believe are the subjects. I don't believe anyone truly hates math (or any academic subject), they just have a horribly skewed idea of what it is.
I agree with this for the most part, but I don't agree that being a coward is a natural state unless taught otherwise. I believe it results from the mindsets we form based on what we perceive societal values to be. Parents/peers/culture seems to value good grades, or simply looking good at whatever you're doing, and being accepted by following the norm -- superficial, damaging, and mostly pointless things -- and as a result, those things become priority for people over learning. If we stop pretending those things matter so much, and put more focus on the beauties of learning and curiosity and discovery and exploration, things would be different.
When and how did you learn to become such an autodidact? Have you been one your entire life? Or when did you realize the system can't and shouldn't force learning upon you and you have to take it into your own hands? I made some of these realizations not all too many years ago, and am fascinated by how others have made the transition.
Thanks, your views I find interesting...
If you want to work in software engineering you have to teach yourself pretty much everything -- identifying what you need to learn is a big component.
Teaching isn't only about choosing the right subjects in the right order. It is also about making people involved in their own learning. Especially at basic levels.
Also I disagree on the last paragraph. The topics you mentioned are far less useful for learning to program than the material this tutorial covered. They are advanced topics, and only used in special situations.
The concepts I mentioned are not advanced concepts. They are BASIC concepts, such as would be covered in a basic freshman/sophomore class in college. You probably have no idea about the huge class of bugs that you could easily avoid if you understood these concepts. They are not used some of the time, they are used ALL of the time.
could you link to some good ressources to learn all the topics you listed ?
Like I said earlier, show me a way to interact and tinker with an already existing codebase that does something interesting. Make sure that codebase is extremely well commented and hyperlinked. And I will be swimming with freedom in a limitless sea of knowledge that people have cultivated over decades.