944,216 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4205
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Jun 12th, 2006
0

C++ CGI Scripts

Expand Post »
I have been writing some CGI scripts in C++, and I was wondering if anyone else has done the same? I have built a pretty decent sized library of functions I use a lot for formatting form inputs and such. The reason I chose C++ is because I'm so familiar with it. I was wondering if I should do myself a favor and learn a language a little more popular for CGI scripting. From what I know so far, perl or bash scripts wouldn't be as portable and reusable as c++ code would be. What is everyone's opinion on using C++ vs other languages like Perl or PHP
Similar Threads
Reputation Points: 36
Solved Threads: 2
Junior Poster in Training
nanodano is offline Offline
78 posts
since Feb 2005
Jun 12th, 2006
0

Re: C++ CGI Scripts

I've done enough CGI with C and C++ to realize that they're very poor languages for it. Perl, or any language with powerful string handling capabilities, is much better suited to CGI.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jun 12th, 2006
0

Re: C++ CGI Scripts

c++ has strong string handling capabilities.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 12th, 2006
0

Re: C++ CGI Scripts

>c++ has strong string handling capabilities.
Bwahahahaha!
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jun 12th, 2006
0

Re: C++ CGI Scripts

>Bwahahahaha!

What so funny _jsw? I thought c++ style strings had reasonably good string handling capabilities?
Or r u making a comparison of pearl's regex library?
Last edited by iamthwee; Jun 12th, 2006 at 10:09 am.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 12th, 2006
0

Re: C++ CGI Scripts

>What so funny _jsw?
C++'s string handling capabilities are horrible. Not the worst, that's a spot reserved for C, but pretty low on the totem pole. Anyone who says that C++ is good at text manipulation clearly hasn't don't much of it. That's what's so funny.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jun 12th, 2006
0

Re: C++ CGI Scripts

Quote originally posted by Narue ...
>What so funny _jsw?
C++'s string handling capabilities are horrible. Not the worst, that's a spot reserved for C, but pretty low on the totem pole. Anyone who says that C++ is good at text manipulation clearly hasn't don't much of it. That's what's so funny.
hmm, I admit the perl regex library out-do c++ style strings... but c++ style strings still support all these and lest we forget, there is nothing stopping you from using c++ with the boost library.

:cry:
Last edited by iamthwee; Jun 12th, 2006 at 12:00 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 12th, 2006
0

Re: C++ CGI Scripts

>I admit the perl regex library out-do c++ style strings...
Regex isn't a library, it's built into the language.

>c++ style strings still support all these
Primitive operations that I would expect from any string type. That's not exactly an argument that C++ strings are powerful.

>there is nothing stopping you from using c++ with the boost library
Oh, then that means I can counter you with CPAN?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jun 12th, 2006
0

Re: C++ CGI Scripts

>Regex isn't a library, it's built into the language.

That's what I meant. He he.

>Primitive operations that I would expect from any string type. That's not exactly an argument that C++ strings are powerful.

Hmm, but what separates perl from c++? The fact that the regex utilities are built in as opposed to the boost libraries in c++ that are not?


>Oh, then that means I can counter you with CPAN?
Yes you can. :lol:
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 14th, 2006
2

Re: C++ CGI Scripts

Quote originally posted by iamthwee ...
Hmm, but what separates perl from c++? The fact that the regex utilities are built in as opposed to the boost libraries in c++ that are not?
It's quite simple. You can get a lot more done in Perl in a given amount of time than you can with C++. It's not worth the extra effort to use C++ because you don't get any considerable speed benefit. You'd be better off paying for a better server and using Perl than you would be using C++ on one cheap server, because bandwidth and perhaps database access time is the main limitation on the end-user's perception of speed.

C++ Syntax (Toggle Plain Text)
  1. #!/usr/bin/perl -ap
  2. eval(("\$s[-2]$_=pop\@s",'push@s,$_')[!/^[-+*\/]$/])for@F;$_="$s[-1]\n"

Nothing beats having a one-line RPN calculator, too.
Last edited by Rashakil Fol; Jun 14th, 2006 at 2:40 pm.
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is offline Offline
2,480 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: "Active" files and moving/changing paths
Next Thread in C++ Forum Timeline: Read/write to same file > once, Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC