Customizing SMF > SMF Coding Discussion

Why are we using array keys?

(1/3) > >>

Alex4108:
Something someone brought up a very good point in an IRC server I use the other night.


--- Quote ---Jon32: Why the !@#$ are they using array keys as functions?
Jon32: Alex, get a real forum system. 
Jon32: these nubs have no idea what they're doing
Jon32: <link to another forum system>

--- End quote ---

So it's a good question.  Something I learned in programming is that there is ALWAYS more than one way to do something.

So why are we using array keys?  Why not classes/objects or just straight functions?

Doctor Deejay:
I'm looking forward to see mr. Jon's software. In the end, he knows everything much better than these 'nubs'. ::)[/cough]

But I actually don't really know what (s)he means with array keys. Is it something like:

--- Code: ---function whatever($cake = true, $temperature = 23°c)
--- End code ---
?

Yoshi:
Dr. Deejay: I'm sure he/she means the $smcFunc['function'] functions.

Dunno why, maybe to leave those functions out if you don't want them or so.

Doctor Deejay:

--- Quote from: Yoshi2889 on July 20, 2012, 04:26:23 AM ---Dr. Deejay: I'm sure he/she means the $smcFunc['function'] functions.
--- End quote ---
Ah thanks. :) In that case, I don't really see why it's a problem to be honest. :s

Yoshi:

--- Quote from: Dr. Deejay on July 20, 2012, 04:28:34 AM ---
--- Quote from: Yoshi2889 on July 20, 2012, 04:26:23 AM ---Dr. Deejay: I'm sure he/she means the $smcFunc['function'] functions.
--- End quote ---
Ah thanks.  In that case, I don't really see why it's a problem to be honest. :s

--- End quote ---
Meh I like them, see no reason to abandon them.

I think it was designed for that database systems could use their own functions, though still weird. As in MySQL could use $smcFunc['db_query'] to execute a query, but if the forum was switched or installed rather to either PostgreSQL or SQLite those functions are edirected itno #smcFunc.

Navigation

[0] Message Index

[#] Next page

Go to full version