6 ms·
This one is a real perl see -- | \|/ http://stackoverflow.com/questions/7617852/whats-the-difference-betw
by frozenport 14y ago
This one is a real perl see --
|
\|/
http://stackoverflow.com/questions/7617852/whats-the-difference-between-carp-croak-cluck-confess-and-verbose-options http://stackoverflow.com/questions/7617852/whats-the-differe...
- meaty 14y agoI vomited a little when I read that :)
- RyanMcGreal 14y agoI was going to downvote your comment, but then I clicked through and read the linked question and commentary.
- bcoates 14y agoI don't get what the issue is, I don't even know Perl and it seems pretty straightforward to me: Carp is a library with a set of mnemonic assertion functions for libraries to signal usage errors committed by their callers. Do people just prefer one function with a bunch of fiddly little enums or something?
- IheartApplesDix 14y agoPeople prefer what they've already learned.
- meaty 14y agoIn my case I prefer sensible pragmatic names with some sort of hierarchy rather than random words from the dictionary.
- kamaal 14y agoDid get the point of your comment, are you are trying to convey that you have problems with the Perl philosophy- "There is more than one way to do it(TIMTOWTDI)"?
- frozenport 14y ago1. Yes 2. I also don't like that their naming convention doesn't reflect functionality. How would you assign carp, cluck, croak and confess functions?
- kamaal 14y agoYou have chosen a very small topic to discuss the vast range of advantages TIMTOWDI offers. Now bear with me for a minute while I explain you this whole thing. Have you worked with a language where your though tool just wasn't for you? Have you felt that language was pushing down its own self believed principles down your throat? What happens when programmers face such situations? They just leave the tool and go to something else. Perl is one of those few tools that adapts to the programmer, rather than expecting the programmer adapt to it. Now like every other design choices you can ever make, it has its own tradeoffs. Being flexible, adaptive, powerful and quick to evolve means at times you have to sacrifice a little consistency. You can sure present your arguments and your design perspective against it, but your design again will have its own trade offs. Why so many different ways of doing things? For example why do we have something like 'map' and 'foreach' in Perl? You won't understand this when you have used and written code that leverages these keywords to their power. Its more or less like explaining why Ice cream is delicious to somebody who has never eaten it. Unless you taste it yourself won't truly understand. Perl is quick to learn. You can learn as much Perl to do the kind of work you can do in Python/Java/whatever. But as you learn more Perl, you become productive at solving problems. You can do it quickly, with succinct code with more powerful syntactical features. EDIT:Corrected typo.
- czr80 14y ago"rage of advantages" - somehow this seems to perfectly capture TIMTOWDI ;-)
- shabble 14y agoIf you know enough about the standard Perl warn() and die(), it turns out: croak(): (slang) To die[1] confess(): to provide information, commonly[2] as one is dying[3] carp(): To complain, often at length and of minor details[4] cluck(): Not actually sure about this one, although 'clucking their disapproval' seems to be something of an english idiom. So yeah, there's some logic to the choices, even if it is rather whimsical. It's a valid point to say it's not immediately obvious, but it doesn't take long (from experience) to figure what they do and out which one you want for a given situation. [1] http://www.grammarphobia.com/blog/2012/01/croak.html http://www.grammarphobia.com/blog/2012/01/croak.html [2] Obviously some religions promote regular confession, but the 'deathbed confession' is afaik common even among the less pious/religious. [3] https://en.wikipedia.org/wiki/Deathbed_confession https://en.wikipedia.org/wiki/Deathbed_confession [4] http://dictionary.reference.com/browse/carping http://dictionary.reference.com/browse/carping