Object oriented programming
Sunday, April 13th, 2008The most important thing right away:
Look at the world around you. Everything(!) you see are objects.
Even yourself are an object.
The most important thing right away:
Look at the world around you. Everything(!) you see are objects.
Even yourself are an object.
Once I spoke with a good friend of me who is developing also, but has learned his programming skills autodidacticly, about ruby and told him that I like the way of handling variables in ruby. In that context I called ruby being a duck-typed language and he gave me a queer look. I gave a [...]
Many people doesn’t seem to understand the ?:-Notation. But it’s quite easy.
var = foo ? val1 : val2
Doesn’t mean anything more then:
(Using C/C++/Java/… notation)
if (foo) {
var = val1;
} else {
var = val2
}
(Using ruby, … notation)
if foo then
var = val1
else
var [...]
How to understand the modulo (mod, %) operation? Well, quite easy.
Let’s assume you have
13 % 4
If you simply devide 13 by 4 you get some thing like 3,25 or “3 1/4″. When you are interested in the modulo you forget about the “3″ and just look at the rest, that can’t be divided by [...]