Quick tip - using cfthrow as a reminder

I just typed this code in and I thought I’d share it to see if I was the only one who did this.

I’m working on a process where I need to do one of two things. Tonight I’m working on the first branch, but the second branch may not be worked on for a while. In the past I’d do something like so normally:

<cfif condition> what I'm doing <cfelse> </cfif>

If I was half-way awake, I’d maybe even do this:

<cfif condition> what I'm doing <cfelse> <!--- do the other thing ---> </cfif>

That works, but lately, I’ve been using cfthrow. The point being that if I forgot to actually code the other block, the second it does being to fire, I can’t ignore it.

<cfif condition> what I'm doing <cfelse> <cfthrow message="Implement this block"> </cfif>

Anyone else do this?

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA https://www.raymondcamden.com