?
Solved

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

Posted on 1998-09-07
1
Medium Priority
?
177 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 80 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

741 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