Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: I want you to convince me to learn Perl

by pemungkah (Priest)
on Oct 01, 2013 at 22:10 UTC ( #1056544=note: print w/replies, xml ) Need Help??


in reply to I want you to convince me to learn Perl

At the moment, I write both for a living. They're both good and useful languages, and it's more important - at least for me - to focus on what you get as opposed to the way you express it.

Perl has CPAN, and a very large community around that; you'll almost always be able to find a module that will get 80% of your work done. Then you only need to write the other 80%.

Python tends to, in my experience, have islands that are meticulously implemented and tested, where everything is simple and straightforward, easy as pie; and chunks of Terra Incognita outside those islands, where the dragons can be fearsome indeed. The 80-80 rule tends to apply just as much in Python, except you're more likely to find someone on Stack Overflow who has a solution or at least a link to a suggestion.

One anecdotal thing: I often find, because of Python's "there's only one right and obvious way to do it" philosophy, that refactoring is often much simpler than it would be in Perl, simply because similar code is much more often close to identical, making it much easier to spot the places you should refactor.

I find Perl's test tooling much simpler to use than Python's, simply because you can get tests written in very few lines with very little scaffolding. The more you lower the barrier to actually writing tests, the more tests you are likely to write.

So learning either will be of benefit; they're both useful tools; I feel I've actually gained a lot of insight by being considerably more bilingual than I used to be. Often I can see a better solution in one language by briefly considering a problem in the other, even if it's "wow, this is so much harder in language 1; I can just do X in language 2...which is probably what I should have been doing in the first place!"

  • Comment on Re: I want you to convince me to learn Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056544]
help
Chatterbox?
[davido]: or on ubuntu /var/run/utmp
[Corion]: Otherwise, I would imagine that a user with a process still alive would lock that information in memory.
[davido]: so last -f /var/run/utmp on ubuntu provides similar (though more verbose) info
[oiskuu]: glibc getlogin just does ttyname() and falls back on getutline(); it's not security related at all. (reminds me of sendmail and remote finger services of the naive early spam era)
[Corion]: But yes, "who started this process" is interesting information :)
[tye]: no, I really believe that "login user" was added as a fundamental bit of info about each process in order to enhance the usefulness of auditing
[Corion]: Ah - if that information is saved in a file, then you could theoretically spam that file and confuse getlogin(). So, don't use it for authentication :)
[tye]: that is what getlogin() certainly *used* to do. I don't believe that is what it certainly should do.
[davido]: /var/run/utmp is 664 i think.
[tye]: Note that my "man getlogin" says that it uses stdin when it should use /dev/tty (calling a glibc bug). But that does not appear to be the case when I test it. But maybe Perl's getlogin() is not using glibc's getlogin().

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-06-23 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (554 votes). Check out past polls.