Matt had heard the argument before. "Scientists can write code just as well as CS majors," his new supervisor at the research laboratory was saying. "As long as the language is mature, Turing-complete, and well-documented."
"Like MATLAB," Matt said.
"Exactly." His supervisor giggled. "MATLAB? Get it? Matt-LAB?"
Matt groaned.
He had been hired by the lab to improve the interoperability of their software. Matt had demonstrated impressive proficiency with the language in his interview, which was making him the butt of countless jokes. After running some unit tests on their premier application, he noticed a lot of lag while the software performed simple arithmetic on some data sets. It didn’t take long to find the first culprit:
dlmwrite(strcat('\interim data\', num2str(index), '.txt'),data);
That’s a lot of data being written to disk, Matt thought. Where is it being used?
He found the answer deep within a nest of for-loops:
data = dlmread(strcat('\interim data\', num2str(index), '.txt'));
Matt discovered that the program was writing out hundreds of data arrays to hundreds of CSV files, then reading them back in. Scrubbing the write/read logic for simple variable assignment improved the speed of the application tenfold without significant memory overhead.
He went to see his supervisor to report his results. "Matt-LAB!" His supervisor shouted. "Thanks for speeding up the application. I just want you to know, your contributions to this project really...Matt-er."
Matt turned in his notice the next morning. He didn’t know which was worse: the constant stream of puns he would have to endure, or that a group of scientists thought they could reinvent virtual memory in a fourth-generation language.