Re: But you don't WANT to do everything in Perl!
by Ovid (Cardinal) on Oct 10, 2005 at 20:33 UTC
|
I'm going to go with Aristotle on this one. It's rather unfortunate that programmers people are so busy fighting religious wars that the search for the truth has become a casualty.
Recently I was chatting with a Java programmer. He quickly attacked Perl's "weak typing" and "unmaintainability" and claimed the term "scripting language" actually meant something. We were discussing the strengths and weaknesses of object typing versus object capabilities (via polymorphism/allomorphism). I have no idea how things descended into a debate about the merits of the languages. It should have been about the merits of ideas but everyone seems to want to pick a fight. That's where advocacy frequently takes us. (And Perl programmers are just as guilty of this as others.)
For a wonderful counter-example, start reading Lambda the Ultimate. They don't suffer trolls (they've been dealing with a few lately), but they're more focused on ideas, not ideology.
| [reply] |
A reply falls below the community's threshold of quality. You may see it by logging in. |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Re: But I WANT to do everything in Perl!
by Aristotle (Chancellor) on Oct 10, 2005 at 20:17 UTC
|
The Little Schemer, a popular book used for Lisp programming shows you how to recursively find the difference between two numbers by subtracting one from each until one of them reaches zero FIRST!).
Well, the preface of that book states:
The goal of this book is to teach the reader to think recursively.
Efficiency is simply irrelevant to the purpose of the mental excercise you complain about. The book does not advertise that algorithm as a way to approach the problem in the real world.
“I don’t think of myself as a Perl Programmer…”
Strange, if you type “Mark Jason Dominus” in the search line at Google you get dozens of links that have “Perl” in the title. The top five hits do not read “C++” or “Pascal” or anything else. Behold, Mark’s latest book, Higher Order Perl is also about Perl. I’m grinning as I write this.
You miss the point entirely. A carpenter is a “carpenter,” not a “hammer-wielder,” even though he wields a hammer a lot of the time.
I think all in all your rant is an exact demonstration of the things Dominus complains about with his article.
If we didn’t have strong advocates, who would we look for when we wanted a good argument?
If we advocated each and every one of our ideas strongly without ever considering the merits of another, would we then have had Newton, Leibniz or Einstein?
And would we have Larry Wall?
Update: see also my response to the update.
Makeshifts last the longest.
| [reply] |
Re: But I WANT to do everything in Perl!
by adrianh (Chancellor) on Oct 11, 2005 at 09:26 UTC
|
The plain fact is we must 'choose' a language to use to discuss algorithms. C++ tends to clutter the conversation with classes; other languages change frequently and in strange ways that also tend to confuse the conversation. Let's do it in Perl.
Let's not. Much as I love Perl I think there are much better languages to teach complete newbies. There are too many places you have to jump through hoops and use non-core stuff to illustrate basic concepts.
No. If advocacy uses the 'TRY before you buy' approach, the students would already understand that Perl is not the most efficient language for IMPLEMENTATION of every solution, but rather, is more than adequate for DISCUSSION.
But it isn't. It's a lousy language to discuss, for example, compile time typing.
In face I'd hate to see any educational programme just use one language. I'd want them to use something functional, something declarative, something procedural, something where they had to do the memory management, something when they were writing direct in assembler (even if for a VM), something with compile time typing, something with type inference, something with dynamic typing, etc.
Strange, if you type "Mark Jason Dominus" in the search line at Google you get dozens of links that have "Perl" in the title. The top five hits do not read "C++" or "Pascal" or anything else. Behold, Mark's latest book, Higher Order Perl is also about Perl. I'm grinning as I write this.
I imagine if you google me most of the programming language related content will relate to Perl.
If you Alta Vista'd me ten years ago you'd find most of my programming language related content would be Pop-11/Lisp.
If you knew me 20 years ago (before I'd heard of all this new fangled internet nonsense) any programming language conversations would have resolved around BASIC, 6502 assembler and Z80A assembler.
Not that that's an exhaustive list of language by any means.
In ten years time, probably less than that, I guarantee that I'm not going to be writing mostly about Perl 5.
My profession is a software developer. Only one of the skills involved in creating good software is programming. Only one of the tools used for programming is Perl.
It's a damn good tool, and I use it a lot at the moment. That's not to say I won't throw it away in an instant if somebody shows me a better tool I can use instead.
For example I've been writing a lot more Ruby over the last year or so since it makes me jump through fewer hoops when writing OO code.
Any software developer who ties themselves to just one language, unless it's something like COBOL with legacy lock in and rich users, is doomed.
I'm in complete agreement with MJD. Language advocacy is largely counter productive.
| [reply] |
Re: But I WANT to do everything in Perl!
by ady (Deacon) on Oct 11, 2005 at 05:35 UTC
|
"I don't think of myself as a Perl Programmer..."
"Larry Wall is a great example that supports my point. He is impertinent. He is persistent. ..."
Interesting... in Use Perl; (YAPSE NA2005) Larry Wall on Perl Larry talks a little about language advocacy; Some of his points are
* I do not take a parsisan view of these things
* Most language designers are not so partisan of their own language as their followers
* Keeping scores (is) not really what it's about
* Helping people get their jobs done and have fun doing it, is what's it's about
Sure Larry and a core of talented Perl programmers are investing a lot these days in the continued development of Perl, but this is also an indication that currently Perl 5 is not THE answer to every programming task.
Best regards
Allan Dystrup | [reply] |
Re: But I WANT to do everything in Perl!
by radiantmatrix (Parson) on Oct 11, 2005 at 17:56 UTC
|
In reading this post, it's inspiration, and the replies thus far, I find myself shaking my head. Most of the comments I see that take issue with advocacy seem rather to describe a sort of narrow-minded orthodoxy. There is a world of difference between holy wars (zealotry, orthodoxy) and advocacy. Let me try to explain...
I work with a gentelman I can only describe as a .NET zealot. I really have no issue (other than a great personal distaste) with .NET. However, this gentleman personifies the very issues I see Dominus and others complain about. Every problem can and should be solved with .NET, to hear this guy talk. Oh, it's a UNIX problem? Well, then: use Mono (never mind that Mono isn't even close to feature-complete or production-ready, yet). Or, better yet, turn it into a Windows problem so it can be solved with .NET.
That is zealotry -- being utterly convinced that one's language (or editor, or religion, or whatever) is the ultimate and only solution to everything. That is not advocacy.
I consider myself a Perl advocate in my place of business. How do I advocate? When I become aware of a problem that is particularly well-suited to a Perl solution (for example, web mechanization, where WWW::Mechanize makes short work of it), I make sure to point this out. I don't ever say "hey, we should do this in Perl!". Good advocacy is more along the lines of "well, we could do it in Perl, and if we did we'd get to use WWW::Mechanize which is both very reliable and will make this a very short project."
To steal a parallelism, it's not advocacy that's bad, it's the advocates. Good advocacy does not try to shove ideas or choices down someone's throat. Good advocacy is, in short, an effort to make people aware of the existance and strengths of a particular choice. Good advocacy does not try to gloss over shortcomings, or attempt to push a particular choice even in the face of solid objections. For example, despite considering myself a Perl advocate, I have agreed to -- indeed, even recommended -- Java, .NET, and PHP to solve various problems, simply because they were best suited to the task at hand.
Above all, though, good advocacy is the willingness and ability to demonstrate the value of one's choices proactively. One of the primary ways I advocate Perl in the workplace is to create well-written and well-documented Perl code to solve problems I've been asked to solve. For example, I was asked to create a self-service reporting system with no budget: I did it with Perl and MySQL on Apache. The solution was well-recieved, and when other departments thought they might want something similar, the following happened:
When they found out the whole thing was Perl, they nearly gave up, because that group's management though of Perl as "write-only", "undocumented", and "untestable". I encouraged them to simply have the code and their requirements analyzed to see how much (or little) work it would really be before dismissing it out-of-hand. They brought in two quotes: one to modify the existing code (after review), and one who had a similar product written in .NET that would also need a bit of modification. The Perl quote was 12 hours, the .NET quote was 140 hours.
Since then, that management group has repeatedly requested Perl development, even for new projects, where they used to run from anything that was Perl-based. I didn't have to do much, just demonstrate that Perl doesn't automatically mean "ugly kludge", and convince them to evaluate it.
That's advocacy: and I don't see why anyone would have a problem with that. And, I think it discourages good advocates when they get lumped in with the "Perl is my hammer, and all problems are nails" zealots.
| [reply] |
Re: But I WANT to do everything in Perl!
by pg (Canon) on Oct 10, 2005 at 20:39 UTC
|
I fully understand your love of Perl, great! Your feeling is shared by almost everyone here. However some of the things you said here need a little bit rethink. Couple of examples:
"The examples for algorithms are written in C with meaningless variable names like a, b, c, etc."
That has nothing to do with the programming language, in this case c, but rather the coding style of programmer. First, you can write c program with meaningful variable names, the language does not forbid you from doing so; Secondly, you can write a piece of Perl program with menaingless variable names, the language does not give you warning or error.
"the 'tediousness' of discussing computer programming/algorithms in C/C++"
The focus is the algorithm, the language is simply a helper here. On the other hand, is it a good idea to use Perl to talk about linked list or tree? No, as that's not how you do things in Perl. But you want to teach linked list or tree, what language do you use, use Perl or c?
| [reply] |
Re: But I WANT to do everything in Perl!
by spiritway (Vicar) on Oct 11, 2005 at 05:48 UTC
|
I liked your post. It didn't strike me as being a rant, just a strong opinion about something. Nothing wrong with a little passion, even if it's about a programming language.
There are always going to be holy wars. They're still arguing about goto, for crying out loud. They've been nattering about that for decades, and there has been no resolution. The same applies to programming languages.
Personally, I think one very strong factor that decides whether we like a language is our personality. Some people feel more secure in a B & D language. They don't mind the extra overhead required for even a quick, one-shot program. Other people like the freedom and variety offered by Perl. When all is said and done, I don't think there's any great criterion for deciding which language is "better" - it just depends on what you find more useful or easier (assuming you get to choose, of course). It's kind of like arguing over whether loafers are "better" than tie shoes.
The only question I have about advocacy is whether it does any good. It seems to me that most of the time people are fairly well entrenched in their choices. And of course, many people don't get a choice - they have to use whatever their shop requires, period. I think advocacy would often wind up preaching to the choir.
And to be honest - what's the benefit of winning converts, anyway? I like Perl and will use it, whether it's considered uncool or undisciplined or whatever.
| [reply] |
|
|
| [reply] [d/l] |
Re: But I WANT to do everything in Perl!
by Dominus (Parson) on Oct 11, 2005 at 14:08 UTC
|
It's tempting to reply to you in detail, since you're responding to something I wrote, but your article is so muddled and illogical that I don't really know which of the mass of nonsequiturs to start with.
I suppose one place to begin would be to ask why you think that my own idea of who and what I am should be predicated on the results of a Google search. That would be a rhetorical question. I don't really care why you might think such a phenomenally stupid thing.
I wonder in light of Mark Dominus' new book, if today he still believes it?
Yes, I do. If this surprises you, I think it's because you didn't understand any of the points I was trying to make.
| [reply] |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Re: But I WANT to do everything in Perl!
by zby (Vicar) on Oct 11, 2005 at 07:15 UTC
|
If you are efficient in a programming language you have interest in this language's success, because then you'll be able to find job using that language, and also you have good chances that that language will be developed further, that there will be good libraries for it etc. This is not something unique to programming languages the same is if you are efficient with an Operating System or even a particular application. That is why advocacy comes so natural. Unfortunately too much propaganda erodes the discussion. | [reply] |
Re: But I WANT to do everything in Perl!
by greenFox (Vicar) on Oct 11, 2005 at 05:16 UTC
|
"I don't think of myself as a Perl Programmer..."
Thats because Perl programming is something that he does not something that he is. What sort of Kool-Aid have you been drinking?
-- Murray Barton Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
| [reply] |
Re: But I WANT to do everything in Perl!
by terra incognita (Pilgrim) on Oct 11, 2005 at 18:13 UTC
|
If you do everything in Perl, then how will you discover that another language can do something better?
Yes you can write or re-write a module to provide a function that another language provides, however this will not necessarily make it the best way to do something. I have pulled screws with a hammer, I have even unscrewed screws with a hammer, however I am much more effective and faster when I use a screwdriver. Why not use the screwdriver?
Personally I think the article is dead on. Everyone wants to belong, it is human nature, so we tend towards tribalism. Unfortunately some people have trouble valuing what other groups have to offer. For those people their chosen group is the only way and anyone traveling a different path is sadly mistaken. These are the people that advocate in a confrontational way. This sort of advocacy only makes the divide wider rather than bridge it. This is what Mark-Jason Dominus is talking about and is summed up nicely in one of his last statements.
I don't really hate advocacy. I just hate the way we do it most of the time. We do it in a dumb way. And I think the discoursive habits we pick up as a result are going to impede the progress of programming languages for a long time.
| [reply] |
Re: But I WANT to do everything in Perl!
by Perl Mouse (Chaplain) on Oct 11, 2005 at 15:11 UTC
|
I still don't like the article.
If I'd said I like the article and think that everyone should read it at least twice a year, I'd be doing some kind of advocay, so I won't.
Let's do it in Perl.
No, I don't think Perl is suitable for discussing algorithms. It has too much syntax. Just look at Perlmonks. Whenever someone asks how something can be done faster, a dozen or so variations on the same theme are posted - all using different syntax to do the same. Seldomly someone actually looks at the algorithm because we're all too busy looking at the syntax.
Mastering Algorithms with Perl is another example. Too often the authors side-step their discussion of algorithms to bother with syntax. Either to explain the syntax, or to show another cool trick.
Knuth's choice for MIX was much better. Not only doesn't he commit to a language-du-jour (he began his work in the 60s and is still working on it, should he have use FORTRAN, Pascal, C, C++, Java, .NET?), he never has to step back from explaining the algorithms to discuss syntax. Granted, MIX might have taken it a bit to the extreme, but his new volumes will use MMIX, and will still be simple compared to languages like Perl, Java or C.
The author goes on to describe discussions he has had with students regarding the differences between strongly typed languages and Perl.
Students? I've had the honour of hearing Dominus giving one those talks he refers to. They were given for people Perl users. People that know Perl.
"..using PHP can't possibly reflect badly on Perl"
True. I agree with this statement only if a) the original system design was not modular b) the original system was relatively small but had high utilization and cost considerations make this necessary.
The full quote is: In my world you use what works, and using PHP can't possibly reflect badly on Perl. I don't see how your comments relate to this. Jasmine used PHP, and that works. Whether or not it's modular, or small, or highly utilized or cost efficient doesn't matter. The PHP solution works, and than cannot reflect badly on Perl.
If you designed a web based system using dozens of custom Perl modules that would take time and effort to port to a different language it makes sense to attempt to upgrade the code to mod_perl (or something similar) before trying anything else. Otherwise you are needlessly spending time and money to retest business logic that could be better spent on performance.
Well, yes. But what does that have to do with the discussion? If I have a web based system using dozens of Java classes, it will take time and effort to port it to a different, and it will make sense to upgrade the code to Websphere or Tomcat before trying anything else. Idem if the application is written in .NET, C++ or Python.
If I try something in Perl and find that the same thing works better in PHP or whatever my next line of questioning is 'why'? The bad discipline, the one I think the author is really talking about, is to stop there.
No, I don't think the author is really talking about stopping here. The author isn't addressing the person using PHP instead of Perl. The author is addressing the people who criticize the person using PHP instead of Perl.
But when I dig (mostly because it is FUN to do so) I find that there is no module or the existing one needs a rewrite. Now I am doing the homework, the foundation of 'good' advocacy. It is harder. It takes more time.
And it's reinventing the wheel. If a good solution exists, use that. Don't shy away from it just because it has the wrong colour skin.^W^W^W^W^W was written in the wrong language.
The same argument can be made for Charles Darwin's evolutionary theory or Einstein's stand on Quantum Mechanics. A debate on these continues to this day. If we didn't have strong advocates, who would we look for when we wanted a good argument?
No, that's not the analogy of what we've been discussing. It would be more like rejecting Einstein's theory of relatively because it was written in German, and not in English. Dominus wasn't talking about people rejecting (or scolding at) solution written in PHP because the solutions are bad - no, he discusses rejecting PHP for no other reason than that it isn't Perl. Einstein didn't reject the Newtonian view of the world because Newton had written his Principia in Latin, nor did he disagree with Quantum Mechanics because Niels Bohr was Danish.
Larry Wall is a great example that supports my point.
Does he? Let me quote Dominus's quote at the end of his article:
I have a book on my bookshelf that I've never read, but that has a great title. It says, "All Truth is God's Truth." And I believe that. The most viable belief systems are those that can reach out and incorporate new ideas, new memes, new metaphors, new interfaces, new extensions, new ways of doing things. My goal this year is to try to get Perl to reach out and cooperate with Java. I know it may be difficult for some of you to swallow, but Java is not the enemy. Nor is Lisp, or Python, or Tcl. That is not to say that these languages don't have good and bad points. I am not a cultural relativist. Nor am I a linguistic relativist. In case you hadn't noticed. :-)
You know who wrote this, don't you?
Perl --((8:>* (Whatever you do with Perl, Lisp has done it 50 year earlier)
| [reply] |
Re: But I WANT to do everything in Perl!
by Aristotle (Chancellor) on Oct 11, 2005 at 16:35 UTC
|
To address your update:
Rather is to discuss the proper nature of true Perl advocacy and what I saw as an improper characterization.
Refusing to believe that another language could be superior to Perl is bigotry. Does a language get stronger or weaker if its disciples are mainly bigots?
True Perl advocacy is to understand a variety of languages by writing enough code in them to become proficient in each. Then the student will be englightened.
Some wish he would just stop and adhere to the status quo. He, apparently, refuses. Now, that’s an advocate.
I have never seen anyone wishing Larry would stop. If there exist circles which hold this sentiment, I’d be interested to learn about their general world view and which perspectives have shaped it.
I want to leave you with two of my all-time favourite quotes:
It is the mark of an educated mind to be able to entertain a thought without accepting it. – Aristotle (the ancient philosopher, not me)
I would like to be allowed to admire a man’s opinion as I would his dog: without being expected to take it home with me. – Frank A. Clark
Makeshifts last the longest.
| [reply] |
Re: But I WANT to do everything in Perl!
by g0n (Priest) on Oct 12, 2005 at 16:23 UTC
|
One of perl's biggest pro's is also partly to blame for its occasional poor rep. It's easy and fast to solve problems in perl, and you can learn it as you go along. Unfortunately, that means that there is a lot of code out there written with a very limited knowledge of the language, and limited knowledge of programming - I know, I've seen a lot, and been responsible for a fair bit myself.
Rather than advocating use of perl over other languages and hence getting into bun fights with Java/C/C++/Haskell/Lisp etc lovers, we'd surely be better getting our own house in order, and advocating use strict;use warnings; to people using perl already, to combat that 'crappy scripting language' reputation that's so ill deserved.
--------------------------------------------------------------
$perlquestion=~s/Can I/How do I/g;
| [reply] [d/l] |
Re: But I WANT to do everything in Perl!
by swampyankee (Parson) on Oct 11, 2005 at 17:01 UTC
|
I've been programming a while (my first program was on paper tape, in Dartmouth Basic....), and in several languages: Fortran (and FORTRAN, before it had a character variable type), IITRAN (now you can find out where I went to college), Perl, awk, VBScript, C, JavaScript, SQL, JCL, CLISTS, etc.
They're tools, in the same sense as an oscilliscope or a hammer. Some tools are better for some tasks than others. Fortran is really good at numerical programming (especially if you leverage netlib 8-) ), so it would make sense to write a numerically intense program in Fortran (see, for example, http://www.npac.syr.edu/projects/bbh/ and http://www.ccsm.ucar.edu/models/atm-cam/docs/cam3.0/cam30eul-browser/index.html ) but less so to write a program to filter log files or perform source code control. I find perl much easier to use than bat files (I'm working on Windows) or VBScript to interact with users and the file system; I've just written a nice little GUI in perl (using the Tk module) to manage a build system. I'd never used Tk before; it took me about 2 days, with frames, listboxes, checkboxes, radiobuttons, etc. Certainly, it is not elegant, but it is serviceable. Much easier than trying to do it in C++ or VB.
| [reply] |
Re: But I WANT to do everything in Perl!
by cog (Parson) on Oct 13, 2005 at 10:52 UTC
|
What do you think would have been the result, and hence the history of mathematics, if, when challenged, Newton had thrown up his hands and recanted?
The same argument can be made for Charles Darwin's evolutionary theory or Einstein's stand on Quantum Mechanics.
If Darwin had recanted, we'd still have the same theory, probably, and I believe the author would have been Alfred Russel Wallace.
As for Newton, I really don't know who would have done the same, but I'm pretty sure that somebody would have, sooner or later.
Anyway, just my $.02 | [reply] |
Re: But I WANT to do everything in Perl!
by tphyahoo (Vicar) on Oct 11, 2005 at 14:23 UTC
|
Intellectually, I disagree. But, emotionally, I agree. So, ++ for "a troll well done." :) | [reply] |
Re: But I WANT to do everything in Perl!
by Anonymous Monk on Oct 10, 2005 at 21:06 UTC
|
Man, we are all with you, and support you!
To talk about Haskell's idea in a language even cannot support function calls with reasonable speed is pure stupidity.
The whole thing was a laughable joke.
| [reply] |
| A reply falls below the community's threshold of quality. You may see it by logging in. |