??? 08/15/05 18:47 Read: times |
#99472 - Don't know Responding to: ???'s previous message |
Erik Malund said:
I see that maybe I were not clear here, it is just that so often I have heard the word "elegant" used about code that was written more for the "programmer" (quotes deliberate) to be able to brag than for the program to function in a working and understandable way. I guess I'd appreciate that more had I ever seen it. Well, maybe I've sort of seen it in open-source software such as the Linux kernel where the code is absolutely impossible to follow because it appears the developer was in some contest to see if he could turn 10 lines of 'C' code into 1 line of 'C' code using compound conditions, etc. Is that what you mean? If so, I wouldn't call that elegant. I don't even see why someone would brag about having written it. That's just messy coding. so "Elegant" refer to the programmer showing off.
"looking good" refer to being obvious Now this may be where I differ. If the programmer is showing off good code, then he has every right to "show off" and brag about this code. Elsewhere in this thread you mentioned that you saw the 8052.com challenges as a good place to show off without hurting anyone--I would disagree: If you can write solid code that does in 50 instruction cycles what another routine does in 80, then that's a good thing. I think I'm still not catching your meaning of "elegant." Efficient code, to me, is elegant. As such, I would disagree that elegant code is a bad thing. But if by "elegant" what you mean what I described above (compacting 10 lines of source code into 1 line of source code) then I would agree that that is a bad thing; but I would disagree that such code is "elegant" in the first place. Regards, Craig Steiner |