in reply to Re: To Kill a Meme: while(defined($line = <>))
in thread To Kill a Meme: while(defined($line = <>))
Your post gives the impression that it's somehow wrong to be explicit,
That's certainly not what I hoped to convey.
As I said in a reply to Juerd, I relish the fact that I don't have to be explicit with everything, but that's a very different sentiment and I was addressing a very different point.
What I don't like about the whole while-defined-readline business is that most people use it without a clue why they are using it.
Maybe I should have chosen a less violent title. And perhaps, instead of ending the node with "please, try to lay this old habit to rest" I should have said, "if you don't know why you are doing it, don't bother." I really don't care half as much as some seem to think I do now. :-)
But just because it's no longer needed, it's not wrong, doesn't easily lead to mistakes (quite the opposite) nor is it misleading.
I mostly agree with that except that I think it does lead to mistakes. Not coding mistakes, but conceptual mistakes. When it is coded explicitly, it seems to indicate to perl beginners that it is necessary for a common case. Then they start imagining what that common case is and they get it all wrong but they don't know that. Then those assumptions bleed into other code they write.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: To Kill a Meme: while(defined($line = <>))
by Abigail-II (Bishop) on Nov 03, 2003 at 10:40 UTC | |
by sauoq (Abbot) on Nov 03, 2003 at 10:54 UTC | |
by Abigail-II (Bishop) on Nov 03, 2003 at 11:51 UTC | |
by sauoq (Abbot) on Nov 03, 2003 at 11:09 UTC | |
by Abigail-II (Bishop) on Nov 03, 2003 at 11:44 UTC |