foreline
foreline

Reputation: 3821

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

Which functions 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?

Upvotes: 0

Views: 191

Answers (4)

Alin P.
Alin P.

Reputation: 44346

A good programmer should not use deprecated functions and techniques.

Upvotes: 0

Etienne Marais
Etienne Marais

Reputation: 1690

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.

Upvotes: 2

Octavian Helm
Octavian Helm

Reputation: 39604

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.

Upvotes: 3

Māris Kiseļovs
Māris Kiseļovs

Reputation: 17285

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.

Upvotes: 7

Related Questions