in reply to Re^4: Perl vs Python revisited
in thread Perl vs Python revisited
There are THREE main ways to do things, including programming. The Right Way, The Wrong Way, and the Casual Way.
Perhaps an example: When I work on my websites, I always script and test everything under Win in XAMPP. The reason is that there I dont have to worry about permissions problems. When everything is working as I want, then I will port to Linux, and if problems pop out - I then check for permissions. The idea is to save time and bother of not have to check for a problem that might not show up.
I prefer to use Perl rather than Bash scripts, many of which are simply throwaway. And this is one of the greatest strengths of Perl. Now, on my single user network, without servers normally running, including SSHD nearly always turned off, and remote access disabled, security issues are a hindrance, and not a feature. EVAL is a necessity for me, and undeclared/unused variables are not an issue at all for the needs I have. The beauty of Perl for me is that I can write code in a sequence that is readable to me, And I can follow it years later. It is not however, 'proper programming'.
I see a world of difference between scripting and programming. I need to strip files of everything after the first semicolon, dump into a file, sort it, and remove duplicates. I can probably do this in 5 minutes, and it is going to look ugly. Variables from quick testing all over the place. Properly, it would take a half hour or more as I check the purity of syntax, comment it, and make it production ready. I'll forget where I put it, and should I ever need the function again, I'll simply rewrite it.
However, I would never use this method, or even Perl for accepting Internet connections. There security, strict, and warnings are absolutely required. And I still would be averse to the idea since I simply do not know enough about Perl networking.
This is where the gulf between scripting and programming come into play. At one time Perl was popular among young folk using CGI to play around hacking old dotcom era websites. These days, what do people *play* with. Young folk are apparenty attracted to Ruby because its structure is even more linguistically oriented than Perl, while the hacker folk apparently like Python, because its 'easier' to play with net connections there. Perl has the magic of CPAN, for doing almost everything, but it aint magic when the instructions for using the modules are written in technobabble as obscure as a man page. It took me hours to decipher the docs for Net:: Ebay. Actually, I never did. I pulled some scripts out of the modules package and used them as examples for what I wanted. Less than half of them still worked. Old.
Formal rules and structuring have their place in programming, but can be a hindrance to creativity - especially when one is trying to program on the spur of the moment. I would be the first to fully agree that in writing real programs that 'proper' techniques be used, especially if they are ever going to be shared. But most of Perl's potential user base will never write a program. Especially when it becomes obvious how superior Perl is to tradtitonal tools used in shell scripting. For these folk, myself included, a proper enforcement of rules would mean not permitting a system call to rm -rf \ *. Not a complaint about unused command line argument variables.
As to Rakudo. The way I see it, I have two versions of Python here, two versions of Ruby, 2 versions of mySQL, countless versions of Java, so an extra version of Perl is no big deal, regardless of what its called.
Perhaps whats needed is another pragma called <SCRIPT> where maybe Carp like warnings may be given as suggestions, but the program is allowed to run its course so users can *see* the errors in the output which is much more educational and may be actually more useful in certain applications, such as using deprecated versions of old scripts.
|
---|