Blogtrek

Blogtrek

2003/12/02

OO Programming Language Developers need to learn English

One of the principles of English is that proper nouns and adjectives are capitalized. For example, "car" is not capitalized for it is a common noun. It describes a car in general. However, "Toyota #137245" is capitalized because this is a specific instance of a car. It is a proper noun. The word "person" is not capitalized because it is a general word for any person. The words "George Walker Bush" are capitalized because they describe a specific person.

Object Oriented programming language developers have come up with a similar concept, namely that of a class. A class is a type of structure that is defined and generic, representing any old thing in the class. An instance of a class is a specific example of the class. An example of a class would be "cat". It would have attributes such as weight, breed, and the pitch of its meow. A specific instance of this class might be Boots. His attributes would then be 15 lb, tuxedo kitty, and high-pitched. I suppose you recognize this as exactly the same concept as that of common noun and proper noun in English.

Well if so, then why do OO programmers do it the other way around? In English we would say:

My cat is named Boots.

But in an OO language such as C# or Java, we would say:

Cat boots = new Cat;

That's just the reverse of how English does it! All of the books I have seen capitalize classes and lowercase instances. Why? Why can't we be consistent and why can't we notice OO programming in our everyday language when it exists? When I program, I am going to write

cat Boots = new cat;

and that will be that.
Oil Shortage Jokes

Today I hit upon an interesting picture on the Oil Crisis site. It shows the next two models of SUVs. The first is one that comes with its own portable drilling rig. The other is the DonCar. You need to click on that to see what a DonCar is. I also like the couple coming into a back to ask for a loan to fill the SUV's gas tank. What other Oil Shortage jokes can we come up with?

The Oil Shortage Traffic Light. A policeman at the center of an intersection yelling "Red!!", "Green!!", "Yellow!!".

The Oil Shortage Traffic Cop Uniform Fashion. A suit that is one-third bright phosphorescent red, one-third phosphorescent yellow, and one-third phosphorescent green. Four such police officers form a square and turn at appropriate times to show the appropriate color to the bicycles, pedestrians, and buggies that want to cross.

The Oil Shortage One-Person Airliner. A long-necked swan. You just hop on him, tell him "fly", and you're on your way!

The Oil Shortage Gasoline Price Sign. Each day the price goes up by zero. That's right, zero. They just add a zero onto the end of the price. Today's it's $3, tomorrow it's $30, the next day, $300 and so forth.

I suppose you can come up with other possibilities. We all like to laugh at ourselves at times, and we need some levity while considering the impact of the future shortage of petroleum which we know will come sooner or later, maybe around 2011 or so.
Abstract Wars

I read that the official national military strategy of the US includes the principle, "The enemy is terrorism." Whaaa??? How can our enemy be an abstract concept? There are no guns, no grenades, no rocket launchers, no artillery shells, and certainly no weapons of mass destruction that are effective against an abstract concept, for such does not exist as material objects in our world. It's like holding a non-abelian group up at gunpoint. Or holding the number 666 up at gunpoint.

Let's stop warring against terrorism and see if we can control these violent acts by (3) defending ourselves against terrorist acts, (2) getting rid of terrorists, and especially (1) ensuring by our behavior and cooperation with other nations and people that there are no terrorists in the world to begin with.

2003/11/30

A song a day

I came up with a new idea for journaling today. Call it songaling. This is that of composing a song each day. It is only about 16-32 measures long or so. The idea is that I would meditate briefly to get the songs that keep playing in my mind all the time and would influence what I would play out of my mind. Then I would play whatever comes up. Some interesting things have come up. After eight days, I have three rather pensive pieces, a Latin dance, a majestic composition sounding like a graduation song or a national anthem, a really weird piece, a blues number, and a 5/4 jig. The Latin number was inspired by my seeing a news segment on people who visit Cuba. Perhaps I could call it "What's so bad about Cuba?" or "¿Cuál es tan malo sobre Cuba?" I have put the anthem-like song on line because it is so inspiring; it is my Song of 2003 November 26. Click on the name to play it.

I don't know how long I can keep this up, but it provides a wide repertoire of my own music, some of which can serve as preludes at my church for instance, and if I continue it over a year, I will have written 366 compositions.