(Ovid) RE: Late night revelation of PERL
by Ovid (Cardinal) on Nov 06, 2000 at 23:47 UTC
|
A long time ago, in a galaxy far, far, away, I used to code in C. It's been over a decade, so I don't remember much of it, but I do remember how incredibly astounded I was that a simple routine that took me a week to code in 8088 assembler (am I dating myself, or what?), would only take a couple of hours in C, yet have almost the same speed.
Fast forward 14 years: I program in Perl and I have started dabbling in C++. I know that I need more on my resumé than just Perl, mainframe experience and VBA, but I am having trouble getting excited about C++. I look at the hoops I have to jump through for even the simplest of string manipulations and I writhe in agony (anyone know of a C++ regex library?).
Perl is wonderful because I can get stuff done fast. Sure, we all love the language, but if we couldn't do anything with it, we wouldn't care.
Cheers,
Ovid
Update: My view of a potential job interview.
Me:Well, I once created a mainframe test region using VBA.
Potential employer: And this is relevant how?
Join the Perlmonks Setiathome Group or just go the the link and check out our stats. | [reply] |
|
|
> (anyone know of a C++ regex library?).
Yes.
1. Look up the source code by Rosimildo Da Silva, 1998, "based on the implementation
of a regular expression engine written by the
legendary Henry Spencer originally in "C" around 10 years ago." - at
www.connecttel.com.
I tried it on WinNT about a year ago - it worked. I did not use it much.
2. If you are into COM on Win32, you can instantiate and call from C++ (or from VB* if you prefer ;-) the
RegExEngine that comes with VBScript. Look up the article by Dino Esposito, at
www.comdeveloper.com. It works as
advertized. I can send you the source code of my console app demo,
including a more complete RegExp.h. For the regex doc, look up the VBScript material - at
clinic/scripting.
HTH
Rudi
| [reply] |
|
|
> (anyone know of a C++ regex library?)
3. There is also PCRE - "a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language" by Philip Hazel.
Rudif
| [reply] |
(redmist) RE: Late night revelation of PERL
by redmist (Deacon) on Nov 07, 2000 at 00:31 UTC
|
Good point Macphisto, I never thought of it that way. I guess I like Perl because of the Culture that revolves around it. Other languages seem dry, boring, and devoid of life (key word is "seem"...don't kill me). It is one of the most helpful Cultures that I have experienced...and amusing.
Also, Perl's versatility and applicability in the Real World is super! When I was stuck learning Scheme, I was thinking to myself, what am I doing? The only good thing this language is good for, IMHO, is recursion, and while that is a noble cause, it's not noble enough. I nearly puked when I saw CGI "done" in Scheme. Perl can handle pretty much anything you throw at it and do it well (ie not all kludge like).
In addition to all this, Perl is fun to code! What other language can you make puns and double entendres in while you code? (BTW, that was a rhetorical question.) I code in Perl because I *want* to, not because I *have* too.
redmist
redmist.dyndns.org
email::redmist
| [reply] |
|
|
I came across this site completely by accident. I was hanging about with nothing to do at work after setting up a Linux server and was just browsing around the web. I think I did a google search for PERL and it came up with perlmonks. I was completely hooked. I met a lot of people who's opinion I valued as well as met some people with whom I completely disagreed with on many subjects. I agree that PERL does have the best community. Even those that I disagree with still tend to be helpful.
Macphisto
Everyone has their demons....
| [reply] |
RE: Late night revelation of PERL
by Adam (Vicar) on Nov 07, 2000 at 01:31 UTC
|
I recently had the same thought. I have used (in the last 5 or 6 years in varying contexts) Lisp, C++, Java, and Perl. Of that small set (and limited experience) I have never found a language as flexible as Perl. C++ counts its rigidness as an asset, I do not. As I see it, I want to spend my time implementing code that is directly relevant to the problem at hand, and not to spend time implementing support code.
For example... say I want to have a dynamically sized array of stuff, in Perl thats what an @array is. In C++, or Java for that matter, I would spend a day just coding the array structure that I want, and then I still would only be able to put one type of thing in it, so I would have to define an object that could contain whatever types of data I wanted to put in the array in the first place, which just gets ugly... fast.
Perl, on the other hand, has its focus on text. We have regular expressions (RegExes) and split and the concept of a $scalar instead of an array of chars [ ]. Thats what most of us work with. We want to write tools that interact with databases and web servers, scripts for system administration and automation, programs to handle e-mail and play games. Most* of that is text oriented.
Yeah, you can do math in Perl (and there are plenty of modules at CPAN to help you with the complex stuff), but when was the last time your project was to dynamically calculate the trajectory of a rocket accounting for changes in mass and size over time**? I mean really? (And if your project did involve something that complicated - Please tell me you didn't use Perl! That is definately a C or C++ problem!)
So my answer is that we like Perl because we can get things done quickly in Perl. We don't need to do any real set-up, because that's been done for us. And that Is A Good ThingTM. You see?***
Footnotes:
* I say "most" because we also have common questions like, "How do I generate a random unique number" and "How do I generate a random fully solveable maze?" which are not so much text as they are numerical and logical. But my point stands.
** Loss of mass resulting from use of fuel, and change of size in the form of metal expansion at high temprature. These are real issues involved in rocket trajectories.
*** Actually, there are plenty of other reasons, but that is the one at the top of my top 5 list: Flexability, Ease of learning, Ease of extension, Portability, Community Support.
| [reply] |
|
|
I have one bone to pick:
For example... say I want to have a dynamically sized array of stuff, in Perl thats what an @array is. In C++, or Java for that matter, I would spend a day just coding the array structure that I want, and then I still would only be able to put one type of thing in it, so I would have to define an object that could contain whatever types of data I wanted to put in the array in the first place, which just gets ugly... fast.
I'm sorry. but if you are in C++, use the STL. It's going to be faster than anything you can do by hand, it's going to be more secure, better tested, etc... than anything you are going to do. It's going to be easy to understand if you are willing to read a bit of documentation. And, most importantly, it's not part of the standard.
UPDATE: oy, no perlmonking while under chemical influences... sorry extremely but i typed it in wrong. It is part of the new C++ standard. (if i remember correctly, if i am wrong, correct me.)
| [reply] |
|
|
| [reply] |
RE: Late night revelation of PERL
by el-moe (Scribe) on Nov 07, 2000 at 04:18 UTC
|
I use Perl; because it's so darn fun!!!I work in an industry developing supporting software for CAD/CAM engineering systems. The software we use has traditionally been automated using csh or ksh. When the opportunity to take another position with a company that was converting it's approach to using Perl exclusively, I jumped all over it. That was the best thing I ever did for my state of mind. I don't ever remember being overcome with silly grinning joy when I did anything in a standard shell. But I have A GIGANTIC GRIN on my face most of the time I'm doing anything in Perl. I also use C for some things but as I get better and more fluent with Perl, I suspect I'll be doing everything I can in this fine just fine language. So what's the reason I use Perl;??? I don't think there's any one answer. But I'm almost always smiling while I'm coding Perl. And when I learn something new... which is everyday... it strengthens my resolve to move further down TC's list "The Seven Steps to Perl Mastery". But I'm just a geek and the more I know about stuff, the better I feel. Prost, Moe | [reply] [d/l] [select] |
RE: Late night revelation of PERL
by Macphisto (Hermit) on Nov 06, 2000 at 23:55 UTC
|
A certain compatriot who shall remain un-named...we'll just refer to him a 'jc'...no no that's too obvious, we'll call him 'wren,' has brought up the point that it is Perl, and not PERL as I have it written. So I figured I'd mention that I usually capitalize things that are Acronyms such as PERl being ( Pathologically Eclectic Rubbish Lister ), as well as capitalizing things that are named for references ( such as JAVA being named so because of the enormous amounts coffee imbibed by the writers ). So if you feel it should be Perl, then just squint, and it'll look that way.
Everyone has their demons....
| [reply] |
|
|
As I understand it, Larry Wall named the language Perl, then sometime later he or somebody thought up the 2 commonly accepted expansions.
So it isn't really an acroynm.
Somewhere around here is a thread where Wiser Monks Than I TM set the record straight.
/me wishes PM search were case-sensitive. 8^\
cheers,
Don
striving for Perl Adept
Update: Found it - (ar0n; lay off the caps) RE: PERL Mentality. But I agree, good monk Macphisto - s'not a big deal to me.
| [reply] |
|
|
From Learning PERL foreward by Larry Wall:
"Whatever, the magical bead grew into this rather odd looking Amulet you see before you today. See it glitter, almost like a pearl." (p xiii)
It could easily be that. But I've always thought of it as an Acroynm. No big deal really.
Macphisto
Everyone has their demons....
| [reply] |
RE: Late night revelation of PERL
by Fastolfe (Vicar) on Nov 07, 2000 at 00:15 UTC
|
For me it's the rapid development time, and to a lesser extent, pretty/elegent code. | [reply] |