Thursday, October 25, 2007

Tip for Perl coders

Do NOT use a function that decreases the readability of your code (WITHOUT COMMENTS) because it's fractions of a millisecond faster than a more readable function.

PERL IS QUICK AND DIRTY.

PERL IS AN INTERPRETED LANGUAGE.

PERL IS NOT THAT FAST.

IF YOU'RE CONCERNED ABOUT FRACTIONS OF A MILLISECOND GO PLAY WITH C.

That is all.

2 comments:

blogagog said...

I'm going to have to call shenanigans on this post. perl is only interpreted if you are too lazy to compile it.

Sure, c is like greased lightning (and c++ is greased lightning covered in thick syrupy molasses, at the bottom of a well, sat upon by an 800 lb. man, all the while negotiating for parameters with some crazy dyslexic policeman), but perl is just as fast in it's forte, that being text manipulation.

The perlapp.exe/Visual Studio combo is fantastic. Sorry to say, but it puts Linux/Unix to shame. I say that with a heavy heart.

Fletch said...

Compiling Perl is like running C code through an interpreter.

If I wanted to, I could turn a bus into a submarine.

My issue was with people who provide example code which is rendered less readable in the interest of speed.

If I was writing code for parsing huge files of text or large files of text repeatedly, I might consider compiling. Because Perl was made for text manipulation. If I'm doing anything else (in this case SNMP queries), and am so concerned for (a tiny increase in) speed, I'd just be better off using another language.

My issue is with people who want to make Perl do things it's not best suited for, and delude themselves into believing they can make it comparable to a language like C by simply shaving a few fractions of a millisecond.

And the only thing I like about visual studio is that it starts with "vi."