4 ms·
C string copy. while (*p++ = *q++);
by EliRivers 11y ago
C string copy.
while (*p++ = *q++);
- Teckla 11y agoInterestingly, I consider that deeply inelegant. But it sure is concise.
- EliRivers 11y agoIt's all in how one defines "elegant", I suppose. It relies on a handful of almost side-effects and the lucky confluence of a series of unrelated language choices; I see this and it reminds me of a dance, someone seeing the swinging pieces of the code and making a minor touch in just the right place, taking advantage of edge-effects that were never designed for exactly this but combine to make something emergent so simple and easy. I see this as breathtakingly elegant.