Wednesday, 15 August 2012

First On-line Lecture. (9,996.5)

Managed to get on my discipline a bit more today and watched the first lecture in the series I promised I would watch daily. If you don't know what I am talking about (click here).


 Okay so firstly the lecture are a little bit dated but have a very cool old-school feel to them, that makes you feel as if you were there near to the beginning of the birth of the modern-modern computer (I'm talking post windows 95). The first lecture concentrates on introducing you to Lisp, not in a traditional 'declarative' way (picked that word up from the lectures, Gates watch out..) whereby the lecturer basically runs through the various commands and how you link them up, rather, in this lecture the theme is understanding what's inside the each process that each operator calls.

 The lectures are filled with useful quotes that help to put computing into perspective for the programmer. For instance the lecturer makes very clear at the beginning that computing shouldn't be considered a science or even considered computing as it takes away from the processes involved and focuses heavily on the tools you are using. I feel this quote does have some weight to it as he elaborate on it throughout the duration of the lecture and basically leaves you understanding that computing is not really about the fancy programs you get to play with right now for instance, computing for the computer scientist is about engineering an art form. Making something that is already magical and beautiful and making it even more so.

 Anyway enough about the lecturers philosophical input about what he feels computing to be, what is there to learn from the first lecture in this series. Well, enough to realise that if I stick with this and complete this series I will understand computing and programming in a seriously deep way. From all the dabbling I have done before in programming I understood more about what was actually going on from this hour long introductory lecture than I have done in a whole year of faffing around.



 The main concept the Lecture introduced was this idea of  'abstraction' in that the way you can express something in programming has to be understood fully by you for you to be able to do it efficiently. The lecturer went on to explain what he meant by this by creating a squaring function from scratch using Lisp. The details of how to do this are not important as he shows you many methods of producing the same result and even a mini program that was designed to 'guess' the square root of any number.

 The key points that needed to be taken away is the basic structure of code.
 He gives this example and then elaborates on it as I will giving a running commentary.

(+  3  17.4  5).
Lisp uses a system known as prefix notation which means the operator is written to the left of the operands.
 A simple mathematical operation in lisp. The plus sign (+) is the operator the numbers to be added are the operands (3, 17.4 & 5) and the parentheses/brackets including the process inside is known as a combination.

He then explains the method of developing your own code or in this case a squaring function.

(DEFINE SQUARE (LAMBDA x (* x x)))

Now I'm not 100% on the definition of LAMBDA but I have made a note to re-edit this section for clarity, until then I will just explain the point the lecturer was making by showing us this operation.

The intial call 'DEFINE' requires us to create a symbol we want defining, in this case as we are squaring numbers the symbol was 'SQUARE'. The next stage of this definition required us to call a procedure that allowed us to define using an 'argument' what we wanted  our definition to stand for. This is where the term 'LAMBDA' comes in and not knowing this did stump me a little bit on what was going on but it is not impossible to understand the essence of what is going on which was the purpose of this lecture. So, with a procedure called with an argument named 'x' ( what this essentially means is that a value known as x will be entered and when it is entered something must happen to this value due to the call SQUARE being used), a result has to be 'returned' to give purpose to the new definition. The final section of the code '(* x x)' required x to be multiplied by itself (or squared as it is known) to complete the process.


:)


 Again as with all articles I will touch them up for you to make them perfect as possible when my understanding of the concepts matures. Thanks again for your paitence. Also if you can help clarify any of the information I am trying to re-teach people please leave me a comment and I will be more than happy to fix the areas where I have gone wrong, its the reason I'm here. Also I did about 1.5 hours of actual constructive work today hence why I have moved from 9,998 to 9,996.5. It seems this process is going to balance on my fight with my discipline as in my mind its filled all the time with the want to learn computing but there is a huge part of me that hides away from tackling it, who knows for what reason, probably fear of not understanding something and being a failure unto myself and shattering the image I hold of myself being able to tackle anything with enough effort, which truth being told would be a devastating blow, it is however my sincerest intention to reach my goal of hitting a Phd in 10 years. I'm just off to a slow start. Again thank you for your patience.



No comments:

Post a Comment