Okay, I knew PHP isn't the most well-designed language in the world. I knew it grew up from a hobbyist language and that it is used for things today it never was meant for. I knew that it's function names sometimes aren't very intuitive.
But today I started to hate it. Now, beside various other strange things, this one let's me wonder which drugs the person that implemented this was consuming:
PHP is, by design, syntactical similar to C, meaning it has curly brackets, same comment syntax, same syntax for if, for and other basic commands. Now, one would probably think that a function named the same in C and PHP would do the same. Or at least something similar.
Due to the fact that C is very low-level, it has a function called sizeof() that gives you the amount of bytes a variable type uses in memory. E. g., an integer is the basic type of the current architecture, not always the same size (4 byte on i386, 8 byte on amd64). With sizeof() you can get the size of the type.
Now, I was looking for a function to get the number of elements in an array. I searched and found, well, sizeof(). Which I couldn't really believe. Due to the abstract structure of PHP, it seemed quite impossible to me to have something like sizeof() in php. It really gives you the number of elements in an array.
I'm not yet sure, but it might be that Ruby is becoming my language of choice for the future. It has a very neat syntax.
Do you remember doing findfirst and findnext in whatever stoneage lang it was to parse a directory tree? It's just a simple
Dir[ "#{cur_path}/**/*" ].each { |cur_file|
[some code]
}
Really nice!

Ich paste mal einfach die Ankündigung hier rein:
Der Entropia e.V. lädt im fünften Jahr zur GPN Programmiernacht ein. Am Wochenende vom 9. bis 11. 6. 2006 wird sich in den Räumen der HS(ex-FH) Karlsruhe eine hackerfreundliche Mischung aus Vorträgen, Workshops, Projekten, Chillout und Chaos entfalten und den Besuchern Gelegenheit bieten, ihr Wissen zu mehren und zu verbreite(r)n.
Die GPN hat sich inzwischen als süddeutsches Hackerevent etabliert und in den letzten Jahren für viel positives Feedback gesorgt. Auch dieses Jahr wollen wir uns wieder mit den Auswirkungen von Technik auf den Einzelnen und die Gesellschaft beschäftigen. "Hacken" nach der Definition des Entropia e.V. ist der verantwortungsbewusste und kreative, durchaus manchmal verspielte, Umgang mit Technik.
Der Schwerpunkt soll in diesem Jahr wieder verstärkt auf das Programmieren gelegt werden. Andere Themen rund um digitalen Lifestyle sowie Computerphilosophie und -sicherheit werden ebenfalls nicht zu kurz kommen. Auch die Karlsruher Lockpicker/innen vom Sportsfreunde der Sperrtechnik - Deutschland e.V. werden sich auf der GPN in ihrer Kunst üben und einen Einblick in die Welt des gewaltfreien Öffnens von Schlössern bieten.
Ich werde dort voraussichtlich mit einem Workshop über 4k-Intros unter Linux und mit einem Lightningtalk über XGL & AIGLX präsent sein.