MeatballWiki | RecentChanges | Random Page | Indices | Categories

There is nothing that Perl cannot do!

(except make the tea... ;)

From TheProgrammersBooklist.

SunirShah was wondering which language he will use to write a system that provides the database of the list of computer programming books.

This discussion is moot; not only do I not care about TheProgrammersBooklist any more, these days I'm a Perl bigot. ;) --ss

Lately, I've been investigatig the various language options. Ideally, I'd like to write the majority of the system in some scripting language that is callable by CGI/Apache modules. Occasional bits in C/C++ may be necessary, but not initially.

Given that I'd like to make the code well written, I'm allergic to Perl. I've been looking into various Smalltalks (so far VisualWorks? NC 3.0, 5i and Squeak) but they have one problem that may be limiting: they only have one thread per image. Actually, more seriously, no one has Smalltalk on the back end.

Let's explicitly state some criteria:

Based on the marketing hype that I've heard, PythonLanguage seems like a good choice. I'm looking into it.

Java is a natural language for server-side stuff. JPython is a variant of Python compiled for the JVM; I don't know if it's any good in this role, although the reference to NikiNiki? on http://www.c2.com/cgi/wiki?WikiWikiClones suggests it is possible.

Java has some nice features but it has lots of problems too. But since I'm not a language bigot, I'll take whatever works. --ss

Given that I'd like to make the code well written, I'm allergic to Perl.

This seems like a bit of an irrational bias against Perl. It's not the language, but the style. I can write elegant, beautiful, clear, maintainable, sensible, OO, Perl code with a minor hassle... and if I can do it, you can do it as well... -- DavidDeLis

I wonder about this. LarryWall is very proud of the "post-modernism" of Perl in that the inner gook shows through. Many people call Perl "executable line noise," but you won't find many who call Lisp or Smalltalk that. There are many languages that look like random garbage, but there are certainly some languages that are more readable and writable than Perl. Indeed, I'm against any language or API that has "clever" names like "bless" or "croak." Not like C is winning any battles here either (stupid 6 character limit).

Anyway, it's more a matter of my ability to use Perl effectively, which is low. Since I can't and Perl hurts my head, I don't want use it. -- SunirShah

Well... Names are just that, at least in artificial languages (in natural languages, names are too strongly tied to their sememae to just dismiss the phoneme and throw it away). Perl looks like weird english to me, because my natural languages are Spanish and Portuguese (I'm bilingual) and certainly '$data' is as strange to me as 'success' (specially in spelling, english is weirder than Perl sometimes!).

Thus, learning English and learning Perl has been a similar process to me (understanding something very different to my now hardwired linguistic processes). Perl lets you create a reality through the verb (not going into biblical mode in here, just playing with the reference) in a flexible way which adaptates itself to many linguistic mindsets. Cool, because that's post-modern (I wholeheartedly agree with LarryWall in this point) and "it's cool" (reference to the talk Perl, the First Postmodern Computer Language</a>, http://www.perl.com/pub/1999/03/pm.html , by Larry Wall (Linux World, 1999)).

I find German messy and noisy and haven't been able to discipline myself to learn it. That doesn't mean German is a messy, noisy or ugly language... Same happens with artificial, programming languages.

Something I find really great in Perl and in no other is the open, multifaceted way of describing things. It's like in Babel-17, by Samuel R. Delany (really cool SF book, btw). Language means aprenhension of concepts, or creation of concepts. Perl is really flexible and gives you a lot of power to describe whatever you may need. Your mind creates and perl describes (which, conversely, brings your thoughts into a reality).

The other languages simply don't let you. You have the color you see reality through hardwired and you are not allowed (usually) to change it. Perl doesn't put you glasses in the first place. That's different and you have to get used, but this also allows you to get the Right Glasses when you need them.

Well, enough Perl advocacy for today.

Based on the marketing hype that I've heard, PythonLanguage seems like a good choice. I'm looking into it.

I cannot say it is just a hype, Python's a nice language. But guess what? The pydoc tool I was trying to write (which would extract infomation from class and methods docstrings and other cool things from Python code) I had to finally abandon the Python code and do it in Perl... it's only alpha, but it's available if someone's interested in taking it. GPL, I think I did it. Why it didn't work in Python? I couldn't express all I wanted in Python (specially regexes, horriblest stuff with that silly r"" hack...) BTW I wonder how many Python programmers would use pyDoc written in Perl... oops, sorry, I said I'd stop advocacing...

Well, the project, in whichever language is written, looks very interesting... -- DavidDeLis

I've started to warm up to Perl. I have looked at Python however. We'll see how things go. For now, I'd rather get something done than learn yet another language and class library. -- SunirShah

Well I've written play by email games (PBEM) using C, Perl, Python, and Scheme (Guile, actually). I started with C because I had working source. It was great and it still runs. I never managed to get the Perl code going. To confusing, didn't understand OO Perl, didn't understand my own code after a while. Python was good, it worked, the client even had a GUI. Scheme was great, it worked, it was easy to develop, it was easy to debug, I still understand my own code. Unfortunately the Scheme PBEM never made it. I lost interest while testing the automatic email handling code, which -- oh irony!! -- was written in Perl because I wanted a quick hack that ran on nearly all systems. I continue to be a big Lisp fan because developping inside Emacs is such a rewarding experience. I use Java at work and my problems include Web Servers, Application Servers, J2EE and other things so I can't really compare it. Currently I'm learning Common Lisp. --AlexSchroeder

Prepare to refactor this into PerlAdvocacy. When I first started in ComputerScience, everything was taught in C as a subset of C++. This means cout rather than printf, but object orientation was held off. My biggest frustration was namespace issues. Getting information in and out of subroutines and making sure that the compiler meant what I thought it meant. I tended to write functions where the variables were Fred, Barney and Wilma because the obvious things to name them were used outside of the function and likely to cause the compiler to yell at me.

Then I got a job as a web programmer and learned Perl. And I learned how to use local and my and kept myself from having to call a variable something goofy just to distinguish it from a variable in main. I'm able to use appropriately-named variables which leads my code being largely self-documenting. (Like all programmers, I don't document enough.) [Here] is the code for my Portal page. It doesn't look like executable line noise to me. Mail me with comments if you have any. --DaveJacoby

I am one of people who hate Perl. I don't think it is good as language, though it is convinient. Needless to say, the scoping problem, namespace, malicious lexical context, and etc. Yes, the latest Perl fixes these problem but it is just a patch work at best. Perl always allows you to what you need to do but the source code is not a state of art. Is Perl pragmatic? Probably. But the elegancy of language is important. Code in C lasts for years good because C is a good language in the first place. In Perl communities there are always hack, hack and hack. The language speficication never remains stable. It is evidence they seek fixing problems out there rather than the beauty of the language itself. Perl is convinent but not what I like. (I know this writing is not good yet forgive me) --TakuyaMurata

I like Perl. It's the dream language for text processing and therefore for wiki development and I think no other language even comes near. Perl is in philosophy very near to C. It aims at getting the jobs done. Perl, like C, also doesn't enforce good style. It's all up to the programmer - if you want beautiful Perl code, you can write it (if you can). On the other hand, I don't like the OO part of it, because I think it is too inefficient to implement objects (or data structures) as hashes. But this doesn't worry me much, because I think that OO thinking and the overall OO structure of software is more important than the low level OO implementation. But it's certainly true that Perl is a dirty language. Just dirty enough. -- HelmutLeitner

I am suspecting is it really necessary that code is dirty to get things done quickly and easily? For example, I rather prefer Ruby or Python, which seems able to do all what Perl can do. Anyway this discussion is useless I guess. --TakuyaMurata

I think it has to do with freedom. If a language offers a lot of freedom, it can't do without allowing some dirty things.

By the way I only looked into Python and Ruby but I'm not aware that e. g. Ruby can do things like:
$s =~ s/(pat1+)pat2(pat3*)/&fooRetStr($1,$2)/ge;
globally replacing patterns by Strings that are indidually calculated during the search, can it? Such things are pretty important and common in wiki software, e. g. for InterWiki links or indented lists.
Newsgroups are sometimes wonderful, I got the answer
str.gsub /(pat1+)pat2(pat3*)/ { |m| foo(m[1], m[2]) }
within a few minutes. --hl

I am sorry. I am a kind of losing you. What code above are you talking about? Perl or Ruby? Surely Ruby can do both things above.

Anyway, I disagree that the language should offer freedom. There should be one -- and preferably only one -- obvious way to do it. from Wiki:PythonPhilosophy and Abstraction: Avoid requiring something to be stated more than once; factor out the recurring pattern. [1] --TakuyaMurata

Hm, if there should be only one way to do it, then shouldn't we only have one programming language? Oh wait: multiple programming languages are good because they expose people to different styles of thinking, and that provides the valuable intellectual exercise that turns you into a Real Programmer. But exposure to programming in perl provides too much intellectual exercise, and should be avoided as a waste of mental effort. All those different modules available on CPAN is liable to make your head explode. So you should stick to the straight-and-narrow run of a straight-jacket language that enforces a single type of programming discipline on you (but don't forget to break out of that straight-jacket and try on some other straight-jackets now and then, because a wide experience with many types of straight-jackets is what it takes to know which straight-jacket to wear for every occasion).

(I love hanging out with programmers. They're such logical, reasonable people.). -- Doom


MeatballWiki | RecentChanges | Random Page | Indices | Categories
Edit text of this page | View other revisions