get_flag versus get_sdf

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/
AuthorTopic: get_flag versus get_sdf
Member # 5576
Profile Homepage #0
Some while ago we had a discussion of the usage of these two supposedly identical calls. There was some feeling that get_sdf was somehow less trustworthy, although I was not able to identify why. Does anyone know of any actual differences between them, or are they really just the same as they should be?

Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Member # 7472
Profile Homepage #1
By all rights, the both appear to function exactly alike. However, I have had get_sdf kick out an error now and then for no particular reason.

Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Member # 6670
Profile Homepage #2
For consistency, I'd use get_flag, because there is no set_sdf or inc_sdf, just set_flag and inc_flag. I think JV just uses get_flag.

EDIT: According to the Wikibook reference:
short get_flag(short a,short b)
Identical to get_sdf.

short get_sdf(short a,short b)
Returns SDF(a,b).
So I'm guessing JV just had get_sdf to begin with, then added get_flag for consistency, leaving get_sdf just in case some of his code still referenced it.

Do not use for drying pets.
- Warning label on a microwave

[ Saturday, June 16, 2007 19:38: Message edited by: Dintiradan ]
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Member # 6193
Profile Homepage #3
I'd never heard of (or experienced) problems with get_sdf. Then again I've never used it or seen anyone else use it. I've used get_flag from the start, pretty much for the reasons Dintiradan just said-- using set_flag and get_sdf is just stupid (Plus for some reason flag seems easier to type than sdf. Which makes no sense since it has an extra character-- maybe it's more natural for me since it's a real word?)

Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00