Can you use C++ in website development?

Discussion in 'Programming' started by whiteblue1942, Jul 15, 2008.

  1. #1
    Can you use C++ in website development? I have heard and read that C++ is used for stand alone applications such as computer games and such and needs a compiler to run. But i have also heard that some websites use c++ so i dont understand how this is possible....

    Can you use c++ in your website programming like you do javascript or php? I have heard many websites use c++ so I am confused. Any help is appreciated!:D
     
    whiteblue1942, Jul 15, 2008 IP
  2. ipro

    ipro Active Member

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    yes, that's what PHP is written in. I wouldn't recommend it however, since PHP has a very similar syntax to C and it's already set up to work with all common webservers.
     
    ipro, Jul 15, 2008 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Generally, no. You can convert C++ code into colored HTML markup but the code doesn't do anything. You would need a C++ interpreter running in the browser or web server, and I don't know of any. You can use C# which is similar, if your web server has ASP.NET or MONO.

    C++ is used for the majority of big projects, like computer games. You need a compiler to build a program from C++ source code, but you don't use a compiler to run a program. However, libraries may need to be installed in the operating system before it will run.
     
    Cash Nebula, Jul 16, 2008 IP
  4. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #4
    Vooler, Jul 16, 2008 IP
  5. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #5
    You have to learn PHP,Perl for the server end , javascript, html,css at the backend, C++ is not quite suitable for web programming , of course you can use it for cgi programming , but the code becomes to cumbersome.
     
    it career, Jul 16, 2008 IP
  6. priyakochin

    priyakochin Banned

    Messages:
    4,740
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    0
    #6
    C++ is having more relation with PHP so you can just study php very easily.
     
    priyakochin, Jul 16, 2008 IP
  7. for_si2003

    for_si2003 Banned

    Messages:
    399
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I would prefer doing it in PHP.
     
    for_si2003, Jul 16, 2008 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    PHP is written in C, not C++.
     
    nico_swd, Jul 16, 2008 IP
  9. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Sure, along with other languages, but whiteblue1942 said:
    CGI scripts have to go in the cgi-bin directory, you can't place the code directly in the markup. So, no you can't use it like javascript or PHP. That's being picky but it's one reason CGI is not as popular today.
     
    Cash Nebula, Jul 17, 2008 IP
  10. davejames909

    davejames909 Guest

    Best Answers:
    0
    #10
    as mentioned previously asp.net c# is OO and based on C

    wouldnt take too long to get to grips wi the syntax if your familiar with C, you'd just have to learn the framework
     
    davejames909, Jul 17, 2008 IP
  11. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I think it would be silly to use c++ when you have languages or frameworks like PHP, Python, Perl, Ruby, or even .NET or Java. PHP really is a web framework and Python, Perl and Ruby all have good web frameworks. I'm not sure c++ has a good web framework to take care of all the minutiae of working in a web environment. Even if c++ does have good framework it still doesn't makes sense to write a web application where you have to manage your own memroy. If you need c/c++ for the speed most language will either let you write extensions in c/c++ or will let you use some sort of bridge that will let you execute c/c++ code in your application.
     
    LogicFlux, Jul 17, 2008 IP
  12. ahmadfarhan

    ahmadfarhan Peon

    Messages:
    211
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    yes you can.. but it would be like using a spoon to open a door..
    ok.. it's a bad metaphor.. but the point is.. it's not the right tool for the job..
    unless you need something that c++ offers that your standard web language(php,asp, whatever) doesn't offer, you really don't have any reason to use c++..
     
    ahmadfarhan, Jul 17, 2008 IP
  13. pr0t0n

    pr0t0n Well-Known Member

    Messages:
    243
    Likes Received:
    10
    Best Answers:
    10
    Trophy Points:
    128
    #13
    pr0t0n, Jul 18, 2008 IP
  14. EgyptGuy

    EgyptGuy Peon

    Messages:
    167
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    you can do what you want with php will be much more easy than c++

    Thanks
    EG
     
    EgyptGuy, Jul 18, 2008 IP
  15. billy786

    billy786 Peon

    Messages:
    323
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I suggest learning html, php css for web development as c and c++ are more for desktop applications, fine tuning the hardware and building compilers.
     
    billy786, Jul 18, 2008 IP
  16. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #16
    There are so many newbies posting in this thread without the slightest clue...

    Just read the posts by davejames909 and LogicFlux.

    It isn't a good idea to use C/C++ to write CGI scripts. Wrong tool for the job like someone else already said. If you are a C/C++ programmer Asp .NET and C# is the way to go. Most people prefer to use PHP because it's easy. As for Perl, noone writes Perl for CGI anymore. If you choose to use Perl use mod_perl or FastCGI and a framework like Catalyst or Maypole.
     
    NetStar, Jul 18, 2008 IP