3 ms·
Really? itoa is one of your "magic incantations"? https://en.m.wikibooks.org/wiki/C_Programming/stdlib.h/itoa https://en.m.wikibooks.org/wiki/C_Programming/std
by mynameisvlad 4y ago
Really? itoa is one of your "magic incantations"?
https://en.m.wikibooks.org/wiki/C_Programming/stdlib.h/itoa https://en.m.wikibooks.org/wiki/C_Programming/stdlib.h/itoa
I get the others, but that ones a pretty standard type converter, the opposite of the C standard atoi
- mgunyho 4y agoAlso, aho-corasick comes from the name of this algorithm that is named after its inventors https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm
- enriquto 4y agoWhat is the point of this function? In rust, there's no equivalent to sprintf?
- mynameisvlad 4y agohttps://doc.rust-lang.org/std/fmt/ https://doc.rust-lang.org/std/fmt/ Different tools for the same job. One is explicitly integer to string conversion the other is sting formatting. You can technically use the latter, but some prefer a function which explicitly does one thing and one thing only.
- pie_flavor 4y agoMore accurately, some prefer a function that is statically dispatched and does not talk to std::fmt::Formatter.
- MichaelCollins 4y agoatoi is a classic example of the sort of bad naming C has long been infamous for. It's not a word, it's an initialism, and the common documentation for it doesn't even say what the initialism actually means. It's relatively easy to infer what it means from the description of what it does (ascii to integer), but can easily be incorrectly inferred ([character] array to integer.) C kind of gets a pass for this stuff because C was old and in the early days they were limited by token size. But to still be using this term today in a new language seems fairly derisible.
- nicoburns 4y agoIn fairness, C standard library functions mostly look like magic incantations to me (I think due in large part to the old-school convention of abbreviating function names). malloc, sprintf, atoi, etc don't exactly read like english... (unless you happen to already know what they stand for)