Solved

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

Posted on 1998-09-07
1
176 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to dynamically set the form action using jQuery.
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…

707 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