PDA

View Full Version : Is this a valid use of C++, or have I completely broken some major rules?



Lithorien
12-13-2004, 05:51 PM
I re-coded my entire website (once PHP, now C++) into 3 C++ executables today. I navigate from page to page using ?queries that the .exe strips out and calls the proper function for.

Have I completely broken rules here, or is this allowed?

Thantos
12-13-2004, 05:53 PM
Its allowed but why? PHP is far superior to C++ for webpage design. Theres nothing I can't do in PHP that I can do in C++.

LuckY
12-13-2004, 05:54 PM
You're asking if using C++ to write some programs is against the rules? I'd have to say what rules?

is this allowed?Allowed by whom? You can code whatever tickles your fancy. There are no rules about what kind of programs you're "allowed" to write with a particular language (except maybe, HTML would be breaking the rules if it were used to write a 3D first person shooter).

Prelude
12-13-2004, 06:54 PM
The PHP Gestapo--previously the Perl Gestapo--will be beating down your door any minute because you didn't use an approved language on a medium that promotes freedom of creativity and implementation. How dare you make a reasonable development decision and convert code written by you in an open source language to code written by you in a public domain language!

I once wrote a CGI parser in Forth, and nobody complained. So I guess you're safe. ;)

sean
12-13-2004, 07:32 PM
I've seen C used along side Perl (the previous pseudo-standard for CGI) in a CGI tutorial. Not only is this allowed, it's also not unheard of. Short of piracy and writing malware, there aren't really any rules.

Lithorien
12-13-2004, 08:13 PM
Its allowed but why? PHP is far superior to C++ for webpage design. Theres nothing I can't do in PHP that I can do in C++.

The choice was really based on the fact that I know a lot more in C++ than I do in PHP, and writing any sort of online shopping system in PHP would have been riddled with security holes that I can avoid in an executable.

*grin*

Lithorien
12-13-2004, 08:14 PM
You're asking if using C++ to write some programs is against the rules? I'd have to say what rules?

Allowed by whom? You can code whatever tickles your fancy. There are no rules about what kind of programs you're "allowed" to write with a particular language (except maybe, HTML would be breaking the rules if it were used to write a 3D first person shooter).

ANSI C++ standards. I wasn't sure if I was technically allowed to - by the standard - do an application that used CGI interfaces to the server.

LuckY
12-13-2004, 11:02 PM
Language standards are designed to have a single syntax and vocabulary for a language. They define what source code does in executable form. They do not, however, define what the language is "allowed" to be used for. ;) Keep up the good work.


I once wrote a CGI parser in Forth, and nobody complained.Wow, you're very lucky. I once used PROLOG to write an epilogue and the LPP (Literary Programming Police) brought me down hard. I'm still on probation.

Zach L.
12-13-2004, 11:35 PM
Now... If you could write your online shopping system in Scheme, I'd be impressed. :p

Salem
12-14-2004, 02:45 AM
> Have I completely broken rules here, or is this allowed?
Only in the sense that it might be easier to buffer overflow attack a sloppy C++ program than it is a sloppy PHP/Perl program.

Sang-drax
12-14-2004, 07:52 AM
Its allowed but why? PHP is far superior to C++ for webpage design. Theres nothing I can't do in PHP that I can do in C++.
The only reason I can think of is performance.

Personally, I don't like PHP, because I hate having to prefix each variable with $.

Thantos
12-14-2004, 11:14 AM
Yeah $ is pretty annoying but I can live with it since I don't have to declare my variables and I can pretty much change their types on the fly.

Sang-drax
12-14-2004, 12:11 PM
On my current laptop I actually have a key dedicated for $, but normally you have to press Alt Gr+4 to type a dollar sign on Swedish keyboards, which is very awkward.
On the other hand: this goes for {} and [] as well, which makes programming in general difficult on a Swedish keyboard. Some day I'll create a better custom keyboard layout for Windows. Some day. :rolleyes:

Thantos
12-14-2004, 12:13 PM
Heh yeah I could see that being a pain in the arse.

7smurfs
12-14-2004, 02:10 PM
On my current laptop I actually have a key dedicated for $, but normally you have to press Alt Gr+4 to type a dollar sign on Swedish keyboards, which is very awkward.
On the other hand: this goes for {} and [] as well, which makes programming in general difficult on a Swedish keyboard. Some day I'll create a better custom keyboard layout for Windows. Some day. :rolleyes:
There's a scipting language that is sort of like Auto-it, only it lets you change hotkey type things. So insead of doing weird combos on the keyboard for { and }, you could simply have a program running the background that would intercept, say, F4 and F5, and insert { and } instead.

Sang-drax
12-14-2004, 05:43 PM
Well, F4 and F5 would be even worse than Alt Gr+7, but I get your point. :)
It's possible to write an own keyboard layout for Windows, but I just haven't gotten around to to it.