News for hackers. Stuff that matters.
Re:Tell HN: Wolfram Alpha preview goes live by Jan-Jaap on Friday May 08, 2009 @07:24PM (#600455)
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.
Re:Tell HN: Wolfram Alpha preview goes live by anigbrowl on Friday May 08, 2009 @08:10PM (#600508)
You mean, how long is a piece of string?
Re:Tell HN: Wolfram Alpha preview goes live by Jan-Jaap on Saturday May 09, 2009 @05:11AM (#600857)
No. 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.
Re:Tell HN: Wolfram Alpha preview goes live by anigbrowl on Saturday May 09, 2009 @01:55PM (#601175)
Oh 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?