Friday, November 03, 2006

Can Code Disable Code?

Consider a situation.

A web site, on the first login for a user, displays

"Hello Sam!. This is the first time u are using the portal. Let us guide u thru....and blah blah".

On the next log in it reads "Welcome back Sam"

In contemporary code such a simple thing could be done by keeping track of ones login attempts. But what is actually needed is a mechanism which runs thru the code to do the former only once and the latter every time hence.

I am not talking about using an If with a condition. What is actually needed is a mechanism such that the if itself is eliminated. i.e the code is disabled all together. Then it wont need a check in the first place and probably the complexities of computing an If condition are avoided altogether. Would the code not be more efficient?

IS SUCH A THING POSSIBLE?

~ Dead Pep