I don't think the absurdly wrong use of Mathematica is the results: if you know Mathematica but not perl, use it. I've done my share of text processing in C and bit-manipulation in perl. A screwdriver makes a lousy hammer, but when it's what you got, it's what you got.
No, the real absurdly wrong use of Mathematica is: "High school teachers could use these words to increase the interest in the subject." I'm certain distinterested students will pay even more attention to you when they learn that you spent the time learning to make sentences out of only elemental abbreviations!
Much more interesting, in my experience, is finding equations with dirty connotations, like ∫ex dx. Which, fortunately for every dull calculus teacher on the planet, is a key, fundamental result in the integral calculus. I suppose the prudes just teach with t as the variable.
regarding the absurdly wrong use of Mathematica: the numbers speak for themselves -- it took 25 hours to compute. That actually suggests that he had a lousy algorithm, too, because it's far too long, even in a slow interpreted language like Mathematica. With a fix to the algorithm, perhaps he could have used that screwdriver for a hammer somewhat more effectively.
the numbers speak for themselves -- it took 25 hours to compute.
Unless he needs to run it every day, that's really a nonissue. If it was a real system that other people were going to depend on, i agree: wrong tool. But if he's just knocking out data once, meh. You probably see the exact same sort of thing when massaging input data (i know i do). "Do i automate the cleanup, or should i just do it by hand?" It always comes down to future-proofing and them total time spent.
More importantly, i'm willing to bet the poor guy only speaks Mathematica, which limits his tool selection. Especially since he likely can't use REs if he only does Mathematica (even though it supports them).
(vaguely on-topic: I've run into those daily time limits before, too. Merging and processing logfiles totaling 10+Mhits/day on a daily basis isn't totally straightforward. Especially if you're a succession of several J. Random IS Masters Students. Who insisted on doing it with an abomination of poorly-designed perl, spectacularly bad Java, and pre-standards C++ that made Baby Bjarne cry. A bit of finesse and it was back to reasonable runtimes. And no more of those pesky half-processed failures when they tried to convert HTTP/1.1 into an integer without handling the "Not a number, numbskull" exception. Or when they got random encodings in the input stream. I eventually got frustrated and rewrote about 80% of the system, which would've run in about 4 hours (C merging and Perl processing). Sadly, it never got completed before i left. But, aside from this: up until a year ago, the system was continuing to mostly-work. Maintenance was a nightmare, but it was usually functional.)
All this talk of runtime reminds me of one of my favorite quotes:
"Say you have some calculation that will take 1000 years to complete. You could start your machine running today and come back in 1000 years, but there is a better way: go to the beach for 14 years (if the Moore's Law doubling period is 18 months), buy a new machine, and solve the problem in a single year." -- James Gosling
The programmer admitted ignorance to the proper use of Mathematica.
In fact Mathematica 5 has excellent regular expression capabilities, and this could have been done as a highly-computationally efficient one-liner. (Well, maybe a very long line cause you have to include all the various element symbols, but you get the point...)
no subject
Date: 2006-01-04 08:01 am (UTC)No, the real absurdly wrong use of Mathematica is: "High school teachers could use these words to increase the interest in the subject." I'm certain distinterested students will pay even more attention to you when they learn that you spent the time learning to make sentences out of only elemental abbreviations!
Much more interesting, in my experience, is finding equations with dirty connotations, like ∫ex dx. Which, fortunately for every dull calculus teacher on the planet, is a key, fundamental result in the integral calculus. I suppose the prudes just teach with t as the variable.
no subject
Date: 2006-01-04 06:32 pm (UTC)no subject
Date: 2006-01-04 10:33 pm (UTC)Unless he needs to run it every day, that's really a nonissue. If it was a real system that other people were going to depend on, i agree: wrong tool. But if he's just knocking out data once, meh. You probably see the exact same sort of thing when massaging input data (i know i do). "Do i automate the cleanup, or should i just do it by hand?" It always comes down to future-proofing and them total time spent.
More importantly, i'm willing to bet the poor guy only speaks Mathematica, which limits his tool selection. Especially since he likely can't use REs if he only does Mathematica (even though it supports them).
(vaguely on-topic: I've run into those daily time limits before, too. Merging and processing logfiles totaling 10+Mhits/day on a daily basis isn't totally straightforward. Especially if you're a succession of several J. Random IS Masters Students. Who insisted on doing it with an abomination of poorly-designed perl, spectacularly bad Java, and pre-standards C++ that made Baby Bjarne cry. A bit of finesse and it was back to reasonable runtimes. And no more of those pesky half-processed failures when they tried to convert HTTP/1.1 into an integer without handling the "Not a number, numbskull" exception. Or when they got random encodings in the input stream. I eventually got frustrated and rewrote about 80% of the system, which would've run in about 4 hours (C merging and Perl processing). Sadly, it never got completed before i left. But, aside from this: up until a year ago, the system was continuing to mostly-work. Maintenance was a nightmare, but it was usually functional.)
All this talk of runtime reminds me of one of my favorite quotes:
"Say you have some calculation that will take 1000 years to complete. You could start your machine running today and come back in 1000 years, but there is a better way: go to the beach for 14 years (if the Moore's Law doubling period is 18 months), buy a new machine, and solve the problem in a single year."
-- James Gosling
no subject
Date: 2006-01-04 06:32 pm (UTC)the real problem
Date: 2006-01-08 10:56 pm (UTC)In fact Mathematica 5 has excellent regular expression capabilities, and this could have been done as a highly-computationally efficient one-liner. (Well, maybe a very long line cause you have to include all the various element symbols, but you get the point...)