Perl

Moderators: Jonathan
Number of threads: 1259
Number of posts: 3644

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Perl vs. C++ Posted by daviddaly on 18 Oct 2007 at 11:29 AM
I have just posted on my blog the reasons why I think C++ is the one true programming language (I am being slightly tongue in cheek here). I used 10 questions to compare it to other languages. Unfortunately I have not been able to compare it to Perl as I don’t have any experience of Perl development. Would anyone be willing to score Perl for me?


Report
Re: Perl vs. C++ Posted by Jonathan on 5 Nov 2007 at 8:40 AM
: I have just posted on my blog the reasons why I
: [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-
: real-language/]think C++ is the one true programming language[/link]
: (I am being slightly tongue in cheek here). I used 10 questions to
: compare it to other languages. Unfortunately I have not been able to
: compare it to Perl as I don’t have any experience of Perl
: development. Would anyone be willing to score Perl for me?
:
I'll give answers for the current Perl (Perl 5) and the forthcoming Perl 6, as they ain't the same.

: 1. Does the language compile?
When you say machine readable code I assume you mean machine code. Source code is machine readable.

Perl 5: By default you just run the script. However, there is an option to compile it to bytecode first. However, the bytecode is just another representation of the syntax tree, and it takes about as long to reconstruct it from that as it does to just parse the script in the first place. The reason is that the interpreter is a "tree walker" implementation. So probably no points here.

Perl 6: Under the Parrot implementation, compiles down to bytecode. On platforms where we have a JIT implemented, you can then in turn spit out an executable file in native machine code. So you have the full spectrum of options available to you. So I think both points.

: 2. Are a variety of IDEs and compilers from multiple vendors available
: for the language?
Perl 5: Only one implementation of the compiler, though multiple vendors make their own distribution of it. And there are plenty of IDEs and editors etc from many vendors. So I guess it gets at least half a point.

Perl 6: Perl 6 is not an implementation, just a specification. The designers very much encourage multiple implementations, and want there to be good IDEs. Already multiple prototype implementations are emerging. So it gets the point.

: 3. Does the language support multiple operating systems?
Perl 5: Over 50.
Perl 6: Not this many yet, but still a wide range.

: 4. Can the language create stand alone applications?
Perl 5: You can get software the packages the interpreter and source into a single EXE for some platforms.

Perl 6: See answer to question 1. Gets this point.

: Answer yes only if an application written in this language does not need
: any additional framework or DLLs to run.
If you use any of the standard libraries, that ain't the case for C++ either.

: 5. Does the language support object orientation?
Yes for both.

: 6. Is the language commonly used to write device drivers and other low
: level software?
No, but it wasn't designed to be used for that.

: 7. Does the language support pointers and direct memory allocation?
No, and for the purposes the languages was designed for, that's not appropriate anyway. (In fact, a lot of the software written in C++ would be better off done in a language that managed memory allocation and deallocation for you. Most people screw it up. Even good people do now and then. Not to mention the wasted developer effort it takes coding something that you could get a computer to do for you.)

: 8. Is there an ANSI standard for the language?
No.

: 9. Has the language ever been used to write an operating system?
No, but it wasn't designed to be used for that.

: 10. Does the language fit into the “if it’s possible it can be done”
: category?
Not sure what you mean by this. People do a heck of a lot of different things with Perl, though.

Also, you write:

: I also hold the view that the answer to the questions “Can he/she code
: in C++?” and “Is he/she a good programmer?” will always be the same."
No, a good programmer knows what tool to use for the job. There is NO single language that is good for ALL jobs. For different projects I work on at the moment, I am writing C, C# and Perl. C++ is not an appropriate choice of language for any of these projects. It's not portable enough for the project being done in C. It's not developer-productive enough and leaves too many chances to screw up security wise for the projects I'm working on in C# and Perl.

And let's not even go down the road of analysing C++ from a linguistic point of view...

Jonathan
###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
Report
Re: Perl vs. C++ Posted by odinjobs on 7 Dec 2007 at 4:05 PM
The is a blog posting comparing Perl to Ruby, Python, & PHP at

: I have just posted on my blog the reasons why I
: [link=http://outofthetriangle.wordpress.com/2007/10/18/is-c-the-only-
: real-language/]think C++ is the one true programming language[/link]
: (I am being slightly tongue in cheek here). I used 10 questions to
: compare it to other languages. Unfortunately I have not been able to
: compare it to Perl as I don’t have any experience of Perl
: development. Would anyone be willing to score Perl for me?
:
:
:




 

Recent Jobs