Welcome to WebmasterWorld Guest from 54.147.20.131

Forum Moderators: phranque

Message Too Old, No Replies

C++ website

     

Jacob or JaF

5:47 pm on Sep 20, 2006 (gmt 0)

5+ Year Member



Is there any way I can use C++ in my website?

willybfriendly

6:22 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your question is not clear.

A compiled .exe file could be downloaded from a server, but that is not the same as using it "in" a website.

A compiled C++ program could be installed on a server to perform tasks related to the website delivered to the broweser, but again that is not the same as using it "in" a website. An entire CMS could be written in C++ and installed on the server, but in the end, the server will deliver the page in good old fashioned HTML, and the browser will parse and render that HTML for the site's visitor(s)

WBF

Jacob or JaF

7:29 pm on Sep 20, 2006 (gmt 0)

5+ Year Member



Well, I want some scripting (like PHP) that can save and load files without reloading the page.

andyll

8:47 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



<<Is there any way I can use C++ in my website? >>

Asp.Net

jtara

10:04 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Is there any way I can use C++ in my website?

Quite a number of ways.

In almost all cases, any component that might be written in PHP, Perl, etc. could also be written in C++. Any component that is an executable, a DLL (Windows), or .so (Linux) could be written in C++, and the rest of the system would be none the wiser. Apache modules can certainly be written in C++, and are a great way to extend the functionality of your website which are often ignored, and not at all as scary as they might seem.

Further, almost all scripting languages can call functions written in C++, so you could create a library or libraries of functions to use in your code.

The advantage one might gain is that the code MIGHT be able to run much faster. Though I'd also look at solutions for compiling code written in scripting languages if that is your goal.

Probably the most practical way to use C++ is for selective speed enhancement. Once you know where the bottlenecks are, replace those bottlenecks with carefully-optimized C++ code.

One could of course go one step further and write in assembly code. But programmers who are able to do much better than well-optimized C++ code are probably few and far between nowadays. Still, if you want to squeeze every last bit - this is an option, particular with small, tight functions.

sharbel

10:45 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



You can program ASP.NET webforms in C++..

jtara

1:26 am on Sep 21, 2006 (gmt 0)

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Oh, one more thing... since I don't know why you are asking the question, I have to assume. And my assumption is that the reason you are asking is that you want to improve performance...

OK, assuming that - if you have to ask this question - then you are likely to get more bang for your buck investigating better algorithms than by switching languages.

That is - an experienced programmer would already know when and where to apply a different language. If you (or your programer(s) don't have the experience to know this - then you (or they) probably also lack the experience to select appropriate algorithms and techniques.

As an extreme over-simplification: if you are sorting something with a bubble-sort, you are going to get way more improvement by using a more advanced sorting technique than by switching from an interpreted language to a compiled one. Way, way, way more.

On the other hand, you might be asking because you want to hire somebody for a project, they know C++, and so of course you are hoping that every nail requires a C++ hammer. While a C++ hammer is useful in web development, it's not often the primary tool of choice.

It's generally a MUCH more expensive way to go than scripting languages, and requires MUCH greater skill on the part of the programmer.

But, I will repeat my own favorite quote (that is, from my own mouth) when asked by project managers "can we do such and such?":

"Sure, we can DOOOOOO anything!"

I don't mention the "but perhaps not at an acceptable cost" part. That's implied in the word emphasis. ;)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month