Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Finding the path

by Spidy (Chaplain)
on Apr 16, 2008 at 00:22 UTC ( #680695=note: print w/replies, xml ) Need Help??

in reply to Finding the path

Thanks for the responses, everyone. They bring to mind some things I should go about learning, and some things I should clarify.

First off, things I should learn - I'll be picking up Mastering Regular Expressions and Higher Order Perl fairly quickly.

Secondly, a clarification - right now, I don't actually work with Perl for my dayjob(or at least, not most of the time - our sysadmin gets me to write him tools every once in a while) - my employer is running a pure M$ shop, and so I work primarily with ASP.Net and C# for my day job - all of my own personal projects are Perl, however.

I know a few other languages, in addition to the standard Web Developer pile - Javascript, XHTML, CSS, and at least one server-side language(in my case Perl, although I can fumble my way along with PHP as well).

I actually already own a copy of Object Oriented Perl - I thought it was interesting(as was Moose), but I haven't encountered a situation where it immediately sprang to mind that "hey, I should use OOP for this!" - I generally design my projects in such a way as to not need OOP. I do use it for some things - I just don't encounter too many situations where I'd like to use OOP and don't already.

I guess, really, I'm looking for cool things I can learn that I don't already know that can speed up my development time and let me reduce repetition. That's why learning about things like map and grep was awesome - because I could instantly see how much they saved on time(and keystrokes).

Replies are listed 'Best First'.
Re^2: Finding the path
by GrandFather (Saint) on Apr 16, 2008 at 03:20 UTC

    For small scripts (say < 100 lines) OOP generally doesn't matter much, but for anything much over that it can provide some really useful leverage. Even poor man's OOP like:

    use strict; use warnings; my $obj = bless {hi => "Hello world"}; $obj->greet (); sub greet { my $self = shift; print "$self->{hi}\n"; }

    can end up saving a lot of time and confusion by avoiding passing lists of unnamed parameters into subs or accidentally doing weird stuff with global variables.

    Perl is environmentally friendly - it saves trees
OOP is okay by me (was Re^2: Finding the path)
by doom (Deacon) on Apr 16, 2008 at 04:42 UTC
    OOP is one of those things that was clearly over-sold and is far too easy to use wrong (like, if you're doing elaborate designs relying on inheritance, you're almost certainly doing it wrong); but I've come around to using it by default even on relatively simple projects, largely because it's a widely accepted compromise between the wide-open style of using globals all over the place, and the tight, purely functional style of passing everything in and out explicitly.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://680695]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2023-10-04 06:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found