- Feature Articles
-
CodeSOD
- Most Recent Articles
- Irritants Make Perls
- Crossly Joined
- My Identification
- Mr Number
- intint
- Empty Reasoning
- Zero Competence
- One Month
-
Error'd
- Most Recent Articles
- Not Impossible
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- 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
what happened to the policy: We don't post code of students / hobby projects and kids? that's three strikes in one post. WTF.
Admin
Perl function prototypes are generally best avoided, except in specific circumstances where you want the weird foot-gun effects.
The documentation tells you to use shift, as that's the idiomatic way of doing it.
Edit Admin
I would argue that the code isn't the WTF- but the circumstances which led to it. Lars is TRWTF.
Edit Admin
The same condition on both branches of OR is probably is a remnant from a previous version - once they were different, but then something changed, and there was the possibility it would change again. Thus OR remains just in case, but neutered. Yes, I'm guilty of the same thing.
Edit Admin
From what I understand, the code wasn't written by students. The students were hired later to work on this pre-existing code.
Edit Admin
Not using signatures could be because they were using an old-enough version of Perl that the feature didn't exist then, or was still marked as experimental. Someone who cheaps on hiring decent developers isn't going to spend money on keeping their stack up to date, after all.
Edit Admin
This was code written at a company, not a student project at their school, nor a hobby project. And I'm also not sure that I would consider them to be kids when they are preparing to enter the workforce; they aren't in highschool.
Edit Admin
Prototypes and signatures are two separate things in Perl. The latter is where function parameters are specified, which is the modern Perl way, rather than using the special
@_
variable to get at arguments.Admin
Oh, ok, apparently Perl has moved on since I... moved on.
Admin
Perl as a whole is generally best avoided. Just look at what it did to gordonfish.