...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…
The Perl Renaissance
101–110 of 130 posts
Re: The Perl Renaissance
#102Earlier quoted context omitted.
This is really the same as saying, "I won't work for company X because I don't think the brackets in the C++ code should be on the following line[1]!" [1] E.g.: int main() { } vs. int main() { } This is an apt analogy because most companies will have some sort of code style guide that you have to follow, which doesn't make "coding at company X where bracket placement is enforced" much different from "coding in Python…
There are some problems with the whitespace in Python. I wrote some code with lots of nameless functions as input parameters (think JavaScript style or Ruby blocks), which of course was an ugly pain to port to Python with no multi-line lambdas. List comprehensions is another example -- a kludge coming from that the lack of multi instruction lambdas stop real map functions. (The fun part is that this necessity is tout…
If you're trying to fight the language's style, then you will obviously run into friction. I'm sure there are plenty of people coming from C/C++/Java that think that dynamically-typed languages are unusable because type can't be enforced at 'compile time.' Defining an anonymous function vs. a one-time use local function is mostly a matter of style/preference[1].
| which of course was an ugly pain to port to Python with
| no multi-line lambdas
There are two things you are describing here:1) It was a pain to name all of these anonymous blocks.
2) The idea of naming the blocks is annoying / aesthetically displeasing to you.
#1 is just part of porting something between different languages. You would equally run into issues porting JS and/or Ruby code to Haskell, even with support to lambdas. #2 is just personal opinion / preference, even if it's one that shared by many.
| (The fun part is that this necessity is touted as
| something good, instead of admitting that it is
| unnecessary complexity to learn.
I could use the same argument to rail against statically-typed languages. "A type system is just unnecessary complexity to learn."[1] I welcome examples of where anonymous functions are unable to be replaced by local functions passed by reference.
Re: The Perl Renaissance
#103At the end of the day the choice is largely personal preference (or company requirement). Also, I know plenty of programmers who still earn a living writing Perl, so it's clearly not a dead language by any stretch of the imagination.
Personally, I would LOVE the chance to work on a Mojolicious project. IMHO that's the best web application framework today (in any language).
Re: The Perl Renaissance
#104Earlier quoted context omitted.
You have no relevant comment on what I wrote either, I take it? Here I asked for references about the GP's claims. Also, welcome to HN (or are the prepared troll accounts with a few hundreds of Karma running out? :-) ).
| (or are the prepared troll accounts with | a few hundreds of Karma running out? :-) ) Keepin' it classy.
I might also note that I got two non sequitur answers in a row, so a joke like that is imho not an extreme reaction. Hardly as sarcastic as you was over a joke, at least...
Edit: I might also note that this article (76 votes) is 5 places below another roughly equally old article (8 hours) with 13 votes. So it is probably flagged to Hell. I do feel classy, compared to some others.
Re: The Perl Renaissance
#105Earlier quoted context omitted.
There are some problems with the whitespace in Python. I wrote some code with lots of nameless functions as input parameters (think JavaScript style or Ruby blocks), which of course was an ugly pain to port to Python with no multi-line lambdas. List comprehensions is another example -- a kludge coming from that the lack of multi instruction lambdas stop real map functions. (The fun part is that this necessity is tout…
I've used both Perl and Python. When using Perl I use anonymous functions all the time. When writing Python, I don't. There are instances where in Perl I would use an anonymous function, but in Python I define a local function an pass the reference. Each language has it's own style. If you're trying to fight the language's style, then you will obviously run into friction. I'm sure there are plenty of people coming fr…
Uh... different paradigms. The scripting languages, which we are talking about here, are generally very similar.
>> I welcome examples of where anonymous functions are unable to be replaced by local functions passed by reference.
Where did I write "unable" -- did I disprove some Turing machine theorem and forget about it? :-)
In this specific case it was a declarative data structure with some data next to code. It was well suited to have a dozen or two short functions next to the data structures.
You could rethink the whole thing and do something different in Python to keep it readable. But among the normal languages (in the same paradigm), Python is the odd man out, just because of the lack of multi line lambdas.
(I also gave the example of bad influences on map, etc.)
Re: The Perl Renaissance
#106Earlier quoted context omitted.
Universal on NIX systems. Python has a few 2.x versions depending on the Distros. Some distros may opted to go 3.x only. Ruby isn't necessarily universal on NIX systems. Perl is.
Arch Linux now ships Python3 only. That's quite a problem, because many things still depend on Python 2.x (for instance building Firefox from source).
Re: The Perl Renaissance
#107Earlier quoted context omitted.
Englishalsohassignificantwhitespace.
Not a fair comparison -- English prose doesn't care how much whitespace appears between words, only that there's more than none. Python definitely cares how much. Don't get me wrong -- I like Python and I use it a lot, but its reliance on syntactically significant whitespace isn't in the plus column.
English has well-defined whitespace rules, as does nearly every programming language. Every programming language style guide I've ever read has talked about indentation, so you have to indent according to rules no matter which language you use.
Have you ever thought to yourself, "wow, there's no way I'll be able to finish this task on time because I have to indent according to Python's rules"? I'm guessing no.
Re: The Perl Renaissance
#108Earlier quoted context omitted.
> There are some problems with the whitespace in Python. > I wrote some code with lots of nameless functions as input parameters (think JavaScript style or Ruby blocks), which of course was an ugly pain to port to Python with no multi-line lambdas. As nnq points out elsewhere in this thread, this doesn't have anything to do with significant whitespace. Python only allows you to have a single expression in the body of…
My argument was that a lack of real anonymous functions (> 1 instruction) is a problem in some quite common and useful scenarios. If you REALLY can give good references that show this is wrong, I'm very interested (like, I would guess, most Ruby users). (It would also be interesting with a link to a PEP or something with, as you claim, arguments that map etc should be discouraged -- and that is why no multi line lamb…
Re: The Perl Renaissance
#109Earlier quoted context omitted.
My argument was that a lack of real anonymous functions (> 1 instruction) is a problem in some quite common and useful scenarios. If you REALLY can give good references that show this is wrong, I'm very interested (like, I would guess, most Ruby users). (It would also be interesting with a link to a PEP or something with, as you claim, arguments that map etc should be discouraged -- and that is why no multi line lamb…
My argument was just that it has nothing to do with significant whitespace, which is what you were complaining about. Python could be changed to have non-significant whitespace but retain its crippled lambda.
You made specific claims (regarding map recommendations in Python and that white space has nothing to do with one instruction lambdas). I asked for references. I assume you have none?
Note that with significant white space a usable syntax for multi-instruction lambdas seems... non-trivial. It seems to me as an unusually stupid fan boy position. But a few well argued references, which you lack, would change my mind. I'm no troll.
Edit: I might also note that your reference nng is a low-Karma account that argues that a cometing open source language to his love child is dead -- typical language war troll. Is that your only reference?
Re: The Perl Renaissance
#110Earlier quoted context omitted.
Python significant white space. Really, that's what preventing me for ever liking Python.
Python significant white space is just like nudism. At first you think something essential is missing (clothes, curly braces), then you notice that it wasn't really needed at all, and everything becomes freer and simpler.