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

This is a discussion on Is this a valid use of C++, or have I completely broken some major rules? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I re-coded my entire website (once PHP, now C++) into 3 C++ executables today. I navigate from page to page ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313

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

    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?

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    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++.

  3. #3
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    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).

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    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.
    My best code is written with the delete key.

  5. #5
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    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.

  6. #6
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    Quote Originally Posted by Thantos
    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*

  7. #7
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    Quote Originally Posted by LuckY
    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.

  8. #8
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    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.

  9. #9
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Now... If you could write your online shopping system in Scheme, I'd be impressed.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  10. #10
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    > 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.

  11. #11
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by Thantos
    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 $.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  12. #12
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    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.

  13. #13
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    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.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  14. #14
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Heh yeah I could see that being a pain in the arse.

  15. #15
    C(++)(#)
    Join Date
    Jul 2004
    Posts
    309
    Quote Originally Posted by Sang-drax
    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.
    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.
    To code is divine

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Serial port: How to know when data has been completely sent
    By arjunajay in forum Windows Programming
    Replies: 8
    Last Post: 03-25-2009, 08:18 AM
  2. Minimum valid address value
    By BMintern in forum C Programming
    Replies: 6
    Last Post: 04-12-2008, 08:21 AM
  3. recursion error
    By cchallenged in forum C Programming
    Replies: 2
    Last Post: 12-18-2006, 08:15 AM
  4. undeclared identifier problem
    By jjj93421 in forum C++ Programming
    Replies: 13
    Last Post: 04-24-2004, 09:22 AM
  5. Azbia - a simple RPG game code
    By Unregistered in forum Game Programming
    Replies: 11
    Last Post: 05-03-2002, 06:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21