Solved

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

Posted on 1998-09-07
1
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
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…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

739 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