Thread: web development in c/c++

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    108

    web development in c/c++

    Does anyone have any idea? I guess there'll be difficulty with finding a host that'll let you do this (most of them only supports php etc..)..

    But I'm guessing for most people that have much better proficiency in C/C++ than php or the likes, this would be desireable. There's xml libraries etc..

    The scalability aspect is appealing, and c++ is a good language to make big programs in.. but I just haven't heard of anyone doing it for webdev. So yeah, anybody tried this?

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    you can rent a root server so you get full access to the machine through ssh and you can run/compile any (c++) program on it.
    I know some projects using c++ for backends (search engines for example). but additional they have some frontend in php or something like that for i/o.
    what's not possible is to embed c++ in a webpage so it's executed on the client, like it's sone for JS, PHP or perl

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    web development in c/c++
    C and C++ are different though similiar and related programming languages, so be careful with "C/C++" as it can mean things like "concerning C and C++ as separate yet related langaugees", or "the common subset of C and C++", or "I thought C and C++ are the same language!".

    But I'm guessing for most people that have much better proficiency in C/C++ than php or the likes, this would be desireable. There's xml libraries etc..
    Of course, there are XML parsers available in web centric languages like PHP.

    The scalability aspect is appealing, and c++ is a good language to make big programs in.. but I just haven't heard of anyone doing it for webdev. So yeah, anybody tried this?
    I have never actually done it myself as I decided that PHP was good enough for my purposes, but I did find:
    GNU Cgicc
    Wt: a C++ Web Toolkit

    The latter is rather unconventional.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    PHP is easy to learn, efficient for small and large web-projects, using C/C++ will not hlep much, as the big portion of the time is either getting the data from the database onto the page, or getting the page content out onto the internet that is limiting factor in a web-server.

    Yes, writing the same code in PHP rather than C or C++ will make a difference in the performance of the code, but it's quite rare that the limiting factor is caused by the execution time of the PHP script.

    PHP is a language that is quite easy to learn - it took me a couple of days worth of "spare time" to learn enough to produce some pretty decent pages. I have since picked up a few more tricks of the PHP trade, but if you know HOW TO PROGRAM, then PHP isn't particularly difficult - in fact, many things are EASIER than in for example C, since PHP allows you to use variables in a more flexible way:
    Code:
    for($i = 0; $i < 100; $i++) {
        $name = "image" . $i . ".jpg";
        if (exist($name)) display_image($name);
    }
    In C, you would have to use sprintf to do the same thing, in C++ it would involve a stringstream (or sprintf). Both take a bit more effort, in my mind.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. basic questions about web services development
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 07-13-2008, 09:30 AM
  2. Replies: 0
    Last Post: 12-12-2006, 08:49 AM
  3. Consuming same Web Service multiple times
    By cfriend in forum C# Programming
    Replies: 2
    Last Post: 01-10-2006, 09:59 AM
  4. SWEBS Web Server
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 09-22-2003, 02:46 AM