Tuesday, September 29, 2009

Bitwise operations

A very cool article on bit operations. Samples provided using C language, but overall the article is language agnostic. Easy to read and very informative.

Thursday, September 24, 2009

Online tools for Regular Expressions

This site is very useful and performs well. Lets you test the expresson, view matches, and replace string elements. Not pretty, but performed flawlessly.

This one looks interesting but I've found the performance a bit twitchy. Still, it lets you visually examine your expression and can probably help you find some syntax errors quickly. It's probably going to be worth re-visiting this site to see how it grows.

Sunday, September 13, 2009

Semicolons in javascript

So, after examining some Google code I found they use semicolons more for statement delimiting than termination. Last statements in a code block are not semicolon terminated, only preceding code lines are. This got me searching for the meaning of semicolon in javascript. I found many sites stating it is optional, and many sites which warn of the danger of following this practice.

Although the script interpreter will insert semicolons at the end of lines, this may break down if the script is stripped of all needless white space. Therefore a good rule of thumb seems to be to put semicolons at the end of lines to clearly indicate the end of statement. Google's practice of using semicolon as statement delimiters seems to be adequate as well.

On a related topic, i have also found some advice for properly formatting javascript code because the interpreter will insert semicolons where it thinks appropriate. This is something I was not aware of before and knowing this now will probably help debug some code down the road.