Solved

C/C++ or Perl - Which is better?

Posted on 1998-09-07
1
169 Views
Last Modified: 2013-12-25
I can think of a few reasons why Perl is better when it comes to CGI programming. However,I heard that C/C++ is more efficient and works faster for more complicated applications. Is this true? Are there any other reasons to choose C/C++?
0
Comment
Question by:zgee
1 Comment
 
LVL 11

Accepted Solution

by:
mouatts earned 20 total points
ID: 1828565
C is compiled whilst Perl is interpreted as a result a C program will tend to be faster. But this speed difference is very much on the margins a very complex CGI or a heavily hit site may gain a noticeable benefit but otherwise delays in the network will hide any real improvement.

Although Perl is available under NT there are some Web Servers that cannot execute it. For example the Oracle Web Server assumes that a CGI will be a .exe. There is a way around this problem but it is very much a hack that should be avoided. Nevertheless this is a portablility issue.

On the otherhand some would say that it is harder to write a C program that it is portable. It is probably true to say that it is easier to write a portable Perl program than a portable C program but realistically portable C CGIs are within the capabilities of most C programmers.

If you CGI is talking to a database it is possible that a C program may be able to talk directly with it whereas a Perl program may be limited to ODBC only. This can restrict the things that can be done and will incur a significant speed penalty. (Due to ODBC rather than the language that called it).

There are potentially some other reasons such as all the update code for a database is written in C and some of the C functions can be reused within a CGI. This is of course equally true of Perl. But if a company has invested time and money in developing one skill set there is a reluctance in spending even more to pick up another unless there is an overiding advantage to the alternative language. Frankly the advantages of C over Perl or vice versa are generally so small that such an investment is not worthwhile.


0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now