Re: Don: Radio Button slight correction
- Posted by Al Getz <Xaxo at aol.com> Nov 23, 2005
- 469 views
don cole wrote: > > Hello Al , > I really haven't really read you Radio button post yet (I will) because > CheckBox is good enough for my purposes right now. > > However I do have another question. > I read somewhere that it best to use integers rather than atoms when decimal > points are not needed because integer program execution runs faster. > I noticed in your winClass that you declare every control as an atom. > Why? > \ > Don Cole > A Bug is an un-documented feature. > A Feature is a documented Bug. Hi there Don, Well, in some apps it's not going to matter because the ratio of the time spent using an atom is extremely small compared to the time spent in the code that uses the atom. This means most apps will only use maybe 1/1000 extra time using an atom instead of an integer. This amounts to a piece of code taking 1.001 seconds instead of 1.000 seconds using an integer. Even with many calls like this, the total time only increases by the same (1/1000)^th factor. The exception to that rule of thumb is when the piece of code is very short and it's in a loop that has to repeat many times. The main reason i started using atoms for "id's" is because originally i was going to use the extra storage capacity of the atom (over the Eu integer) to keep track of something major about the control being created (such as whether it's a menu, window, or neither) but i dropped the idea, at least for now, because it requires (at least) one subtraction extra before the id can be used for anything. Also, the word "atom" is much faster to type then the word "integer" when im declaring lots of var's for later use in the program. I hope you dont mind using an atom instead of an integer, and you'll find it's faster to type too :) If at some point "types" get better in Euphoria i'll declare a type for all the id's such as: type ID(integer x) return integer(x) end type or something to that effect. Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"