Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: pissed off about functional programming

by merlyn (Sage)
on Apr 25, 2005 at 14:51 UTC ( [id://451213]=note: print w/replies, xml ) Need Help??


in reply to Re^3: pissed off about functional programming
in thread pissed off about functional programming

Well, there's my crazy mistake of trying to write:
foreach $x (...)
when I have to pop back to the cshell. Thank goodness for command history. {grin}

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^5: pissed off about functional programming
by Roy Johnson (Monsignor) on Apr 25, 2005 at 15:06 UTC
    I can certainly understand Perl-flavored syntax errors, but I can't very well see a Perl accent in writing valid code in other languages. I think an accent comes from moving from a less feature-rich language to a more feature-rich language, and not using the new features. Because Perl is so feature-rich, and especially because of TIMTOWTDI, there is no Perl accent. Instead, a Perl programmer might exhibit a C accent or a shell-scripter's accent.

    Caution: Contents may have been coded under pressure.
      I think an accent comes from moving from a less feature-rich language to a more feature-rich language, and not using the new features.

      While Perl is a nice wide language it still has it's restrictions, corners and peculiar mind set. I know I have to unbend my mind from Perl when I wander off into other languages. Some examples of my Perl accent include:

      • I keep forgetting about meta-classes when I amble over to Python or CLOS.
      • I have to remind myself that macros are useful in Lisp
      • I have an awful temptation to sling everything into the local equivalent of a hash even when more appropriate data structures are available.
      • Since currying is such a pain in Perl I tend to forget to use it in languages that support it nicely.
      • etc.

        You are right that Perl lacks (or discourages) certain things from other languages, so maybe the feature-rich distinction isn't so important as the TIMTOWDI distinction. Many languages try to do everything with one or two key tools. Because Perl borrows tools from so many other languages, I still question whether it has its own accent.

        You can look unfamiliar with a language without having another language's accent. Of the things you list, throwing things in a hash might be one that is distinctively Perl-tinged — something that might make someone who reviews your code say, "You're trying to write Perl in Mumble!"


        Caution: Contents may have been coded under pressure.
      (define print display) (define $scalar 9) (define @arr #(4 3 2)) (define %hash '((a . 1) (b . 2))) (define (main args) (print (+ $scalar (vector-ref @arr 1))) (newline) (print (assoc 'b %hash)))
      Macros to turn @arr[1] into (vector-ref @arr 1)) are left as an exercise to the reader.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-28 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found