3 ms·
I think crypto code is a bad example. This[1] would not be considered "idiomatic" anywhere, except in crypto. And for example, if one was optimizing for code r
by joshuamorton 9y ago
I think crypto code is a bad example. This[1] would not be considered "idiomatic" anywhere, except in crypto.
And for example, if one was optimizing for code readability over performance, I expect that would look very different (although you could do much of the same with macros, but I'm not sure if that's any better).
[1]: https://github.com/LoupVaillant/Monocypher/blob/master/src/monocypher.c#L1070 https://github.com/LoupVaillant/Monocypher/blob/master/src/m...
- loup-vaillant 9y agoEach domain has its own quirks. I'd definitely use a different style (even a different language) for other domains. I thought of showing some of my OCaml code as well, but I didn't put nearly as much effort, so I'm not so sure about its quality.