Archive for 22nd December 2006

Objects (Classes) Explained In Very Simple Terms

One of the most common questions on Yahoo! Answers is how classes or objects, or the parts of a class / object, such as properties, methods and events, work.

Here’s a gross simplification of how classes and objects work. Most of this is lifted from a previous blog entry, Interpreting A C# Class Code Structure.

Classes / Objects

A class or object is a way of combining all sorts of data that relates to a single thing in one place, and a way of associating functions with that data. (For most intents and purposes, classes and objects are the same thing. Whenever I use the term class, I also mean object; whenever I use object, I also mean class. More on that in a moment.)

For example, you can think of a human as a class.

In the human class, you are an instance. For example, you might think that God decided to run this code when you were born:

Dim you As New HumanBeing()

What He did was create a variable, named you, and set the value of that variable to be an instance of the HumanBeing object. An instance is the actual use of an object. The object is the mold; the instance is the actual thing you made from the mold.

(Most programmers use the term class when they are speaking about an instance, and object when they are talking in general terms, so that’s the real difference between class and object. However, you can generally use the two terms interchangeably when discussing a specific programming issue.)

Continue reading ‘Objects (Classes) Explained In Very Simple Terms’ »

Guilty, Guilty, Guilty

Reported by AFP, the French version of the Associated Press:

PARIS (AFP) - The Internet has given birth to a quirky range of modern addictions and maladies, the British weekly New Scientist says in its Christmas issue published this Saturday.

They include these:

- EGO-SURFING: When you frequently check your name and reputation on the Internet.

I don’t do that frequently; every other month or so, tops.

- BLOG STREAKING: “Revealing secrets or personal information online which for everybody’s sake would be best kept private.”

Well, I do pretty much give my entire life’s history on this site.

Continue reading ‘Guilty, Guilty, Guilty’ »

A Mean Trick To Play On Windows Computer Users

Recently asked on Yahoo! Answers:

How to Make a fake error message on notepad?

Hey guys i wanted to know how to make a fake error message on my computer using notepad so i can send it to my friends and scare them as lyke a april fools joke
if you know plz tell me thanks peace out guys

I actually have a much meaner trick that’s a staple gag among help desk people, one that exploits the fact that even otherwise competent computer users aren’t all that observant. It takes a few steps to pull off, but it works 9 times out of 10 to totally frustrate people, so it’s well worth the effort.

Basically, what you do is replace their desktop wallpaper with a picture of their current screen, then remove all the real icons and taskbar — so that clicking on things doesn’t work at all.

Continue reading ‘A Mean Trick To Play On Windows Computer Users’ »