开发者

PHP: Which functions and techniques a good programmer should not use?

Which f开发者_Python百科unctions and techniques should a good programmer not use?

Probably ereg is one of them.

Is it a good practice to use the global keyword, or should I avoid it as much as possible?


Good programmer should understand how things are working and decide when and how it's best to use them. Mostly everything has good use for it and everything can be used in wrong way.


Don't use short open tags. Short open tags look like this <? //somecode ?>. There are several problems with those.

One of them is that on some servers short open tags might be turned off in the config which would draw your PHP code useless.

Another problem might be that it can cause conflicts with the XML opening tag.


I agree with @Alin But theres also a few others you should look at. Most of these are basic knowledge as you progress in your programming and it is your responsibility to keep up with the latest language evolution and best practices.

Of the top of my head I can give you a few though :

eval() 
goto() 

Suppressing errors with @ for example @copy() or @mkdir

Just to name a few. The internet is full of good articles on this topic.

http://www.kavoir.com/2008/12/bad-practices-in-php-coding.html

Theres a whole lot of good reads so happy googling.


A good programmer should not use deprecated functions and techniques.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜