On Fri, 22 Jul 2005 15:31:55 -0500 Brian Sakal <[EMAIL PROTECTED]> babbled:

> Hi. I'm studying E17 source code and I'm seeing a lot of magic-this
> magic-that... Is this a traditional joke like foo and foobar or does it
> signify something?

as in the rest of this thread  magic numbers are used to uniquely (with very low
probability of error) identify something. on disk with files they are often used
to make sure the file is the format u expect before doing much more expensive
parsing work. in memory efl and e itself use them to mark memory objects
specially and detect when u pass the wrong object type to a function and save
the code from a segv by aborting early on after a very simple integer compare.
they are used to also detect freed objects/ram as well as valid objects and
types. they are not used for anything by checking as such and thus are seemingly
"magic" as u can't EXPLAIN why they have a value they do - without a much higher
level overview of things. the term "magic numbers" has just stuck around for so
long its a standard term for describing them now. like all things in languages
usage often then DEFINES the language and meaning of words :)


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]
裸好多                              [EMAIL PROTECTED]
Tokyo, Japan (東京 日本)


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to