开发者

Is learning all PHP functions necessary?

Is it inevitable that all php functions will be used sooner or later when developing applications using php? Should only the required functions be learned to complete a project or should all functions be briefly understood before working on programs using php?

The List: PHP Function List

Also is there a benefit to learning deprecated functions from previous releases of php besides legacy applications?

I have worked quite a bit developing applications using the .NET framework (c#) and found it extremely helpful to understand mainly how the majority of classes work before undertaking a project. Before that it seemed like I was constantly looking back and forth between coding and documentation, and not that we should'nt be reading the documentation but开发者_开发问答 that it takes the fun out of coding when you can't go a statement without looking at the documentation.

Now I have made basic applications using PHP, and the majority of it has been the way I just described. Can I get your thoughts on how functions in PHP should be approached?


It is impossible to learn all functions available in the PHP standard library. Impossible I say.

There are a few handful of functions you'll need every day, and you'll discover them rather quickly and learn them by heart simply by using them. Beyond that there are hundreds of specialized functions you'll need every once in a while, depending on the project. You'll probably need to look up their specifics whenever you need them. Beyond that there are thousands upon thousands of functions you'll rarely need, if ever. You'll need to be able to find those when the need arises, but not any sooner.

The best way is to keep the manual close at hand and search it whenever you think "there should be a function for that". You'll do this a lot in the beginning and less often later on.

Feel free to skim the manual for function groups, you may discover that there are functions for stuff you didn't even know you could do. That may be valuable knowledge some day. Do not try to memorize everything in detail though. It won't stick anyway and only bore you to tears.


It should be approached as with any other language - you try to code something, get stuck, look up the docs if you find something related to your problem and use that. Otherwise you extend your research. There is no need to learn everything and anything. Personally, I don't see the point of reading about all functions simply to have read of them. Why should I, if I don't need them? Even though this is not coding directly, YAGNI (you ain't gonna need it) applies here as well. Learn about the functions when the need arises, not simply because you can.


IMHO, you should understand what certain function does rather then how it is doing it.. Obviously there are exceptions of functions that are similar (i.e. str_replace vs preg_replace or print vs echo - mostly string functions) and knowing how they work might give you an insight of performance.

Learning ALL php functions is not really necessary as you will not need them in everyday coding. You'll learn as you go (e.g. you need to manipulate and array; then you go and read all PHP array function and see if any suits the need for your problem. rather then doing it another way around. learning all php functions and start coding)


I can only support th answers given...

  1. It is more or less impossible because there are a lot of functions, and when you have learned all the function there are functions you do not know they exist.

  2. You have no big benefit comparing to the time you need to learn them. All important functions you will use every day and so learn them by using them.

  3. Every day there are new libraries, or new versions of existing and useful libraries, every day some other programmer writes a new function and post this function in one of the millions pages on the web.

  4. When you need some special funciton, you will use the manual, or if it is some exotic function use google. And when there are no solution for you problem, you will code som own funcitons and libraries and use them instead of functions in the manual or other libraries...

So I think that are some of plenty reasons not to learn all php functions...


Of course not.
Only string manipulation ones.

Dunno where did you get that list. It's totally useless. Not list but structured reference is what you really need.

Just take a brief tour on manual sections to picture yourself list of PHP features, so, you'll know where to look on occasion.

Only string manipulation functions deserve closer look, just because PHP itself is mainly string manipulation language.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜