views:

208

answers:

7

I want to develop a forum like web site. I know C, C++ well but I havent used in web development.I know PHP little bit. Which language should i use?

+4  A: 

Out of those, for web development, PHP for sure.

UpTheCreek
+1  A: 

C and C++ is not the correct choice to develop for web, so if you know PHP it's better. also you can try python, ASP.net etc...

Wael Dalloul
If you don't explain why C++ isn't better, the answer is just void... Considering the fact that PHP itself is written in C++, I would assume C++ is quite good for web development!
Workshop Alex
+7  A: 

C++ can and has been used to successfully develop highly scalable web applications. That said, one of the main reasons C++ is not so popular in this category is to do with the lack of standard tools and libraries. There is simply no feature rich library which includes all the necessary boiler-plate code needed to write web applications.

PHP is everything that C++ isn't when it comes to web development - a high-level scripting language designed mainly for web development. The description of PHP on the homepage sums it up nicely:

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

If you're developing a simple forum, this decision is a no-brainer: PHP. In addition to the obvious advantages to using it, you'll find the syntax familiar as it is C-like. However, if you have all the time in the world, you're feeling brave and this is for hobbies' sake, do it with C++!

karim79
+1  A: 

To add most hosting does not support c++ and they will not in most case so if you were me I will go for PHP and almost(nearly) all hosting service support it. Also the lack of function for web development in c++ is also a pull down.

Jonathan Shepherd
A: 

Actually, I wonder why you're not considering to use both! Use PHP for the web interface and write special C++ methods for the more complex actions that you want to take. (Although PHP can handle most of those too.) Basically, this would require less knowledge of PHP and your C++ knowledge stays usable.

Do keep in mind the hosting restrictions of your webhost, unless you're going to host your site on your own system.

Also, do realize that the use of C++ for web development would restrict you to the more general C++ libraries. C++ can be used to write platform-independent code, just like PHP. But not all libraries are supported on every platform.

Finally, PHP already is a powerful language and there are plenty of add-ins for PHP that you can re-use instead of writing it yourself. Still, most of PHP and all the add-ins are written in C++, even though many people just forget about the fact that the code behind PHP had to be written in some language too. Image manipulation, encryption, complex math, etc... It's all been done before for PHP. But it should not stop you from writing your own extensions...

Workshop Alex
I don't think there's such a thing as a complex action that PHP can't handle.
Geo
That's because there are plenty of PHP plug-ins that will handle those complex actions! And many extentions have become part of the standard PHP installation too, while others can be added as optional libraries.At http://www.php.net/~wez/extending-php.pdf [Warning: PDF] you can read how to.
Workshop Alex
A: 

PHP, Python, ASP, JSP, C#.net all should work

A: 

C++ is not commonly used for this purpose. Most shared hosting providers won't allow you to run native executables created by C++ for reasons of security (though I suspect this would be manageable with fine-tuned rights) and portability (eg. you'd have to know which OS the shared hoster's webserver runs on and possibly install additional libraries).

Even if you have your own dedicated server with root access, it might still be difficult to properly integrate an executable as CGI into Apache or IIS.

If you're not bound to PHP or C/C++ for some other reason, you could also try C#. Picking up C# from C++ is very easy and ASP.NET allows you to write your complete website in C#. With ASP.NET MVC, you even have an MVC framework comparable in productivity to Ruby on rails. Many shared hosting providers support ASP.NET and through Mono, it's even possible to host ASP.NET web sites in Linux (I'm doing this with my blog ;-))

Cygon