- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Perl has its uses, in its place. Same as so does ant, and so does selenium, and so does FORTRAN (although not so much any more). Some developers even believe that even java can be an acceptable tool in some applications.
Admin
Puns on the captcha are equally fucking stupid, of course.
Admin
I wanted to add a pithy comment, but I kept drawing a blank.
Admin
Admin
I see what you did there ;)
Criticizing one hackneyed meme and then including another. Bravo sir, bravo.
Admin
Right or wrong, this is simply how checking for spaces has always been done.
Admin
I always like when people do the stupid way the stupid way. Even if you thought you had to do something with predefined spaces: no loops? Not $blank[10] instead of $blank10? Why not blank($any_number); ?
I mean, I get that stupid is as stupid does, but I enjoy the layers of stupid almost as much as the thing being pointed out as stupid.
Admin
This is Perl right? Perl being the language where you can do $blanks10 = " " x 10 ?
Admin
There is so much wrong with Perl that I keep a wiki page at $JOB with all the stupid shit that people get wrong when they come to play in Perl-land for a couple of hours.
Admin
+1
Having just inherited a large Perl app that I'm maintaining for free, I fully support this comment.
Admin
new meme!
"Sorry, some of us graduated from Perl years ago."
Admin
So, did you verify these run times? Write the programs? Inquiring minds need to know!
Then again, I'm in the process of writing a Perl script right now. Only a couple of hundred lines (many are comments!).
Admin
Seriously, the calling-out-the-capcha meme was hackneyed on day zero.
Admin
Admin
captcha: ideo. 1. n. The idea that array indexes should start at 0. 2. adj. A state of idiocy induced by lack of tea.
Admin
The Freakonomics podcast on "sunken cost" would be a good argument against that.
Admin
Well played.
Admin
Runtimes for Perl, Awk, and Java were calculated by determining average file time and multiplying by the number of files left. After setting up the regular Perl script, I wrote Java and Awk equivilants. But after seeing how slow these were and how long it would take to process the lot, I went for the fastest thing I know. A well designed and structured COBOL program was lightning fast in this case. I've only run the COBOL version 2 or 3 times when the number of files is large enough to require unreasonable processing time (super large data runs or backlog due to some type of problem). Normally, the Perl script runs as part of a data acquisition run and can keep up with the load.
All comes down to the right tool for the job. When it's Perl, I use it, unless the right tool is something else. NEVER thought the right tool would be COBOL, hahahahaha. Lern't sumpin' that day ;)
Admin
I was sacked but I'm betting they're still using that payroll system.
Admin
I built the prototype for a large application using Perl in 3 weeks.
The java version to replace the prototype was to be build by others. After more than 4 years, less functionality than the prototype and an order of magnitude bigger in lines of code the replacement was abandoned.
Admin
LOL Mike, thanks for that. Reminds me of my very first IT position at a large telecom... the bash script I wrote to automate some of our end of night stuff was a vast improvement over the larry running it every night.
Thanks to that job, 15 years later I still think of my function keys as PF? .
Good time, good times.
Admin
Our application suite was going to be rewritten with the latest technologies, including out sourcing a lot of the boring work. There was a lot of competition amongst senior staff as to who would be involved in what was expected to be the flagship product, and people who were left behind on the existing product were pitied.
But years passed and millions were spent without anything to show for it - and finally the word came that the whole project was being scrapped and along with it all the staff who were working on it, as it was obvious only the people on the existing product were needed.
Admin
Admin
You have a WTF. Then you use Java, and you have an exponential WTF.
Admin
Admin
I have to admit, there's a certain amount of elegance to being able to do this:
...Okay, so "elegant" isn't quite the right word.
Admin
Admin
Sorry, some of us graduated from repeating the new meme with variations ad nauseam years ago.
Admin
Admin
Sorry, some of us graduated from wanting to watch the world burn years ago.
Admin
Yes. Also the language that sports one of the largest collection of esoteric operators (most are artifacts of the very terse syntax and weren't intentionally included in the language):
There are many more. Try Googling "esoteric operators perl".
By the way:
I have 20 years of Perl programming experience.
Yes, the syntax is terse and next to unreadable to outsiders.
Yes, you can write horrible, horrible code in Perl.
And no, that doesn't make it a bad language.
But the widespread antipattern of "just write more code until it works" that I've seen way too many places will backfire in the worst conceivable way if you have chosen such a flexible language.
Admin
That is way too many lines for perl. This is the same thing:
${'blank'.$} = ' ' x $ foreach 1..10;
Now that is perl!
Admin
The files contain text representations of genetic data. I would expect MUCH better stats if the program only had to open, read, and close. But the program has to open all the files in a particular location, read them all, and decide which of 4 characters determines a particular location value AFTER calculating where all the files intersect (byte 1 of file 3 may be byte 17 of file 72) times thousands per folder, times hundreds of folders. It also needs to handle 7 exception letters that are meaningful to humans but do not exist in any file. These are "invented" by several algorithms applied when greater than an arbitrary precision of consensus cannot be determined, and some must be recalculated after the exceptions are applied. Yep, it changes at any time, depending on what we find in the files. Stinks in any language, but when it cures cancer it will smell nicer.
I am not "most comfortable" with COBOL. I chose to use it. The real overhead here was not reading the files but rather determining the intersection of thousands of strings of characters with variable lengths and "official" starting positions. I decided the data structure was good for minimizing reads and loops. If you read a record that is defined as a single string of characters, you can copy it to another record at the top level and assign all descendants in one shot rather than having to loop at least once and then do splits and/or joins to get what you want. COBOL does that for you if you define your records properly and can populate dozens of variables and arrays with only one read and a few assigns. Others require you to run loops of one kind or another, and that's where all your time goes.
If you can do that in Perl (or anything else) I'm all ears.
Admin
Admin
In case the 'space' character changes in the future.
$blank1 = " "; $blank2 = $blank1.$blank1; $blank4 = $blank2.$blank2; $blank8 = $blank4.$blank4; $blank16 = $blank8.$blank8; $blank32 = $blank16.$blank16;
Admin
Perhaps, but still far less hackneyed than taking the time out of your day to complain about it.
Admin
Admin
Wrong the Rakudo Perl6 compiler is mostly written in Perl6, or a subset of it. Actually the more lowlevel code that gets rewritten to Perl6, the faster it tends to get.
The Niecza Perl6 compiler is written in a mixture of C# and Perl6 (as far as I can tell from the github repository.)
The Perlito Perl5/6 compiler/translator is (apparently) written in a variety of languages.
There is even a Perl6 compiler written in Haskell named Pugs. It was the first real implementation of Perl6. It has fallen by the wayside though.
Also I take issue with you calling Perl5 a write-only language. Just because you don't want to learn how to read, and write in it, doesn't mean it can't be done.
Admin
I wonder if he put the "blanks" inside static array with increasing length, in attempt to perform table lookup for the "space conversion", will it end in TDWTF?
Admin
Still plenty of new code being written in Perl. More Perl coding than ever happening right now.
Admin
To be serious for a minute (a very short minute, it won't last long), I am aware that write only code can be written in any language, even though Perl has pride of place next to APL, Intercal, and brainfuck.
Admin
Whether Perl is write-only or not depends on the quality of the developer using it. A colleague sitting two cubicles next to me produces perfect Perl code. I myself try to. Our Chinese friends are however not so precise in that.
Admin
And yet you commented anyway.
Admin
If it really is an old application, it might have been written in Perl 4; or by a Perl 4 programmer (my didn't appear until Perl5). Which could also explain the lack of use strict.
Admin
Although admittedly I can't really follow the description quoted above, Perl is insanely great at handling data encoded as strings; in fact, that's its original area of focus. It seems like it would be at least as effective as the COBOL solution, if not better.
Finally, this exact data (genome sequencing) is a common topic on "big data" discussions and I have never seen anyone post that any particular language is better at it than any other. What I can say is that for any particular approach, there is usually a language that expresses that approach most elegantly. "Direct translations" of things that are straightforward in COBOL tend to be disastrous in other languages.
Admin
I'm not very familiar with many scripting languages besides bash, but even I know this from C.
Admin
I don't buy a new car every year. Why not? Wouldn't a new car be better than my old car? Probably, but would it be ENOUGH better to justify the cost? At some point, of course, it becomes difficult to get spare parts for the old car, or it starts breaking down constantly, or for some other reason the maintenance cost becomes unacceptably high. Or a new car comes out with some feature that makes it worth junking the old car.
There are lots of apps that I'd like to rewrite using a newer technology, or just to clean up ugly code. But if I did that, not only would I have to take time writing the code, but someone would have to test it, and there would still be the danger that I would be introducing bugs into a system that was working for ... why? Just so I can say that now its new, shiny, and pretty?
Admin
Right or wrong, that's how web programming was ...
No! Stop! Sorry, I lost my head there for a moment.
Admin
That's the worst troll ever. Or you're incredibly ignorant. Not sure which. Both?
Also: Perl's only a "write-only" language if you decide that you want it to be. That's what having a lot of flexibility gives you: a responsibility not to be lazy. Just last week I had to go back and update a script I wrote for a customer in 2008. It's only 450-ish lines long, but it was no problem adapting it for their new environment.
Admin
We need more car analogies