in reply to Re^4: No garbage collection for my-variables
in thread No garbage collection for my-variables
If that function is called in a non-void context, it is returning the result of the "debug statement", which seems more than a little artificial.
If the function is ever called in a non-void context, it will be because it returns something useful. If the return statement (or the fall-off-the-end expression) is omitted, then the function isn't going to work the way it is intended anyway, so any other error is academic. Just another justifiction I'm afraid.
Plenty of languages use pass-by-reference, and thousands of programmers and millions of programs use it every day without dire consequences.
Designing interfaces around performance optimizations and memory management oddities just doesn't seem right to me.
You seem to be saying: Oh, I mustn't use this language feature, because that would make my code more efficient and that would be an optimisation and it might be premature!
Why does Text::CSV_XS exist? Or the XS version of List::Util? Or ...
It's changing your transatlantic flight path to take full advantage of (or avoid) the gulf stream. It's shutting off the fuel supply to the injectors when the engine is on overrun. Removing your roof rack when you aren't using it.
Perl is a context sensitive language, it is a uniquie and powerful defining feature. Perl programmers need to be aware of it, understand it and use it. Pretending it doesn't exists, or running scared of it you might as well use VB.
It drives me nuts. I use Perl, because I like the language. But there are people around here won't use map or grep; or statement modifiers; or unless or until. They eshew aliasing; context sensitivity; autovivification; the implicit variables: it and these. They want everything OO; will jump through hoops creating singleton classes, "to avoid globals" and end up with nothing more than lexically-scoped globals (eg. our). Use ReadOnly variables as constants instead of constants.
Why bother using Perl?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: No garbage collection for my-variables
by moritz (Cardinal) on Sep 17, 2008 at 07:19 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2008 at 08:28 UTC | |
|
Re^6: No garbage collection for my-variables
by kyle (Abbot) on Sep 17, 2008 at 03:19 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2008 at 05:53 UTC | |
by kyle (Abbot) on Sep 17, 2008 at 15:08 UTC | |
by BrowserUk (Patriarch) on Sep 17, 2008 at 15:28 UTC |