Subj : Re: Win98 error To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Sun Mar 14 2004 05:15 pm Thomas Maeder [TeamB] wrote: >I have the feeling that you tend to do premature optimizations. Not sure what's premature about using your accumulated experience when coding instead of writing slopy stuff and relying on a profiler to tell you what the worst of it is, or the compiler to make it go away. If I understand "premature optimization", it's going through the code and saving a picosecond in code that's executed once. I agree that's not worth it, but... If you _consitantly_ write in an optimum manner, you lose little coding time, and your overall code will be faster/smaller. Unless I come up with a new algorythm, I don't go back and hand-optimize or profile my code (because it was optimized from the start). And, I dislike waste, even if it is only executed once. (Probably a hold-over from the old-days of tight core). >?live16387@32: ; EAX = ByteB > cmp al,27 >16bit compares are performed in all three cases. This is with 32bit ints; the Uh, hate to tell you this, but.... al is 8 bits. >> I've been very carefull to never place ints in structs. >> That's good, right? > >As a general rule, I don't agree. If you have a compelling reason for doing >this in particular struct types, then it's certainly good (by definition of >"compelling"). Do you have such a reason? "compelling" is that the structs will break when compiled on different platforms. Though I see your point, that if the structs are "only" internal, self-use, non-persistant, you could get away with ints. Once again, I err on the side of caution, as I see no good reason _to_ use ints in strucs. .