Prototype

I was hoping to learn what the "prototype" keyword means in JavaScript during my last college class. No suck luck. I am taking another JavaScript class next semester. But I thought I would try to get Google to help me figure out what this complex topics refers to.

We should start with what JavaScript has. You got primitives and objects. Primitives are types such as boolean, string, or number. Another type is an object. Objects are key value pairs. Keys are the properties of an object. The property is called a method if the value is a function. These are the basics.

Here is a true statement: All objects have prototypes. The default prototype only has the constructor. The constructor assigns the prototype to an object instance at the time of instance creation. You can retrieve this prototype by calling getPrototypeOf() or by accessing __proto__.

When you add properties to an instance, only that instance gets the properties by default. However you can use the prototype keyword before the property. That causes the property to apply to all instances of the obect. To be more specific, any instances created by the object will get the new properties added when the properties are qualified by the prototype keyword. Wow. That was a mouthful.

Now the prototype is itself an object. Therefore the prototype has a prototype. Let's not get too bogged down by that though. You can use prototype on your own objects. However you can only change a prebuilt object with prototype if the object was created with the "new" keyword.

The properties added to all instances via the prototype can be methods. When a property of an instance is accessed, the chain of prototypes is walked to determine if the property exists. This gives you insight into the internal structure of a JavaScript object. All objects inherit behavior from the prototype of Object. That would be the end of the prototype chain.

JavaScript Interpreter

I read the description for a program over at Code Project. It was for an interpreter written in JavaScript. I was excited about this since I am taking a JavaScript course right now. Much of the writeup had to do with the mechanics behind an interpreter. The sample program also only did interpretation of mathematical expressions. But the ideas were solid.

The extraordinary part of this article was that it was written by 17 year old Peter Olson. Bravo man. The writeup finished up with some easy, medium, and hard ideas to improve the project. Somehow I don't think I have the technology to tackle the hard improvements to this program. The college class on JavaScript is just too primitive to have taught me much. Perhaps I can knock out a couple the smaller TO DO items. Or should we say I can try some of the easier TO DO items.

Next semester I plan to take an advanced JavaScript course. That should pump up my skills.

Becoming a Web Developer

I read a post on how a developer went from being a noob web developer to a competant one. He works for a cool company. So I gave his opinions a little more authority. I would like to dabble in web development myself. Let's see where I am compared to this guy, and where I need to go.

He started by playing with URL parameters. Got it. Then he went tinto JavaScript. I am working on that. This is where my experience ends. The developer I read about went much further. He them learned an Object Relational Mapper. And he really pumps up learning jQuery, which is a JavaScript library for client scripting. I got a feeling I need to learn that next myself.

The guy said he got into FireBug, which is a tool to help debug all things web. He learned Memcached, which implements an in memory cache to speed up dynamic sites that depend on a database. He seems to be a Python developer now. He learned Python requests, which is an HTTP library written in the Python programming language.

The developer used Beautiful Soup, which is a python library for things like screen scraping. That seems a bit speciic. He also got deep into Cascading Style Sheets. I know a little bit about them. Then he mentioned that he turned his study to cookies. Isn't that a basic capability you need to know earlier?

Boss got into MongoDB, an open source NoSQL database. Today I learned that the Mongo comes from the work huMongous. He also uses DictShield, which claims to be a modeling system that is not tied to a specific database. Not exactly sure what that does. It seems to be relating to typing. Finally he got into the Python Natural Language Processing Toolkit. This also seems to be a niche.

The moral of the story is that there is a lot to becoming a web developer. Just when you think you learned a bit, you find out there is oh so much more to learn.

Free Courses at Udacity

I just heard that Udacity is soon to offer free courses online. These appear to be like college courses. However they are shorter. The bios of the instructors are impressive. A computer grades your homework. The cost is free. So why not try out a course or two?

The most interesting course to me is Web Application Engineering. The overview says that by the end of the course, you will be able to code up your own blog application. That sounds hot. It covers a lot of topics. The session I find most interesting is the one on how to scale your web app.

Another fun looking course is Programming Languages. It claims that by the end of the course, you will be able to develop your own web browser. That sounds like a tall hill to climb. The weeks are packed with complex topics such as grammars, lexical analysis, and parsing. Somehow I think you can learn those topics in just a few weeks. Maybe I am wrong.`

Form Alignment

I had some homework for my JavaScript class. This chapter deals with events. I was able to determine the names of the events and their handlers. Coded up some JavaScript functions to do the dirty deeds. The handlers just called my functions. Jobs done.

I was not satisfied with how my web page looked though. The second piece of the homework had me doing a form. The labels all lined up. But the input fields were all over the place. I knew these things could be lined up from previous experience. But my HTML skills are rusty.

Luckily dream in code came to the rescue. Just needed to put in some CSS that made the labels all be the same width. Then the fields that follwed them all ligned up as well. You would think somethink this common would be second nature for me by now.

Intro to JavaScript

Next semester, I am taking an Introduction to JavaScript class. The class looks pretty easy. I need some down time as I continue to process the topics learned in last semester's Java course.

Today I picked up the textbook for my JavaScript class. The topics really do look introductory. I read the first two chapters to get ahead for class. They covered some of the history of JavaScript. I learned how to embed JavaScript in HTML. Also reviewed how to put JavaScript in a CDATA block to allow the XHTML to validate.

The book went through some examples to make the JavaScript spit out HTML. We also learned how to include external JavaScript files. I would like to have some hands-on assignments where I write some JavaScript code. Let's hope the course instructor gives us some homework or something.

Floating Controls

I was trying to check out a new C++ tutorial online. The page looked pretty blank. I scrolled down thinking maybe they put the content on the bottom. Nope. All I saw was a picture of a dude that looked like Weird Al. Sheesh.

I read the author's bio. He worked for Microsoft. He has a PhD. And he even wrote a book on C++. So where is the beef? I almost ditched the site.

Then I saw it. There was some annoying plus sign that moved with me as I scrolled the screen. At first I thought that was some annoying web ad or something. Nope. That is the control you use to start the training videos.

Ooops. For me that was a fail. Perhaps the guy got set up. Weak site use tricks like this to get you to click on or notice ads. This was the first time I found the floating control to be used for a legitimate purpose.