Portal Home > Knowledgebase > Articles Database > How do you create dynamic webpages with c++


How do you create dynamic webpages with c++




Posted by Luke101, 07-10-2008, 10:44 AM
I am just curious to know how is it possible to create pages in c++?

Posted by 111111z, 07-10-2008, 10:54 AM
more information please

Posted by Luke101, 07-10-2008, 10:56 AM
I know I can create pages in PHP, C#, and ruby languages but can you create pages in c++?

Posted by 111111z, 07-10-2008, 11:00 AM
yes it can be done but more work than doing it in php if I remember right you have a html type first then output what you want. what platform? windows or linux

Posted by Luke101, 07-10-2008, 11:08 AM
It will be either on windows or linux. Whichever is easier to program

Posted by awatson, 07-10-2008, 12:53 PM
You use CGI. I've never done it, but we used it a fair amount at an old job. This link may help: http://library.thinkquest.org/16728/...cplusplus.html

Posted by Edevere, 07-10-2008, 02:43 PM
There is a reason there isn't very much information on this topic...because unless you need to quickly generate offline a bunch of static pages for reason, C++ is always the wrong choice for web development.

Posted by awatson, 07-10-2008, 02:58 PM
Yeah, when I say we used it at an old job - I mean like back in '98 - not sure why it was used back then even, much less why you'd use it now.

Posted by insanelymacintosh, 07-10-2008, 03:26 PM
I have always wondered how to create websites using c++. Doesn't Google use C++ for their stuff?

Posted by Edevere, 07-10-2008, 04:22 PM
Well, Google's problems are not your problems. I would be surprised if they use much C++ to render many actual pages, in the way of CGI type stuff. I'm sure their webserver in written C++ and they probably have a whole application server that sends requests off to the search farm for results in some way that they also invented themselves, but actually using it as some kind of cgi to render the page? Off the top of my head, I know that GMail and Calendar are written in Java, Groups and code.google is written in Python as well as a lot of their help pages. Martelli said somewhere 'Python where we can, C++ where we must.' If you really, really want to do it though, start with http://www.gnu.org/software/cgicc/

Posted by Burhan, 07-10-2008, 07:55 PM
Speaking of Google -- they have actually optimized the filesystem drivers to get most out the disks. Anyway, the basic idea behind programming the web is that you use a protocol (CGI) and then the webserver and your program (written in whatever language you choose) both speak the same protocol. Then to generate "web" pages all your program has to do is output the right headers for the content it is sending, ie:

Posted by Domainitor, 07-10-2008, 09:36 PM
I'm not sure that that's a valid statement. There is no reason to not use C++ for web development. If you know language A, and I don't, but I do know language B, and I'm able to generate the appropriate code for a browser, then there's no reason for me to not use the language that I already know (presuming, of course, that it's not a pig). Is it different than what most people use? Yeah, sure. But just because it's different doesn't mean that it's the "wrong choice for web development." We use C (not C++) exclusively for a number of reasons, not the least of which is execution speed. Could we use another language? Yeah, sure. But why waste time on the learning curve? Besides, with a compiled lower-level language we have more control over our runtime environment.

Posted by Luke101, 07-11-2008, 01:46 PM
What do you guys think about this http://www.micronovae.com/CSP.html Last edited by Luke101; 07-11-2008 at 01:57 PM.

Posted by Form1, 07-11-2008, 03:42 PM
I wouldn't go that far - no garbage collection, no bounds checking, etc. Neither mean you absolutely *can't* write C/C++ web applications - and indeed, for many applications it's an excellent idea. (Incidentally, performance critical Ruby libraries and utilities are at times written in C - mongrel, for example.) C++, however, does not offer many features touted by other languages. If you think metaprogramming is a good thing, C++ has only anemic support via STL. If you think dynamic programming features are good, C++ has few - no builtin reflection, for example. Of course, if such things don't appeal to you, you wouldn't gain much from there inclusion. (Many disapprove of highly dynamic languages such as Ruby.) Take it easy, David Berube

Posted by Edevere, 07-11-2008, 06:39 PM
There are TONS of reasons not to use it. Manual memory management and pointer manipulation make it more dangerous than it needs to be for web dev. For pretty much any major web app you can think of the speed of the application code is not going to be your bottleneck, it's going to be database access, so the speed benefit of C++ for application code is usually moot. There are no frameworks that allow you to be as productive as Rails or Django or Wicket or Symfony. C++ programmers who know web development are rare because most people are sensical enough not to use C++ for such things, reducing your hiring pool. The compile/link/run loop is a waste of development time(especially for C++, which has abominable compile times) when you could be hot-loading changes into your development server. Etc. Okay, If Bjarne is on your team, and Scott Meyers, maybe use it. Otherwise just learn Ruby or Python, they're not hard.

Posted by Domainitor, 07-13-2008, 11:55 AM
You're right: If you're a hack and don't know what you're doing, avoid C++. That's true for all languages, but not much of an argument if the OP is a C++ giant....

Posted by Chris Drew, 07-13-2008, 12:16 PM
Wouldn't you be better off using something like C#.net?

Posted by nlbs, 07-14-2008, 11:01 AM
neelbasu.wordpress.com/cgi-cpp have a tutorial on it

Posted by jjk2, 07-14-2008, 03:07 PM
why on earth would you write a dynamic webpage with c++ ?

Posted by nlbs, 07-14-2008, 03:10 PM
Ya sometimes its required cause one might want to do some web front with some embedded device. or one might want to give low level access through web front e.g. moving a robot through Web front . one might want to bind a web front for confguration with a software product. etc..

Posted by Reddead, 07-14-2008, 03:57 PM
I always pondered that question myself, besides the obviousness of it being to static and inefficient for web development. Great insight guys.

Posted by Domainitor, 07-14-2008, 04:02 PM
Too static and inefficient for web development? Care to back that up with some facts?

Posted by Reddead, 07-14-2008, 09:06 PM
I should clear my reasoning for stating it's inefficieny. With the various languages out there, using C++ will only be much more troublesome trying to run a dynamic page or web application. It's easier to spend the time learning the basics of a higher level language, which have several available libraries and toolsets to work with. On the C++ side, there is very little, if hardly any available framework to utilize web applications. Yes, it's possible, but the garbage and memory allocation solutions are too time consuming to worry about. Now, it's great for other types of projects, but having automatic garbage collection in Java helps. The debate of Java's sluggishness v. C++'s speed is going out the window as well. Newer systems and hardware are able to handle the random allocations and demands from higher level languages. I could back them up with links, but I'm too lazy. And you'll probably find other links contradictiong my statement, it still all boils down to opinion.

Posted by Domainitor, 07-14-2008, 09:44 PM
Much more troublesome? Either you want an efficient application or you don't. Higher level language? C++ ain't exactly chopped liver. Garbage and memory allocation solutions are too time consuming to worry about? You're not a real programmer. Random allocations and demands from higher level languages don't concern you? Throwing hardware at a problem is never the solution. Boils down to opinion? Not really. Either you want an elegant, efficient solution, or you don't care. If you don't care, then any of the scripting languages is fine. If you're out to create the best system that you're able, then you're going to need true control of your environment. As I said above, we're strictly a C shop, so I don't really care about C++. But it's the principle. I would never cop out and use short-cuts and then throw hardware at it to make up for my laziness.

Posted by Reddead, 07-20-2008, 07:38 PM
So me justifying not using a particular language for web development qualifies me as not being a real programmer. I'm sorry if I'm not the greatest programmer alive, I was merely throwing my opinion. Again elegant and efficient is defined by the person, himself, people will always view things differently Would you say emacs is elegant or vi is sufficient and there's no need for anything else? No matter which editor you choose plenty will disagree with you. And I already stated a bit on my perspective on efficiency for web development for a novice programmer. We're strictly a C shop. Well good for you, that's something we can agree on. I abandoned C++ to learn C exclusively. Heck, Bjorne, himself, has stated that C++ was created as a joke to begin with and made it complex for a reason. But if you want speed would you consider coding in BCPL, Fortran or even Assembly; if there were frameworks established for web development? Never say never, there will be times when you do have to make compromises.

Posted by Domainitor, 07-20-2008, 09:37 PM
I guess, perhaps, that to a large extent it boils down to one's standards. For speed, I have coded in assembler. On numerous occasions (at least six flavors). And in FORTRAN (4 and 77) on a few, too. I'm not aware of Bjarne ever commenting that C++ was created as a joke. Can you provide a reference for that? Clearly I didn't pick up on your implicit 'for a novice programmer' (although I'm not sure that lowering the bar is an appropriate approach for juniors). I suppose that the the bottom line is that we (you and I and everyone else) have the privilege of coding in whatever languages we like, because we're the ones who decide on the standards to which we hold ourselves.

Posted by QiSoftware, 07-21-2008, 05:41 AM
ansi c would be all you would need. ansi to ensure the code can port to most platforms. Q...

Posted by greg2007, 07-22-2008, 01:30 AM
Exactly the point, but the opposite one you are arguing. Everything has specific uses, you could probably open a bottle of wine with a knife, but only if you didn't have a bottle opener, and that's exactly like what you where saying when you stated ... You can crawl on your hands and knees 200KM along the highway to work if you wanted, but would you? No, you use a car or public transport - train/bus/taxi/bike etc Why not crawl? You know how to crawl, its what you know, so why not use that method? Because it's stupid and not appropriate for the required outcome. In this case it would take you 6 months to get to work, in the case of the code for the web browser using c++ is pointless as PHP was developed from C to work better with servers. PHP is designed to be used for web development, C++ is designed for working more on operating systems, games, desktop applications etc You would also need some sort of interpreter/compiler. Of course if you want to use it for CGI then that's 'arguably' different, but the OP was asking about "web pages" and 'generally' CGI is not used. The learning curve if you already know C is not that much, in fact easier as there is no compiling issues and you tend to be able to check small pieces of PHP code, whereas with C you tend to need huge blocks before you can check particular things. No it's not, and liver is very tasty, to eat, but would you wash your windows with chopped liver?

Posted by Domainitor, 07-25-2008, 10:24 PM
What on earth are you trying to say? (Sorry, just got back from a week away.) When C++ was designed, it was designed to be "a better C" (according to Bjarne). I'm not suggesting that an inappropriate language be used. C++ is quite appropriate. It was obvious (to me) that the language needs to be appropriate (and I implied as much with my comment about it not being a pig). I would never, for example, suggest that one use COBOL to generate dynamic pages, even though you could. It seems to me that the primary reason C++ isn't popular for dynamic page generation is that the majority of people coding are learning the language du jour and don't know how to code C++. There is no good technical reason to not use C++.

Posted by Form1, 07-26-2008, 08:45 AM
Strangely, you are committing the same error as those programmers who learn, say, Java or Ruby because it's popular it's just that yours is the language "du jour" from fifteen years ago. I find it odd you state that there are no good technical reasons. There are good technical reasons, and likely you're familiar with them: memory management and a lack of bounds checking are two prime examples. (This is not to imply that dynamic languages have no issues with security - or, in limited cases, buffer overflows - but nonetheless, the lack of bounds checking is a problem. All applications must have security considerations as a part of design and as a part of implementation.) Dynamic languages allow you to trade computing power for programmer efficiency. Remember, for most web applications, programmer prices are typically higher than hosting prices. Now, if web applications didn't change, and if programming perhaps programming in a lower level language would be a good investment: as most web applications require constant changing, dynamic languages let you do more with less staff as well as deploy changes to your app faster. By deploying changes to your app faster, you respond to the marketplace quicker - this is an economic advantage to your company, and, given the amount of tech startups that fail, this is a nontrivial consideration. Even if your company is not a tech startup, and even if web development is tangential to your companies main focus, lower prices and rapid response to changing business conditions are important. Incidentally, those who maintain C++ recognize it's limitations vis a vis dynamic languages. Consider STL, for example: it's an attempt, albeit an anemic one, to give some of the power of metaprogramming to C++. None of these recommendations mean that C++ *can't* be used to develop web applications; at the very least, C/C++ would be the language of choice for much your toolchain. This may include custom backend software, as it does at Google, or simply prosaic pieces such as Apache, gcc, and so forth. Particularly, performance intensive components can be carefully selected and rewritten in C/C++ - fulltext search engines, for example, are virtually always written in C/C++ rather than directly in a dynamic language. (You can use the fulltext search engine Sphinx in Rails easily with acts_as_sphinx: you get the development advantages of Ruby and the performance of a faster backend.) However, quite simply, there are more cost effective alternatives, in most situations, for web development. This is why companies like Google, Microsoft, Yahoo, and most new web startups are developing in a non C/C++ language. (I'd love to hear some examples of web startups that *are* writing their main application in C/C++ - especially any that are using C/C++ for their customer facing applications.) That's why programmers like myself who learned C/C++ many years ago often use dynamic languages for web development. However, if my arguments on dynamic languages fail to move you, you may wish to consider Java, which is a more modern static language with much better web support. A large ecosystem of very good third party libraries, frameworks, and other software packages exist for Java, which can be an extremely important part of keeping software prices down. Take it easy, David Berube

Posted by Domainitor, 07-26-2008, 11:48 AM
Memory management and bounds checking are not good technical reasons. They are issues that lazy or inattentive programmers face. I'm not talking about throwing hardware at a problem so that I can hire cheap programmers. Your thought (as written) seems a little garbled, but you appear to be contending that web apps are constantly changing so using interpreted or scripting languages is important. I beg to differ. You can just as easily update your app if you're using a compiled language like C/C++. The significant difference may be that coding your app in C/C++ will require that you think about what you're doing because you won't be able to hack it together. We agree! You can use C/C++ to develop web applications! Especially if you're sensitive to performance! This is where it gets interesting. If you're paying for compute time, having your application run ten or even a hundred times faster than when you code it in a dynamic language saves you money. Now, think about that in terms of hardware. If I write an application that runs well on seven servers, and someone else has to use seventy servers for the same throughput (that's only a 10:1 speed ratio difference) how much money have I not spent on hardware when I deploy? And how much have I saved in on-going prices like electricity, cooling, system maintenance, system administration, interconnect infrastructure, and space for the physical servers? Whether I'm self-hosted or I host in someone else's facility, these prices are real. Heaven forbid you should use the more typical 100:1 ratio.... However, if my arguments on dynamic languages fail to move you....[/QUOTE] Sorry. They don't. No offense meant. But our focus is high-traffic, scalable, distributable sites.

Posted by Form1, 07-26-2008, 02:52 PM
Dynamic languages offer faster, quicker development. I've done both C/C++ and dynamic development, and the latter is faster. The belief that memory management and no bounds checking aren't a problem is just belief - not fact, as constant security reports about bounds checking show. As far as simply "hack[ing] it together", I'm disagree. Good design is important to all software development, and belief that dynamic languages allow you to just "hack" together workable, professional solutions is, again, just belief - not fact. Fortunately, dynamic languages do offer a number of advantages, markedly including Domain Specific Languages - DSLs. DSLs are advantageous in that they allow a higher degree of orthogonality, as API calls can be afforded the same language support as first class features of the language itself. Blocks in Ruby are an excellent example of this. Judging by your site, I gather you're working in a field with relatively low complexity, but extremely high uptime and performance requirements - which may indeed justify a language like C/C++ or High Level Assembler (HLA). However, your situation is significantly unlike most web applications. Here's a quote from Bruce Eckel - author of Thinking in C++ and Thinking in Java: Smart guy. I'd recommend you follow his, Paul Graham's, and Richard Stallman's recommendation and try some other languages - Java would be a good start, as would Lisp, Ruby, Scheme, and Python. David Berube

Posted by Domainitor, 07-26-2008, 10:54 PM
Constant security reports about bounds checking merely supports my argument that there are lazy or inattentive programmers. But that's true regardless of the language. You've added 'professional' to the characterization, an adjective that leaves a lot to interpretation. As the old joke goes, an expert is anyone more than fifty miles away. I agree that good design is important. But you can't really believe that people with little or no experience, and little or no schooling, will not 'hack' together their solutions. Look at all the requests on WHT, for example. The number of people that have no programming-related background that are trying to program is surprising. Well, to me, anyway. (No offense meant to those that fall in this category; I'm merely making a point, not a judgement, and I'm certainly not casting aspersions.) Some interpreted languages are fairly trivially extensible. But that, in and of itself, does not make them 'better' than other languages. That's not really the point, though. (I presume you're referring to our registrar solution but, actually, an end-to-end fully-integrated fully automated registrar and hosting solution isn't trivial and is at least upper medium complexity if not the low end of high complexity. We have other applications that are less complex and we still code in C for efficiency's sake.) The point is that there are no good technical reasons that C or C++ shouldn't be used for creating dynamic web applications. That some programmers are lazy or not paying attention is not a good reason to avoid the language. If that's the criterion for language avoidance, then all languages would have to be avoided....

Posted by TomHosting, 07-26-2008, 11:09 PM
C++ = programming language (need to be compiled). PHP/Perl/Python/Ruby etc = Scripting language (no need to compile). can do C++ for webpages?

Posted by Paul, 07-27-2008, 01:22 AM
http://www.webtoolkit.eu/wt/ I like it :-).

Posted by Form1, 07-27-2008, 10:01 AM
True. This is a bit like, say, an iron worker working on scaffolding thirty miles above the ground - a good iron worker won't fall most of the time, but it only takes once to have a problem. No - I'm just saying that that will happen in C/C++ or in any other language, and that I believe dynamic languages are faster and easier to develop in - just like C/C++ is faster and easier to develop in than assembly language. C has a place, as does C++, and as does Java. Depends on your definition of better, I suppose. I believe any language that allows you to write code which makes further development faster has an inherent advantage on large projects. C/C++ macros are a minor example of this, though they can introduce a gigantic array of problems if misused - Lisp macros, on the other hand, can let you take problems you frequently encounter in your problem domain and make them easier to handle. This is what I mean by better. However, by your arguments, there isn't any reason to use high level assembler instead of C - it's more efficient, and if you're not lazy and if you're paying attention, you won't shoot yourself in the foot either. Programming in assembler will just take longer. I imagine we'll have to agree to disagree. In any event, I don't mean to say that you're software is trivial - rather, I simply meant that it's a different sort of complexity than many other B2B apps. Some accounting applications are written entirely in, say, an Excel spreadsheet or a Acccess database with VBA macros - trivial from the perspective of real programming solution, but many nonetheless are extremely complicated and have very, very difficult to understand and implement specifications. David Berube

Posted by Reddead, 07-27-2008, 09:15 PM
Alright cool enough. I assumed that this thread and the OP was initiated for novice programmers. But I applaud your arguments, and would concede that we agree more than it may seem. Although, in terms of web development that's where we differ. Oh, as for that Bjorne ( yeah I know his name is spelled Bjarne, but I'm use to reading it as a typo due from an old C++ book I had) comment, http://www.ariel.com.au/jokes/An_Int...troustrup.html. Excuse the headers for the link, but it's from a previous interview and I can't find the original link. It's a pretty old topic. There was also an excerpt from an old computer show mentioning this. So maybe the joke is on us, eh Bjarne? Keep the fight guys, I'm loving your discussions between Form1. I think I've said enough on my opinions.

Posted by Domainitor, 07-27-2008, 10:08 PM
Check the end of that page. It's a joke. It even says "Note - for the humor-impaired, not a true story."

Posted by Edevere, 07-28-2008, 03:58 AM
This discussion is still going? One of the great myths of C/C++ apologists is that overflows and pointer access violations etc. are just 'lazy inattentive programmers'...this is the kind of stuff you get from people in comp.lang.c who think you don't need debuggers either. It's clearly a problem inherent in the language. You can find lots of evidence for this, like that these kinds of errors have been found in Linux, Perl, Python, Ruby, Apache, OpenSSL, OpenSSH...now, the odds of you being a better programmer than Linus Torvalds and Larry Wall and Guido van Rossum and Theo de Raadt are very, very low. Yet, they, among the best we've got, can't get this right all the time. If they are a product of lazy and inattentive programmers, then the only conclusion we can draw is that basically all C/C++ programmers are lazy and inattentive. You can also see this in that the trend in pretty much every language but C has been to try to protect programmers from this kind of thing. Even C++ is moving toward smart pointers and the std:: data structures and so on to try to minimize the possibility of this kind of error...Java became huge basically just by marketing itself as a language that could insulate you from all that unsafe C++ crap. Even aside from that though, the greater efficiency of C or C++ is largely irrelevant. Any web app of any size is not going to be constrained primarily by the app code that's running. Database access, latency of remote calls, OS tuning...this kind of stuff is going to be more important. I guess when you have a nail, everthing looks like a processor bound problem though.

Posted by Domainitor, 07-28-2008, 12:53 PM
Apologists? Not here, pal. Your arguments hold no water. If the coder that made the mistake had been paying attention and didn't make the mistake, I wouldn't be saying that he or she was inattentive. We're all capable of making mistakes. Why that's a problem inherent in the language is a leap I'm unable to make. "Protecting programmers" is an interesting characterization. I'm a big boy. I don't need to be "protected" from the language. Apparently Linus, Larry, Guido, and Theo are big boys, too. When you wear big boy pants you have to be able to accept that you may make big boy mistakes. It's a choice you make. Your sweeping claim that "any web app of any size is not going to be constrained primarily by the app code that's running" is naive at best. I can't imagine that someone who knows better, setting out to build a large web app, would deliberately and knowingly select a language that constrains their runtime to between a tenth and a hundredth of what it could be. If I can get my application to respond in one tenth of a second, and yours takes between one and ten seconds to respond, which do you think would be generally preferred by site visitors? Most web apps are trivial and can afford to throw away cycles. Many others are built by people who simply don't care, so they have no problem with their sites being slow to respond. I learned quite some time ago that the programmer's job is to make the user's job as simple and pleasurable as possible. Sometimes that means that the programmer has to work a little harder. Personally, I'm up for the task because I want to build the best systems that I am able.

Posted by Form1, 07-28-2008, 01:29 PM
Fair enough; I'll explain it to you. As you said, "we're all capable of making mistakes." Would you also agree that we're all only capable of paying attention to a finite number of things at once? For some, perhaps more, and for some, perhaps less, but no one can concentrate on an infinite number of tasks at once. Would you agree that the more things you pay attention to at once, the more likely you are to make a mistake? If that's true, wouldn't it stand to reason that the fewer things one has to pay attention to, the more concentration you could bring to bear on the remaining things? If you're using more concentration, aren't you less likely to make a mistake? If you are making fewer mistakes, won't you produce better software? If, as you've already said, it takes concentration to avoid memory leaks and buffer overflows - among other problems - doesn't it mean that using a language not prone to such things means you'll produce better software? Therefore, using a language which is not C means you'll produce better software. Now, in the real world, the tradeoff is sometimes worth it: speed can be important, though for many database backed applications your number crunching is *already* written in C - MySQL, Postgres, Oracle, DB2, et al will be doing most of the CPU intensive work for you. However, as I've logically shown above, this is not true in the general case. Finally, I'd like to know, again, why, given your opinions, you are not writing code in assembler directly. After all, your arguments apply equally as well to assembler: it's faster, and more compact. Take it easy, David Berube

Posted by Domainitor, 07-28-2008, 01:58 PM
First off, there aren't an infinite number of things to which attention need be paid. Your premise is flawed. And if you're coding a component where there's too much going on for you to keep track of it you're either not abstracting sufficiently, are working from a poor design, or are simply not qualified. Further, your substitution of "concentration" for "paying attention" is not supported by your argument; they are not the same thing. And, finally, you imply that code must be perfect as written and that you can't look at it after the fact to enhance or correct. That's not the real world. We don't code assembler most of the time because we need the code portability from both hardware and OS perspectives. Today's compilers afford us that luxury.

Posted by Form1, 07-28-2008, 02:30 PM
Are you saying that it's as easy to keep track of, say, five things as it is to keep track of three things? Are you saying that is it not easier to do fewer things than it is to do more things? If it is easier to do fewer things than it is to do more things, than, as I have shown above, it is easier to program in a language which is not C. C requires you to pay attention to more things per problem. In fact, wouldn't you agree that a good design has fewer "moving parts" - in other words, fewer things to pay attention to? You imply as much in your post. If that's true, then if an application designed to be written in C requires more "moving parts" - more things to pay attention to - then isn't writing an application in C a bad design? As I said, people can perform better with fewer things to focus on, and by focusing on things other than memory management and bounds checking, they will get more done in less time and likely have fewer bugs. Getting more work done in less time means you can focus I did not imply that. You can enhance or improve at will, but in a non C/C++ language, you won't have to improve bounds checking or memory management. Therefore, all time which would be spent doing that is saved. Therefore, since you do not have to spend time doing said improvement, it takes less time to code in a non C/C++ language. (Of course, some improvement will still be done - simply not as much.) If you believe there is a substantive difference between "concentration" and "paying attention," feel free to substitute the words in my post as appropriate. Just as you have the luxury to write in C so also does most of the world have the luxury to write in a language which does not suffer from C's defects: poor memory management, bounds checking, lack of metaprogramming, etc. As I and others have said - repeatedly - and as you've ignored, most of the performance sensitive parts of large web applications are already written in C - the web server, the load balancing proxy, the database. It is only the custom, domain specific pieces which are typically written in a dynamic language. As a result, the performance gains you might get from switching to C are less, but the upside remains the same: less things to focus on, fewer bugs, changes are more rapid, new releases can be made more often, and so forth. Take it easy, David Berube

Posted by Domainitor, 07-28-2008, 02:49 PM
We can go back and forth forever. You can cast aspersions for as long as you like, but you'll not be able to sway me. Until you come to understand what only decades of experience can teach, and until you choose to always build the best that you can, regardless that particular improvements will be smaller than others, you won't "get it." And that's okay.

Posted by Form1, 07-28-2008, 03:18 PM
We have not, as of yet, gone back and forth - I've said things, and you've failed to answer them. I do "get it" - it's simply that your viewpoint is incorrect. As far as choosing to build the best I can, I have, indeed, done that. I've simply done so in a different way - a way that produced *better* software for *less money* in *less time,* as I've logically shown in my previous posts. That's what superior software means - software that helps the client do what they want to do faster and easier. Please note that it's unwise to claim superior knowledge and experience when you do not know with whom you are speaking. As far as decades of experience in software development, I've been writing software for over a decade now - professionally freelancing for the last seven or so. I've used a wide variety of languages. As far as what experience can teach, what about what *teaching* can teach? I've guest lectured at Harvard on programming, and I've been invited to China to speak. What about what *writing* can teach? I've written magazine articles on programming published in over sixty five countries. My third (or fourth, depending on how you count) book on programming will be in bookstores everyone next month. I'm not saying these things mean I can't be wrong, that I'm infalible, or that people who haven't done these things can't teach or correct me - they don't. However, if you'd prefer to simply discuss experience instead of discussing the facts, you are not the only developer who has credentials. Many developers have more impressive credentials than you, and many have more impressive credentials than me - and, in fact, often the giants of industry will take a humble attitude and respect the opinions of others, even if they do not agree with them. Simply disrespecting me does not change any of the things I have said, nor does it make them incorrect. Of course, if you don't wish to discuss it further, you do not have to, and of course you are not obligated to respond to anything I say - nor are you obligated to use any given language. As I've said, C may indeed be the very best choice for you. However, by implying that all programmers who write imperfect C code - and/or all programmers who do not use C - are lazy, are not paying enough attention, are hacks, and so forth, you are disrespecting nearly the entire programming community, and that's unfortunate. Take it easy, David Berube Last edited by Form1; 07-28-2008 at 03:27 PM.

Posted by Domainitor, 07-28-2008, 05:54 PM
You haven't the breadth or depth to claim that my viewpoint is incorrect. You're correct that it's unwise to claim superior knowledge and experience when you do not know with whom you speak. I've respected your position. I've not been caustic. I've not name-called. And I haven't judged. I come from a perspective that you're unable to appreciate. And, as I said, that's okay. It's not an attack, it's an observation. A simple statement of fact. No offense was meant and none should have been taken. Your definition of "best" and my definition of "best" are clearly different. Your logic is flawed, but if your better is the better better in your mind, so be it. Further, you twist what I said. I never called anyone a hack. To hack (which I've done for nearly forty years) and to be a hack are very different things. And, by definition, if you malloc and fail to free, you're not paying attention to what you're doing. I have the utmost respect for professional programmers, regardless of the languages they use or applications that they build. This was a discussion -- or so I thought -- about whether or not C/C++ could be used for web apps. Had I known that it was going to be religious, I'd've stayed out of it. I bow to your greatness and yield to your wisdom.

Posted by Form1, 07-28-2008, 06:27 PM
Domainator: You may believe as you wish. If you, in the future, can provide actual, specific examples of the failure in my logic, please do so. In the interim, I'll assume you have none. Take it easy David Berube Last edited by Form1; 07-28-2008 at 06:30 PM.

Posted by Domainitor, 07-28-2008, 08:26 PM
as I expected. You can't possibly have started with a flawed premise and then followed with arguments that do not reflect reality. But thanks for permission to believe as I wish; it means a lot to me.

Posted by Edevere, 07-29-2008, 02:52 AM
It must be hard being the lone voice of reason with a whole industry against you. Rage on brother, crack your cheeks.

Posted by Domainitor, 07-29-2008, 01:49 PM
sarcasm>Aahahahaha! Good one! Seriously, though, since this is a religious issue, I can't expect clear, emotion-free thought. I had been hoping for an adult discussion, not childish displays.

Posted by Form1, 07-29-2008, 05:10 PM
If you'd like to discuss specific points on how the logical arguments I've posted are wrong, I'd be happy to do so. Take it easy, David Berube

Posted by plumsauce, 07-29-2008, 08:13 PM
Ok, I admit that my eyes started to glaze over on the third or fourth page of this thread. But, I just want to let others know that there is such a product. Search for micronovae. It's been around a few years. It has all of the usual objects that are found in IIS with the same or similar syntax. It requires a compiler to be installed on the web server. vc++, borland c++ or gnu c++.

Posted by Christian, 07-29-2008, 11:31 PM
subscribes

Posted by Edevere, 07-30-2008, 01:56 AM
Great. Nobody ever said you couldn't do it, just that in almost all cases you shouldn't. Like, what does this actually power? I find it interesting that in addition to ignoring all of the logical arguments presented by trying to write it off as a religious argument (btw, if you keep repeating it in lieu of actual arguments....it still doesn't make it true), that Domainator also ignores the heaps of empirical evidence out there indicating that almost nobody ever uses C/C++ for front end web development. Can we even find any high profile success stories? Java, PHP, Rails, various Python frameworks, etc...we can find all kinds of nice large and profitable sites that rely on these technologies to render their pages. The ones we can think of that did at some point go the C/C++ route, like the early Amazon, migrated AWAY from it. But this means nothing -- those guys at Amazon and Yahoo obviously don't care about performance.

Posted by greg2007, 08-03-2008, 08:02 AM
If by 'fewer', you mean one that has the 'correct' and 'minimum' amount of moving parts for that design requirements while not affecting the operations/stability/usability/durability etc then yes, fewer is ok. But fewer is relative, and simply 'having less' might result in there not being enough. Exactly what it says, liver is the wrong 'tool' for the job, I.E. You would use a bucket of warm soapy water and a cloth/sponge. If you couldn't understand that most basic relavant comparison to the argument, perhaps you are just arguing for the sake of it and don't have the ability to understand the structure and meaning from other peoples' posts. To 'most' people participating in this thread, perhaps it's time to pick up the gauntlets, and importantly, get back to the opening posters question. He didn't want to know what the definition of a lazy coder is, or who is right or wrong about some blah nonsense unrealted to the discussion. Two people got WAY of the track and started debating with eachother, as amusing as it was to watch the blind try to lead the blind, I think the discussion has burned itself out now. If you need to ask "How do you create dynamic web pages with c++" then you shouldn't be even considering it. Don't use C or C# or C++ for making websites. Use the correct tools, PHP/ASP/HTML/CSS/JS/ETC If you know there is a part of the site that would benefit from using C++ then you already know how and where to use it and if it's ok. You wouldn't be on this forum asking.

Posted by Form1, 08-03-2008, 11:32 AM
Of course, you must fulfill your design requirements. I am unaware of any design requirements which explicitly require malloc and free instead of garbage collection. Therefore, as I said, using a non C/C++ language can lead to a better, simpler program. As Antoine de Saint-Exuper said, "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." He didn't mean when you were left with nothing all together - simply that once you've used the fewest things you can to achieve your goals, you have an optimally elegant design. As I've repeatedly said, please use specific, logical arguments instead of insults and innuendo. I am not blind - I'm an accomplished, experienced developer who is stating his viewpoint logically and clearly, as can be seen from this thread and from my numerous published works on programming, such as the books "Practical Ruby Gems," "Practical Ruby Reporting", "Practical Ruby on Rails Plugins," and assorted magazine articles published in 65+ countries. (Incidentally, we're looking for reviewers for "Practical Ruby on Rails Plugins" - it'll be in bookstores later this month. If anyone is interested, please PM me - you'll get a free copy in exchange for a paragraph or two review on Amazon.) You may disagree with my viewpoint - and you may be correct, as I am quite wrong at times - but please use specific thoughts rather than insults. Take it easy, David Berube

Posted by Form1, 08-03-2008, 12:38 PM
Typo: Exupéry, not Exuper. Take it easy, Dave

Posted by usna1, 08-03-2008, 01:47 PM
You need to learn about FastCGI. It is pretty easy to implement, as there is a GNU FastCGI library available (Google it).



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Dailyhosting.net? (Views: 773)


Language: