- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Unfortunately, not. With two calls to random, it's even more random!
Admin
Avoiding partial register stalls is another reason to use XOR -- it is recognized as a zeroing instruction since at least the early Pentium era.
The real problem arises when people are trying to outsmart the compiler and code stuff in assembler without doing any measurements. I've seen this a lot in the Delphi System unit code, for example: "Tricks" like storing two independent byte variables in the same register (e.g. AL and AH), in a failed attempt to be clever and enhance register space. If you do that in a tight loop it can seriously impact performance (the Pentium III was particularly vulnerable).
Thus, when doing assembler, you really need to RTFM. Repeatedly.
(Oh, and it's a 3-byte difference in 32-bit code. As for Jed, I think he was just trying to be humorous.)
Admin
// if the auto-breakout feature hasn't kicked in yet then "there is a serious problem"...
where? lets randomly choose if the problem is in the programmer.
Admin
When I read most of the comments of people, I'm impressed by their shallowness. I mean like, so what? If a programmer uses a little bit of imagination, so what? I've maintained different people's code, and they have different styles and are dealing with different situations. Everyone thinks their style is best. A lot of things are like the old Word vs. WordPerfect debates. Users of each would think theirs was better.
I'd rather work with a person who knows how to think for himself than someone who just accepts popular opinion without question.
Admin
Are you being sarcastic? I can only guess so.
I think his absurdly long functions are a joke about people using these functions instead of the basic syntactical operators such as "=" or "==".
You need a lesson in such humour.
Anyway, the point of the article is that he had time to do that when he should have been working.
Admin
Oh yes, I am quite sure your code has been optimized to the fullest!