3 ms·
I was wondering today what the average/median string length is in programming. Google hadn't a clue. I'm curious if Wolfram does have an answer.
by Jan-Jaap 17y ago
I was wondering today what the average/median string length is in programming. Google hadn't a clue. I'm curious if Wolfram does have an answer.
- anigbrowl 17y agoYou mean, how long is a piece of string?
- Jan-Jaap 17y agoNo. I'm currently implementing a VM, and was wondering whether there's any point in inlining strings <= 3 chars in machine words. Knowing what percentage of strings is <= 3 chars would tell me whether that's a worthwhile optimization.
- anigbrowl 17y agoOh OK. I thought it was a rather abstracted joke =) After thinking about your query, the only good idea I had was to take something like a large open source codebase and write a program to search for string/char declarations. It'd probably be faster just to try your idea and see whether it helps or not :-/ Oh, and nothing about that on Alpha, sorry. I did ask it 'how long is a string' for fun, and it suggested that the length of a given random string is 12. And who am I to argue?