Friday, September 29. 2006
PHP braindamage
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.
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.
Saturday, September 2. 2006
mrmcd101b in Darmstadt
Gestern abend noch auf die mrmcd101b (metarheinmain chaosdays) gefahren. Ganz nett, bislang deutlich größer als letztes mal in Wiesbaden. WLAN funktioniert nur durchwachsen, dummerweise hab ich kein Wired-Kabel mehr dabei.
Wir machen am Entropia-Stand grad AIGLX/Compiz-Späße, zwei Gentoo-Rechner schon mit versorgt und ein Debian wird grad auf Gentoo umgestellt. Ich halte später auch noch einen Lightning-Talk dazu, wer Lust auf wobbly Windows hat, darf vorbeikommen.
Kurzberichte zu Vorträgen kommen später noch ein paar,
Wir machen am Entropia-Stand grad AIGLX/Compiz-Späße, zwei Gentoo-Rechner schon mit versorgt und ein Debian wird grad auf Gentoo umgestellt. Ich halte später auch noch einen Lightning-Talk dazu, wer Lust auf wobbly Windows hat, darf vorbeikommen.
Kurzberichte zu Vorträgen kommen später noch ein paar,
Posted by Hanno Böck
in Code, Computer culture, Life, Security
at
16:10
| Comments (0)
| Trackbacks (0)
(Page 1 of 1, totaling 2 entries)