[Israel.pm] Horrible Code
Levenglick Dov-RM07994
dovl at freescale.com
Mon Oct 23 11:53:23 EEST 2006
I am betting on he didn’t know what he was writing
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[ ] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[x] Personal Memorandum
-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Yosef Meller
Sent: Monday, October 23, 2006 10:50
To: Perl in Israel
Subject: Re: [Israel.pm] Horrible Code
ציטוט Shmuel Fomberg:
> Hello there.
>
> Today I come accrose some really strange code.
> I'll write it from the memory - so be toleranting.
> But the code went something like that:
>
> Package Mama;
>
> Sub new {
> ... not intrestiong
> my $self = {};
> bless $self, 'Mama';
> ... more code
>
> my %retval = ();
> tie %retval, 'Mama';
> bless \%retval, 'Mama';
> return \%retval;
> }
>
> sub TIEHASH {
> my $obj = shift;
> $real_obj = $obj; # a global
> bless $obj, 'Mama';
> }
>
> Don't ask me what the writer was thinking.
> The object does not implement any other function of the tie-hash
> interface, so it is completely useless.
> Should I mention that the object also has 100 functions that are
> copy-paste of each other, and all of them have the same bug?
>
> The plus side in all this - more work for me. YaY!
And here's your answer: maybe the previous writer wanted more work for
himself. Or maybe he was writing defensively, so npbody would fire him.
> And Gabor is said to come tomorrow to give a course on Perl in the
> company. (not for me - I was hired as perl expert - they won't send me
> to perl course.)
>
> Well, see ya at lunch, Gabor!
>
> Shmuel.
>
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl
More information about the Perl
mailing list