Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Hmm, has anyone read Heart of Darkness?

by frankus (Priest)
on Apr 12, 2001 at 14:15 UTC ( #72008=note: print w/replies, xml ) Need Help??


in reply to Re: (Zigster) My Laptop talks to me.
in thread My Laptop talks to me.

Or seen "Apocalypse Now" which was based upon Conrad's book. I basically feel a little like the Marlon Brando character to zigsters Martin Sheen. Not to say that I'm mad or that Perl and Perlmonks are akin to savages, far from it. But like the savages proving more effective than the U.S Special forces, Perl proves it's worth over programming languages on a daily basis.

This is one of the first lessons I picked up in a Perl coder rich environment: Perl is not wholly a scripting language and not entirely a programming language. As a result it doesn't sit entirely in the idiom of either. You will concede that the coding philosophies for these two differ?

I am upset by the slanderous comment about side effects, if I removed the return from the line of code you've quoted and relied on the fact that Perl returns the value of last item used in the sub-routine, then that would be a sort of side-effect (I prefer to call them features). If you really mean short-circuits, yes I've used them by the bucket-load, what of it? Of course if you dislike Perl's making things easy for you approach, there are other languages that are also interpretted where you can spend weeks doing the stuff that Perl does in a day.

I hold my hands up to the comments about all this code going on one line, so:

return join('', ( $v[0]->[$h], $h[!!$h], $and[!!($h&&($t||$u))] $v[!(1==$t&&($u+=10)&&($t=0))]->[$t], $format{'space'}, $v[0]->[$u] );

As to the lousy coding standards in this code. I can only assume that people have avoided it since ar0n pointed out that: lhoward has done this already. When I've finished this I'll be hitting CPAN to study his method. I suspect some people have refused to comment, from contempt of the bad style. I concur that it is not nice but it is far from illegible, some of it is made of Perl 'phrases' or 'clichés' that I picked up, and after a while you look at and go ah that's a ....

This isn't obfuscation, it's unkempt and written in a style too terse to be easily maintained 1. but in a language where the optimisation is a false economy 2.

1.) I am however hoping that the numeric sequence we use won't change in my life time ;o).
2.) I've done some tests with this, but too few to draw a positive conclusion, I suspect there are more legible ways, with less overheads. I'll see what lhoward did.

--
Brother Frankus.

Replies are listed 'Best First'.
Re: (Zigster) Hmm, has anyone read Heart of Darkness?
by zigster (Hermit) on Apr 12, 2001 at 15:25 UTC
    Perl proves it's worth over programming languages on a daily basis.

    This is not about one being better than another, this is about programming standards. There are many standards that can be applied to any and all languages. I would certainly not say perl has proved its worth OVER any other language. I as a programmer have a toolbox of languages and techniques to call upon. Perl is a valuable tool in that box.

    This is one of the first lessons I picked up in a Perl coder rich environment: Perl is not wholly a scripting language and not entirely a programming language. As a result it doesn't sit entirely in the idiom of either. You will concede that the coding philosophies for these two differ?

    I would be interested in hearing what differences you percieve between the two languages. Larry has his own opinions He feels that the difference is meaningless and I agree.

    I am upset by the slanderous comment about side effects, if I removed the return from the line of code you've quoted and relied on the fact that Perl returns the value of last item used in the sub-routine, then that would be a sort of side-effect (I prefer to call them features).

    Side effects Have specific meaning have a look at Referential Transarancy Avoid side effects in general to improve the resiliance of your code. It is general and good advice IMHO and has nothing to do with perl in specific. It is CERTAINLY not slander, I can only assume you did not understand my comment.


    --

    Zigster

      This saddens me, not least of all as I conceded, did you read past the word slander?
      I wouldn't mind but I don't even believe in polarising things to right or wrong.
      Couldn't we just agree to agree?

      --
      
      Brother Frankus.

      vps

        FWIW this time I agree with zigster.

        Perl is a language that allows you to play fast and loose. However it does not free you from the laws of human comprehension. It does not change anything about what is and is not good programming technique. And the sooner you learn that, the sooner you will truly master Perl programming. Allow me to summarize the key points:

        1. If you wish to solve small problems, then scripting is acceptable and can be done much faster than real programming.
        2. If your problems grow into the realm of real programming tasks, scripting as a style is inherently a bad idea.
        3. Perl has not proven or disproven any general principle about good programming technique. It merely sits at an unusual combination of design choices that intentionally does not try to force you to program well.
        4. As I have said many times, I do not like working with programmers who have not absorbed these principles.
        Please read what you wrote and what zigster replied with carefully. Then read Re (tilly) 6: Ways of commenting subroutines. Then read all three parts of Avoid symbolic references.

        Hopefully between those I have convinced you that good Perl programming is first and foremost good programming, and only secondly does it have anything to do with Perl as Perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2022-05-21 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?