hi
i had some knowledge with php and asp, but im not an advanced one. recently i decide to learn php in more depth. because i like open source and i see a lot of fans trying to make it better than before.
and im reading a book for it.
something that bother my mind is function names.
i want to know why functions (not all of them though) have no meaning full names in them?
for example if i want to work with files, i have: fread(), readfile(), fpassthru(), file() functions. and as you see none of them tells you what they do if you are not familiar with them.
also for naming, some of them use "file" (like: readfile, file) and some of them use "f" as abbreviations (like: fread(), fpassthru()) .
also for reading from file i have: fgets(), fgetss(), fgetcsv(). again, name tells you nothing. for example if you see fgetss() for the first time, you cant say what is the difference between fgets() or fgetss().
another problem i see in functions is name convention. for example we have file_exist() and filesize(). why in some function there is an underline between names and in some of them there isn't?
if i know some language like c or delphi, i expect when i use filesize(), there is a function name fileexist() or vice versa.
also i noticed that php still haven't got unicode support with asp had it a long time ago.
i know it probably needs huge code to be implemented, so its not a big deal in my mind if php haven't got it since.
but names of function is a simple thing to fix and it should be straightforward for those who are going to learn php.
as far aas i know, asp have a better naming and almost all of them gives you some idea about what they do.
i was a fan of php and when we debate with my friend, i was in php side and against asp.
the next thing that i couldnt figure out is new feature, i looked in changelog of php 5.3, and i see its now support for closures ans true anonymous functions, i know it has its use, but lets face it, doesnt something like this make our code much less readable?
i see an example about it in wikipedia:
function getAdder($x)
{
return function ($y) use ($x) {
return $x + $y;
};
}
$adder = getAdder(8);
echo $adder(2); // prints "10"
but these things that i see are bothering me, can someone please correct me if im wrong?
i hope i could make my mean clear.