Hello Monks!

This is just another newbie doubt and thoughts, if this post is like a flame for you, then it's probably my poor english being misunderstood :)

The reality is: I LOVE Perl and would like to extract all it's power funcionalities.

I am beginning my CS course, and it's time to think about the future. I really love Perl, but now, Perl's weakness (in my little view of the language) is growing large to me. I will try to explain below.

I have never professionally programmed with Perl (or any other language). I use quite a bit Perl like a hobby and for personal projects.

I am doing a project, a simple HTTP Object Server, to embedded a MIPS emulador in it, and the user interface with it via browser. This is a simple project, but I thought much to make a real good abstraction, and design the objects.

I began to divide into modules, and creating classes. The goal was to make a simpler code, reusable and good to maintain. With a half hour of code, I stoped. I was feeling disgust with to much variables like $self->{'var'}[0], with re's, and eteceteras. WIth some experience in Perl (the necessary to make something a little more legible), I wasn't doing someting that would be interpreted FROM ME, some months after. I was feeling (in the first time), angry with Perl.

After, I began to make the projects using simple Modules, like Module::do_something(), $Module::var. It was more legible, and I'm keeping the development within this road.

Perl is powered, flexible -- but this all have a cost.

I stoped in the final of the road: the road is divided in two other roads: the left, more Perl, and the right, Python from scratch.

I need to do real world general problems solving, with a good abstraction layer.

Do I need to study more Perl, to do something reusable, pretty, inteligent and simple to understand and maintain? Do I need to find scary alternatives to threads? Do all the manuals, books, tutorials and articles read worth the time spend?

I need a direction from you, experienced monks. I am lost :)

The big doubt to me: is Perl good for large general projects (more than 100 lines)? And more than 10000 lines?

If it is, I'm doing a terrible job, I am terribly incompetent, with 2 years of Perl in the pocket.

I would like a response, from who used to drive Perl in real world projects, (no, CGIs and WebSites NO. except these).

Say to me, monks, please. If NO, I will keep the Perl from cool little stuff and dinamic websites.

Thanks all you, for the damn good comunity. You rules.

Replies are listed 'Best First'.
Re: Line noise, large code-app and the real world issues
by simon.proctor (Vicar) on Dec 29, 2001 at 23:02 UTC
    Well I used Perl (as part of a team of 6) to design and build a networked e-commerce server system where the CGI on the Apache webservers would make calls to a middle tier of perl servers (ie servers written in Perl) which would then either call the bank or call the backend Perl servers which would interface with the database.

    Total number of lines - something in the region of 30000 spread across the CGI and the server core. Each server had a custom command set where each command was a dynamically loaded Perl Object.

    The project you describe can be done easily in Perl (as I have done something simliar). You just need to read more on networking, OO and serialisation. I would also recommend you get the Networking in Perl book by Lincoln Stein.

    You would also do well to look at the Soap::Lite work available from CPAN.

    From what you have outlined, it sounds like you need to learn more about OO and modular programming. Moving to Python won't help you as you will still have to overcome the same design hurdles.

    And thats the key - it isn't the language but the design that is important here. You would be better off designing the whole thing on paper and then choosing the language. I'm sure you'll quickly find that not only can Perl do it, but you'll enjoy using Perl to do it too.

    Cheers

    Simon
Re: Line noise, large code-app and the real world issues
by chromatic (Archbishop) on Dec 30, 2001 at 00:03 UTC
    The software powering this web site is written in Perl. Looking at a CVS version, counting only the .pm files, not code embedded in nodes but including comments, there are over 30,000 lines of code. Any way you slice it, that's more than 10,000 lines.

    Having worked on it, I'm happy to report that not only does it do its job well, there are bits in the code that cannot be done in most other languages. Perl can be used to drive real world projects, and some of those include web sites.

Re: Line noise, large code-app and the real world issues
by astaines (Curate) on Dec 30, 2001 at 04:43 UTC

    You have my sympathy. It took me a *long* time to get my head around the line-noise factor in Perl. Once I did it became obvious, and I couldn't live without it now. Compared with pointers in C references in Perl are easy and reliable.

    Python looks very cute, but I don't think that I can cope with meaningful white space in programs.

    Finally I agree with chromatic - design first, and then implement it in anything that amuses you. Think about Forth as an alternative to Perl - it will give you a very different perspective on your design and your choices.

    Take care

    -- Anthony Staines
(crazyinsomniac) Re: Line noise, large code-app and the real world issues
by crazyinsomniac (Prior) on Dec 30, 2001 at 13:15 UTC
    Where did you learn perl from?

    A few of the German monks have complained from, time to time, about the Perl being "English" based, and the lack of sufficient documentation in German.

    I personally learned perl almost entirely from pod (perlmonks helped a lot).

    I speak English (3rd language) pretty well, and am pretty comfortable with reading and digesting perlpod now, which for the most part, is pretty good.

    I probably could benefit from a few books (Damian Conways OO Perl, and japhy's upcoming perl regex book, and maybe Network Programming with perl).

    Anyway, what I'm trying to say, is maybe you ought to have find a mentor, a colleague, somebody more knowledgable about perl to help, and guide, and sometimes yell at ;), you, while you design and implement this. There is no substitue for experience (or advice from someone experienced), or good program specification (with which comes good design).

    Who know, maybe the perlmonks as a community can do you a "solid" if you're nice :) Anyway, just a thought... and oh yeah, documentation is key (pod pod pod pod pod pod pod pod pod)

     
    ______crazyinsomniac_____________________________
    Of all the things I've lost, I miss my mind the most.
    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"