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.

Efficient XML Interchange

There is a new flavor of XML out on the market. It is the Efficient XML Interchange (EXI). This was developed by AgileDelta. The goal is to make XML smaller and faster. They do this by implementing a unique approach to file compression. The great thing about EXI is that it is compatible with XML. Specifically the tools you use for XML will work with EXI.

Extention Libraries

If you want to build an Internet app, you can use some type of plug in. But you can also use an extension library. This has the advantage that you don't have to install anything. The browser already knows how to process JavaScript.

The library I hear the most about is jQuery. However there are a whole lot more. Developers sometimes think that ExtJS does not get enough press.

If you are not integrating it into a commercial product, you can get ExtJS for free. You add some lines of code to your header section to bring in the ExtJS functionality. Then you use the extension library framework.

Some things you might gain from an extension library are drag and drop functionality, help with AJAX, widgets, and event handling. I plan on investigating at least one of these extension libs right after I finish learning JavaScript.

Project Orion

The Eclipse Foundation is working on a Project Orion. This is a version of their Eclipse IDE that runs in a web browser. The thing is being coded from scratch using JavaScript. That sounds cool. If they can complete such a massive undertaking, then I should be able to write simple apps using JavaScript.

I used Eclipse briefly while learning Java. However I found that I preferred a simple text editor. That forced me to learn the syntax myself and not rely on auto complete from an IDE. I never went back to Eclipse. I should though, for the sake of Java.

My latest vision is to code a small game using JavaScript. The game will implement a simple version of Angband, a text based dungeons and dragons game. I am going to give myself a week or two to finish the thing. Good luck to me.

Debugging JavaScript

I finished reading a whole chapter on JavaScript debugging techniques. Luckily I have been debugging my code all throughout the book. So this topic was close to my heart.

The thing I like about JavaScript is that it is interpreted. The interpreter knows exactly where it is in the code when it encounters a problem. This allows the browser to report the exact line number where there is a problem.

With compiled languages, you might be only able to approximate where you are in the code when a problem occurs. I have not yet tried either of the tools from Mozilla or Microsoft to step through the JavaScript code. However I bet those will come in handy as my JavaScript programs get larger and larger as I learn more.

Regular Expressions

So far I have not been too impressed with the JavaScript programming language. The loose typing is driving me crazy. And I discovered the Object Oriented Programming is not really that object oriented. Today however I was happily surprised to find out that JavaScript supports regular expressions.

I have mostly been staying away from learning regular expressions. And I know I should not be. JavaScript provided me a way to learn both the language and regular expressions a bit. It supports the Perl 5 version of regular expressions. The little bit I have been playing with are very powerful.

After JavaScript I plan to go back and beef up my Java skills. But I might be able to dig in deeper and gain some good experience with regular expressions as well. Today I only scratched the surface of what looks to be a powerful tool.