Tuesday, June 20, 2017

My experience with "Hour of code"



Welcome back! For the last week and a bit I've been working on the Khan Academy's hour of code. It's not my first hour of code, so... yeah. Actually, my first hour of code was in Khan Academy a few years ago. It was a bit different but in summary I've redone what I had already done. Anyway, it was a great way to refresh knowledge. From my point of view, knowing something about coding, I think is a pretty good start point for learning. I'll give you a quick look at my projects and how the platform works.

First things first. I'll tell you some things about the platform. Khan Academy was founded in 2007, it doesnt only feature computer science courses, but also maths, traditional science and finantial. The hour of code course is meant to be done over an hour-ish and teaches you the very basics of Javascript. From there on you could take a Javascript course in codecademy or sololearn, both of them really great. My first coding course was actually that one. From there I went on and learned some Java on codecademy and some python, after that I migrated to sololearn to take a course in C++. Now I'm taking a course about C#.

It walks you through some basic coding notions and finally give you 3 projects to do. In between lessons there are some challenges to help you put to the test what you just learn. I'll list my own solutions to one challenge and one project down here,

Here goes the challenge:
















//Background

background(0, 221, 255);

// The ground

fill(47, 255, 0);
rect(0, 300, 400, 100);  

// The sun
fill(242, 255, 0);
ellipse(80, 64, 100, 100);  

// The snowman
fill(255, 255, 255);
ellipse(200, 300, 150, 150);
ellipse(200, 200, 100, 100);
ellipse(200, 120, 75, 75);

And here goes the project:














//Background
background(0, 221, 255); 
// The ground
fill(47, 255, 0);
rect(0, 300, 400, 100);  

// The sun
fill(242, 255, 0);
ellipse(80, 64, 100, 100);  

// The snowman
fill(255, 255, 255);
ellipse(200, 300, 150, 150);
ellipse(200, 200, 100, 100);
ellipse(200, 120, 75, 75);

The "//" mean that´s a comment and won´t be readen by the program once it´s run. There only there for humans to read.



By coding there are some key concepts that are not explained in the hour of code that I think you guys should know.

The first one is pseudo code. It is very useful before starting to write code because it helps you get organized. It is, basically, writing code in human language, like:


Draw a rectangle;
Fill it with red ;
and then you try to "port" it to the programing language you're using.

Another important concept is a variable. You could imagine variable like a box in which you can store information and access it every time you need. You label that box so that you can recall it easily:


If you manage to complete the projects and challenges you'll earn badges. One of them is 10⁴. It means you've got more than 10000 energy points. This is what the other reward system is based on. To earn energy points it's taken into account how much time you've been active while on lessons or challenges/projects.

I really encourage you guys to start coding by your own. Me having some hours behind me I can tell you it´s amazing to see something come out of nothing. Something you´ve done by your own, letter by letter, word by word. Thanks for your time.

If you're not so sure about programming I'll leave you a very nice video I think you should watch anyway:

No comments:

Post a Comment