YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Page Index Toggle Pages: 1
Topic Tools
 
Does anyone running this place know Perl? (Read 4,973 times)
 Aug 28th, 2012 at 11:22pm
There are no actions to perform.  

The Dodger 
YaBB Newbie
*
Offline
Posts: 3


YaBB 2.1
Does anyone running this place know Perl?
No, seriously.

I'm reading through the sourcecode.

So, like... do any of you know Perl?

Because I don't know what this crap is.
 
 
IP Logged  
 Reply #1 - Aug 28th, 2012 at 11:28pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,860
Earth


YaBB 2.5
Re: Does anyone running this place know Perl?
Yeah - some of us do write Perl pretty well - but you're also looking at 12+ years of legacy code that hasn't been updated unless it broke.
 
WWW  
IP Logged  
 Reply #2 - Aug 28th, 2012 at 11:48pm
There are no actions to perform.  

The Dodger 
YaBB Newbie
*
Offline
Posts: 3


YaBB 2.1
Re: Does anyone running this place know Perl?
You say:

sub undupe {
   @in  = @_;
   @out = ();
   foreach $check (@in) {
       $duped = 0;
       foreach $checkout (@out) {
           if ($checkout eq $check) { $duped = 1; }
       }
       if ($duped == 0) {
           push(@out, $check);
       }
   }
   return @out;
}

I say:

sub undupe {
   my $seen;
   return map {$seen->{$_} = 1; $_}
                   grep !$seen->{$_}
                          @_;
}
 
 
IP Logged  
 Reply #3 - Aug 28th, 2012 at 11:49pm
There are no actions to perform.  

The Dodger 
YaBB Newbie
*
Offline
Posts: 3


YaBB 2.1
Re: Does anyone running this place know Perl?
Even 12 years ago this should have used strict. That was 2000. MySQL was ubiquitous by then. This is like an Extropia script!
 
 
IP Logged  
 Reply #4 - Aug 29th, 2012 at 2:14am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,860
Earth


YaBB 2.5
Re: Does anyone running this place know Perl?
Are you volunteering for code review for 2.6?
 
WWW  
IP Logged  
 Reply #5 - Aug 29th, 2012 at 11:13am
There are no actions to perform.  

xnoddyx 
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline
Posts: 1,552
UK:Scotland/livingston


YaBB 2.5
Re: Does anyone running this place know Perl?
Dandello wrote on Aug 29th, 2012 at 2:14am:
Are you volunteering for code review for 2.6?

yer he / she can see here http://www.yabbforum.com/community/YaBB.pl?num=1284302958
Wink
 
YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
WWW xnoddyx xnoddyx1  
IP Logged  
 Reply #6 - Oct 1st, 2012 at 5:07pm
There are no actions to perform.  

Zoo 
YaBB Legends (Inactive)
*
Offline
Posts: 400


YaBB 1
Re: Does anyone running this place know Perl?
The Dodger wrote on Aug 28th, 2012 at 11:48pm:
Code Select All
sub undupe {
    my $seen;
    return map {$seen->{$_} = 1; $_}
                    grep !$seen->{$_}
                           @_;
} 


I do not understand. This is known to work?


But all the same, because this is clean and fast:

Code Select All
sub undupe {
    my %seen;
    grep { !$seen{$_}++ } @_
} 


Almost a FAQ.
 
 
IP Logged  
 Reply #7 - Oct 1st, 2012 at 7:43pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,860
Earth


YaBB 2.5
Re: Does anyone running this place know Perl?
Haven't tested either of them but I assume the first one works as it isn't part of a reported bug. The second one is a lot neater. (And neither would make PerlCritic happy. - no final return on the sub.)  Cheesy

The biggest issue with Perl - to some people - is that it really does allow lots of different ways to do the same thing - some of them neat and tidy, some of them not so neat and tidy. And which one is best for a particular need depends on the skill-level of the coder, testing, and benchmarking.

 
WWW  
IP Logged  
 Reply #8 - Oct 2nd, 2012 at 1:16am
There are no actions to perform.  

malmklang2 
Jr. Developer
Language Team
***
Offline
Posts: 257
Norway


YaBB 2.5
Re: Does anyone running this place know Perl?
Must've been a new record of how to enter a forum in the most insulting way, that there. But yeah, takes all kinds to make the world go around.

And it sounded so bad at first too... like there wasn't a single decent line of perl code in the entire set of source files.... and all it boiled down to was a tiny little sub... Oh well!
« Last Edit: Oct 2nd, 2012 at 1:20am by malmklang2 »  
if ($human) {die("Sorry, you lot have destroyed too much already")}
WWW frost-bite-me m4lmkl4ng  
IP Logged  
 Reply #9 - Oct 2nd, 2012 at 2:12am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,860
Earth


YaBB 2.5
Re: Does anyone running this place know Perl?
Oh, I've had days I've felt the same way - scratching my head and saying to myself "What the frack were they smoking when they wrote this!#!@"

And I've had guys over at PerlMonks say it about some of my code. (I had one guy swear up and down that the absolutely only way to solve one particular problem was with mapping - and that was the first thing that went out the window on the refactoring.)

There are, admittedly, a lot of old-fashioned naming conventions inside the YaBB code and some code that can be refactored and optimized  (the language has evolved over the past 12 years) - but we've only had a couple of things actually break due to age.  Wink
 
WWW  
IP Logged  
 Reply #10 - Oct 2nd, 2012 at 8:17am
There are no actions to perform.  

malmklang2 
Jr. Developer
Language Team
***
Offline
Posts: 257
Norway


YaBB 2.5
Re: Does anyone running this place know Perl?
Yeah, I do get that, about code not being up to date everywhere, and code not looking, or being as perfect as it could be... I'm not a Perl expert at all, though I know enough to get by in most situations...  However, I am a moderator at a big Norwegian web development board, and if I yelled at every person coming to us with table based layouts and no clue as to why a certain element won't conform to his or her intentions, I'd be out-yelled ages ago, and, I would've scared so many good people away, that just needed a little advice, not yelling.. people that have stayed around and evolved way beyond and above my skills.
Sometimes RTFM or Google it, stupid, just isn't the way to handle certain things, just like entering a forum, where the people have developed a free software for 12 years, a great software, and widely used too, and look down at them through their noses isn't the way to point out that some things might need improvement.

As to your thoughts, as you described them, sure, I can relate to that too, about html and css and what not, but thoughts are thoughts, saying them out loud is a different thing altoghether Tongue

Perl monks, huh? Well, they sure do know their Perl, don't they, but sometimes, their social skills, well, there's a few lines of code missing there, or un-optimized at least, as there is with many experts in other fields of expertise. That's fine. But sometimes being too harsh can kill something that would've been great if only encouraged a little instead of yelled at, yelled at in a bad way, I mean... there's actually two types of yelling, a good way and a bad way, but that's for another day Tongue
« Last Edit: Oct 2nd, 2012 at 9:03am by malmklang2 »  
if ($human) {die("Sorry, you lot have destroyed too much already")}
WWW frost-bite-me m4lmkl4ng  
IP Logged  
 Reply #11 - Oct 2nd, 2012 at 8:44am
There are no actions to perform.  

depablo 
YaBB Moderators
YaBB Next Team
Beta Testers
***
Offline
Posts: 577
UK


YaBB 2.5
Re: Does anyone running this place know Perl?
Early pioneers in all walks of life should be shown respect, without their input and vision life as we know it would be very different.

That said people attempting to keep something their passionate about alive also deserve respect, I think we should all take a deep breath for the sake of the software.
 
Taking a peek behind the mask Wink
 
IP Logged  
 Reply #12 - Oct 2nd, 2012 at 8:54am
There are no actions to perform.  

malmklang2 
Jr. Developer
Language Team
***
Offline
Posts: 257
Norway


YaBB 2.5
Re: Does anyone running this place know Perl?
yeah, no I dind't mean certain parts as disrespectful as it came across, so, sorry about that.

Breathing's good, it's essential Wink
« Last Edit: Oct 2nd, 2012 at 8:55am by malmklang2 »  
if ($human) {die("Sorry, you lot have destroyed too much already")}
WWW frost-bite-me m4lmkl4ng  
IP Logged  
 Reply #13 - Oct 2nd, 2012 at 10:32am
There are no actions to perform.  

depablo 
YaBB Moderators
YaBB Next Team
Beta Testers
***
Offline
Posts: 577
UK


YaBB 2.5
Re: Does anyone running this place know Perl?
malmklang2 wrote on Oct 2nd, 2012 at 8:54am:
Breathing's good, it's essential Wink

That's why it's automatic  
Grin
 
Taking a peek behind the mask Wink
 
IP Logged  
 Reply #14 - Oct 2nd, 2012 at 2:15pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,860
Earth


YaBB 2.5
Re: Does anyone running this place know Perl?
I have learned an awful lot about Perl from looking at the YaBB code, swearing under my breath and then figuring out what that piece of code is supposed to be doing. And there's some code that is just 'perfect' the way it is.

Twelve years and still going - that has to be a record.
 
WWW  
IP Logged  
Page Index Toggle Pages: 1
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.