[JS] Functions and Codecademy
This chapter focused on functions. This was a relatively simple chapter that I got through pretty quickly. That’s not to say I’m a master of functions, but as far as understanding the concepts goes, I think I got it pretty well.
I met with a professor at Penn earlier this week to talk about alternate (the product that I’m working on / incentivized me to understand programming better), and he made a good point of how all students learn by analogy. It’s rare for students to learn without connecting the content to something they already understand.
In this circumstance, it’s really simple to connect functions to all the math classes you’ve taken in high school. One of my professors loved getting us to think out of the box, and in so doing, she had us create functions of our own. For example, we could create some function, x|y, that could equal 2x + y - x^y. In JS, you have to define functions the same way (except, obviously, defining those functions gets a little complicated when you’re writing them in code.) Fortunately, though, once you understand what the functions are representing conceptually, writing them makes a lot more sense.
A few things I’ve been confused about are the difference between show() and return(), methods by which people write more complicated functions within functions or things of the like from scratch. I’m understanding the code, and with guidance, it’s making significant sense, but it’s tough to fathom writing this stuff from scratch. I’m guessing that’s why most of the programmers I know love open source code and use Quora/Stack Overflow to build their products.
Another thing I found really useful was http://codecademy.com. Anyone reading this blog has almost undoubtedly already heard of them. Right now, Codecademy only has a few lessons of JS up, but in a very short time, I went through a lot of action items. I think this is an awesome start to get programming for a noob, particularly because it jumps straight into lessons instead of dwelling too much on theory.
I definitely think learning theory is important, but it’s easy to start learning theory, get bored, and let the entire learning process go. Codecademy gets you straight into producing some programs (well, kinda) and laying the groundwork of some of the basic functions you’d be using in JS. It’s definitely a great start, and I’d probably start with that before even getting into Eloquent Javascript.
A tip I would definitely give to anyone starting to learn how to code is to not dwell too much on a particular exercise. As I move forward, I realize that it’s discouraging when you can’t work your way through an exercise. Letting yourself get stuck is dumb. Try working through it, but let yourself just look at the answer, copy it character for character in your own console, and understand what exactly is happening, then just go on. Getting stuck will just discourage you from continuing the learning process.