Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christian M. Mackeprang:
4 forgotten code constructs: time to revisit the past?
Feb 10, 2017 @ 15:30:44

Christian M. Mackeprang has a recent post to his site sharing a few possibly forgotten code constructs whose use has faded in recent years. He revisits them, complete with code examples, and why he thinks they should be resurrected.

Some things in the programming world are so easy to misuse that most people prefer to never use them at all. These are the programming equivalent of a flamethrower: You might rarely be in the position to really need one, but every once in a while it turns out that you need to take down a forest. In that case, there’s no easier way than going Rambo on your codebase.

[...] That’s where a few of the old, forgotten code constructs come into play. Creative use of features such as goto, multiple inheritance, eval, and recursion may be just the right solution for experienced developers when used in the right situation.

The four constructs he recommends are: goto, multiple inheritance, eval and recursion. For each item in the list he provides a basic look at the concept and follows it up with "the right way" of doing things to prevent common issues with the feature.

tagged: code constructs past top4 list examples

Link: http://chrismm.com/blog/4-forgotten-code-constructs-time-to-revisit-the-past/


Trending Topics: