#ruby, #rails, #OOP, #javascript, #ember

Showing posts with label douglas crockford. Show all posts
Showing posts with label douglas crockford. Show all posts

10/22/15

Friedman's "Schemer" and the Wonderful World of Recursion

"In order to be creative one must first gain control of the medium...In engineering, as in other creative arts, we must learn to do analysis to support our efforts in synthesis. One cannot build a beautiful and functional bridge without a knowledge of steel and dirt and considerable mathematical technique for using this knowledge to compute the properties of structures. Similarly, one cannot build a beautiful computer system without a deep understanding of how to "pre-visualize" the process generated by the procedures one writes." -Gerald J. Sussman taken from the forward of The Little Schemer

As I have mentioned in other blog posts, learning the programming basics on your own can be frustrating. Sometimes it feels like I'm wandering through a thick fog that I can't find my way out of. But alas, Daniel P. Friedman's The Little Schemer has given me hope.

This book is all about recursion, something that I did not understand but had used on websites such as Free Code Camp and Code Academy. There were many "ah-ha!" moments for me while reading this book, but most importantly I began to understand what the hell recursion actually is. In my own words, recursion is a problem that solves itself by referring back to its beginning after modifying at least one part of the original problem. In Friedman's words, "recursion is the act of defining an object or solving a problem in terms of itself."

I first heard of this book while going through Douglas Crockford's JavaScript lectures on youtube. He mentioned that every programmer should understand what this book teaches, and when Crockford recommends such things, young programmers should listen.

The book is structured in a wonderfully refreshing way especially for someone who intends to learn on their own. The text consists of simple questions that build toward more complex realizations. Instead of giving definition terms in English, the book works the reader to a conclusion on his/her own by using the previous question and answer to help define the next.

The Little Schemer is written in the language Scheme, something I have never seen before, but I had no problem picking up the concepts of the book because the language has many similarities to JavaScript. For example, a scheme function would translate to JavaScript like this:

(define phish (lambda (a b c) (body)))


//and in JavaScripst...


function phish foo(a, b, c) {
    return body;
};


As you can see the functions are pretty similar so for most of the book I just left the problems in scheme. One thing that really stuck out to me while going through this book is the functions that I have been taking for granted such as the simple .length property in JavaScript, or the very often used "rember" function found in the book. "Rember" takes two arguments, one an atom and one a list, and removes the first argument when it finds it in the list.

This book helped me understand recursion MUCH more, and is something that I will return to over the next few weeks when I feel I need a refresher.

-John

10/14/15

Crockford on JavaScript - Part 5: The End of All Things

Video of Lecture

In this lecture Douglas Crockford talks about some of the security threats that we face today on the web. Many of the problems, says Crockford, come from the amount of diversity on the web. Mashups (which is the combining of programs with different interests), too many languages with separate encoding and commenting, and the nesting of these languages are just a few of the complications that a browser will encounter on a typical day. Because of this the browser must do heroic things in order to decipher many web pages that then give attackers easier access to sensitive data.
Crockford goes into much more in this lecture such as what an attacker can access on the web and how advertisers can compromise security. My full notes can be found here.

9/28/15

Crockford on JavaScript- Episode IV: The Metamorphosis of Ajax

Santa Fe Meets Blue Springs
Last few weeks have been amazing! I learned and met new friends in Orlando, and last week my older brother offered to take me on a week long canoe camping trip down the Santa Fe and Suwannee Rivers. All though I was a little hesitant to step away from the code for a whole week, I thought how many times do things like this come around? Needless to say, we had a blast and it was a much needed break from all the “screen time” I have been putting in lately. Now I feel refreshed, picking up where I left off with Free Code Camp’s Zipline Challenges. I will make a separate post about Zipline #1 this week, but for now I would like to talk about Douglas Crockford’s lectures on JavaScript. When the lectures were published, Crockford was the senior JS architect at Yahoo, however, today he holds that same position with PayPal.

What I like most about these lectures is that they go into depth in theory AND history--which I find helpful since I don't have a strong computer background. In this lecture, Crockford on JavaScript- Episode IV:The Metamorphosis of Ajax, Crockford discusses Ajax, CSS, HTML, and how all these things affect JavaScript today.

My notes to this lecture can be found here (beware, I do not use spell check on this document)

Being a newbie with code I find it difficult sometimes to give back to any part of the community; It's like I’m constantly asking questions of senior coders and never having anything to offer in return. I figure adding some of my notes to this blog can be a way for me to give back in case anyone is in my shoes in the future and needs some reference points to start from. I have already been through a number of Crockford’s lectures but did not take great notes, so, from this point forward I will be sure to take notes as if it is for the larger community :)

-John