2010-02-28

Trust in Giant Corporations


Nothing improves trust in a multi-national bank's online security quite as much as a directory listing for a home page.

2010-02-07

It's The Small Things

One reason I love VHDL is that the store operator isn't the equals sign:
IF (SHIFT = state_reg) THEN
read_value <= next_value + read_value;
END IF;
Here is some (nearly) equivalent code in C:
if (SHIFT == state_reg) {
read_value = next_value + read_value;
}

Both lines of code instruct that if state_reg is equal to SHIFT, read_value should be incremented by next_value.

In C the = sign doesn't actually mean equals - that is what the == symbol means. In C, as in most programming languages, the = symbol really means "store the right-hand value into the variable." This caused me no end of confusion when I started programming - if you subtracted read_value from both sides of "read_value = next_value + read_value" wouldn't you get "0 = next_value?" In reality the line instructs the computer to add next_value to the current value of read_value, and store this sum back into read_value.

In VHDL = means equals and <= means store. Unfortunately <= also means less than or equal to. I would have preferred VHDL to use the symbol <- for store. In the first programming language I ever learned, TI-86 BASIC, there was a single-character symbol for <-. I still find the first line below to be the most intuitive of the three:
sum <- element + sum
sum <= element + sum
sum = element + sum
I doubt programming languages will ever change from the equals sign to something else, but I would appreciate it. Every now and then my brain seems to go into math mode, and the = symbols still cause me confusion, but the <= is close enough to <- that I don't seem to notice. Oh well, maybe I'll never master C.

2010-02-03

PyCharm

I love PyCharm from JetBrains! I used Resharper when I was a C# monkey, and I am all ready much more productive with Python because of JetBrains. If you're a Python programmer you have to check out PyCharm as an IDE.