PHP or C++ ???

by 77 replies
86
!!:confused:
#programming #php
  • C++ is hosted on Windows and PHP is hosted on Linux. C++ is there mostly for building Desktop Applications and PHP was especially made for web.
    • [ 1 ] Thanks
    • [1] reply
    • What are you talking about... Linux is built on C++...

      C++ is a programming language and is only ever used in web development for operations that require more optimization. I guarantee PHP is more than sufficient for you if you need to ask this question! Use PHP and don't worry about it!
      • [ 1 ] Thanks
      • [4] replies
    • Banned
      [DELETED]
    • [DELETED]
  • PHP is built specifically to serve HTML to a browser. It became popular because it worked very well, was easy to pickup, and had excellent documentation early on. It's a very "scrappy" language focused on getting things done.

    While you could technically write a website in C++, it would be like trying to fit a square peg into a round hole.

    To be asking this question, I'm assuming you are new to building websites.

    If you want to build a general purpose website as fast as possible, I would recommend looking into a system like WordPress, a "Content Management System" which runs on top of PHP and makes building websites very easy. You can tweak the PHP yourself via plugins if you need to.

    If you are gun hoe about making a "web app", I would look to learn PHP on a lower level or look into Ruby, Ruby on Rails, Python, etc.

    If you are in a corporate environment, consider Java.

    If you are familiar with Windows development and .NET, you can checkout C# and their web development tools which are related to C++.
    • [ 1 ] Thanks
    • [1] reply
    • Yes, I fully agree with you and thank you for your post.
  • Marcus,

    Lots of web applications were built years ago in C++ CGI. It was a laborious process.

    For "modern" web applications.... I would recommend PHP if you are focusing on WordPress... For 100% custom web applications, I would use Ruby on Rails. It saves you from "reinventing the wheel" again.....

    God Bless,

    Rich
  • Use PHP for web scripting because it is widely use and frequently updated, use C++ only for desktop applications. I see no connection between using PHP/C++ with design issue.
    • [1] reply
    • i agree.. since most of us are in the same page here.
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • Most Web Applications are made with PHP, cost for maintenance is low, server charges are low and PHP codes are very easy to maintain as compared to other coding.
  • PHP gives you the advantage of being able to change your whole site, with links, in one easy step. Thats what is so preferable about it
    • Banned
      [DELETED]
  • php = web app
    c++ = desktop app
  • Banned
    [DELETED]
  • Both languages runs on different platforms. They can work on Windows, Linux, Mac, BSD, etc. But if you want to pursue a career on system programming, go with C++. If you want to focus on web development, proceed with PHP.
  • With C++ you can only create desktop applications and with PHP you can create websites or web based applications.
  • PHP Is Very Well
  • PHP is good for web application and it is very easy and user friendly language that is why we prefer PHP rather then C++ for creating web application.
  • PHP is used more widely in web apps than C++. I would definitely go with PHP. The community is large and it is supported greatly.
  • Banned
    [DELETED]
  • php is well recommended by the experts. I would like to go with PHP. easy to learn and maximum support online for php users.
  • Just go for php ... it have more advantages .. you can develop wptheme , plugin and sell it easily than any c++ applications ...
  • As per the purpose of quick leading go for PHP, its more beneficial for build a effective website. Moreover, PHP is kind of language which is based on interruptions on the other hand C++ is compiled based language. So choice is yours, if you want fast choice than use PHP first.
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • Banned
    If you want to learn both of them, then go with C & C++ first after that PHP will be more easier.. This is my personal opinion..
  • cheese or butter,,it is your choice,,just learn OOPs concepts

    {mobie}
    Tech
    S
    • [1] reply
    • PHP is one web development language and when C++ is one desktop application language,
      PHP is one simple web development language and when C++ is one object oriented programming language,
      There is one best combination of PHP and mySQL when C++ is very compatible for all databases.
      • [1] reply
  • Alright, it seems that there is a lot of confusion going on right now.

    For all of you, C++ is used in Linux and is what runs a majority of web based panels like cPanel. I said C++ not C. I know what I am talking about. C++ was designed off of C, C++ is just a more advanced version of C.

    C++ can be used in web based applications but a majority of the time, you would use C++ for desktop based programs.

    There is a big difference in programming between Client side scripting and server side scripting.

    With C++, it is primarily based for client side but still can be used for server side based operations. For instance, on one of my private servers, I have a few applications I created in C++ that help trigger the load balancing on my servers.

    With PHP, it's very touchy. You primarily use php as a client side coding method for more stunning websites such as Wordpress sites and Drupal sites. This forum is based off of php client side scripting as its made with vBulletin.

    As any Linux Admin would know, PHP has a huge role to play on the server side as well. PHP is essential for a majority of modern day websites to function.


    So a recap:

    C is the base of C++. C++ is widely used on Linux Servers just as C is to. PHP is primarily a client side scripting language. Windows and Linux both can compile and use C++ coding. There are libraries for C++ that are exclusive to Windows. If you start getting into game development you would know a lot about this.


    I am a certified Level III Linux Server Administrator. I own a large scale IT Business. I have previously worked for HostGator and I have been doing development work for as long as I can remember. I am young but I am not ignorant. Take the true facts from an actual professional who has been doing this for a hot minute now.
  • PHP is a server side scripting language that outputs requested information to the client.
  • The client side and server side aspect of PHP are almost two different types of PHP to be honest. The server side aspect for php is mainly modules.
  • You have to remember that PHP is very close to C, not C++. New additions to PHP have allowed for classes and such, but most content you work with is still closer to C than C++ in what I've seen.

    As for the cardinal differences, I'm just chiming in with what a lot of other folks have already posted, but can hopefully make it a bit clearer.

    PHP is not compiled. This means that when you upload a php file to a server, and refresh the page, the contents (unless they are cached) are reflected immediately. This is great for testing and writing code, but is not terribly efficient.

    C/C++ is compiled code, which means that when you make any change to a file in the program, it has to be recompiled by a compile program. At compilation, the syntax and code is checked to make sure that it links properly via coding standards.

    PHP is not checked, which is why you can obtain the WSOD (White Screen of Death) where the site just does not load since you have a syntax error or programming error of some time.

    Because of these differences, you can understand why PHP is slower than C/C++. C/C++ compiled code is build, using the systems library, meaning that it can be compiled for max performance, and it never has to check to see syntax and other requirements.

    That being said, you can see why Facebook went the route of create their own php->C++ compiler, as it was able to turn their content which is not updated very often, to being compiled into a program that is incredibly fast.

    Just my two cents.
  • Hello..
    Its totally depends on your needs and type of application or system you want to build..
  • Banned
    It all depends on what you are looking for. C++ gives a lot of power and control over your applications. PHP is best suited for web applications since most of its features are targeted towards database and user interaction.
  • php is better then c++
  • Here I would like to go with C++, because it is one of the basic languages we can say. It is basically object oriented programing language which provides so many functions. It is safe, robust and secure language.
  • PHP is used for web application widely and has dynamic part Object Oriented PHP.So there is no need to use c++ in web application.And c++ is suitable for desktop application.
  • I also recommend PHP for web-development, as it is specially programmed for web-development.
    • [1] reply
    • PHP being a user-friendly language gives it an edge over others. As compared to many other scripting languages in market. As a programming language it is vastly used in different segments while developing a professional website.
  • Banned
    [DELETED]
  • C++ is for building Desktop Applications and PHP is especially used for scripting.
  • i think C++ is not used for web development, mainly used for desktop applications. you can only use C++ on the web with the help of a server-side scripting in which is PHP, and it is used on complex type of processes that PHP cannot do on the server-side.
  • I prefer PHP more then C++ .because for scripting PHP is most use
  • Depends on your needs. PHP widely use for website development while C++ is for software development. Find what you needs first and then proceed from there. You can find tutorials, manuals, documentations on google. I recommends use php instead because it's the basic framework for all web development.
  • C++ is basically the backbone of every language. Now you cannot use C++ directly but indirectly, you will be using the concepts of the C++ in every programming language that you come across.
    C++ is designed for desktop applications whereas pHp is strictly for scripting and web applications.
  • Only syntax is similar but not entirely. C++ code needs to be compiled into a .exe, PHP is interpreted directly from the source by Apache.
  • PHP is simple to learn and is quite powerful for web applications. For large-scale applications, PHP could also be compiled (such as Facebook) for faster response.
  • Banned
    [DELETED]
  • PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.So i'm sure this is most important for me and definitely PHP.
  • PHP is script server base language especially developed for web designing and C++ off page language used for desktop applications
    • [2] replies
    • PHP is probably the most popular programming language on the web. Used to improve the website. With PHP, you can do things like create username and password pages, check details of a form, create forums, photo galleries, polls, and more. If you come across a website that ends in PHP, then the author has written some programming code to encourage plain, old HTML.
    • There is a lot of confusion here. Both C++ and PHP are just programming languages. Both can be used to program everything on every operating system. C++ is Objected Oriented prograrmming language, strong-typed, this means you must declare any variable or object used by the program. PHP is also an objected oriented programming language but soft-typed it does not require variable declaration as with C/C++. As a matter fact PHP has the same structure as C++. In other words, PHP is sort of a clone of C.

      Normally, the C/C++ language is compiled. These compilers are designed to generate machine code which instructions would be executed directly by the CPU. These type of programs are widely used to optimize time consuming tasks such as compressing data, device drivers, web servers, but not limited to just that. Therefore, programming on C++ requires certain skill because you have total control of the program memory and you have to check boundaries and memory addresses.

      Is it possible creating web applications with C/C++?

      Sure, it is possible just, think of this: the webserver where your page is hosted was probably programmed with C/C++.

      On the other hand, PHP is commonly an interpreted language, this means, the PHP parser executes the script and translates it on to server commands, it does not generate machine code or executable file to run the program. For this the server must have installed the PHP extension to run PHP scripts. With PHP you do not have to worry about memory boundaries or heap management. However, PHP scripts are a slower than C/C++ compiled files because the server must interpret each code line of the script while the C compiled program is directly sent to the CPU.

      Is it possible creating desktop applications with PHP?

      YES. How? Well there are tools that compile the PHP script into machine code. As it should be tools capable of interpreting C++ code as a server side script. However, never heard of one so far.

      So which is better? A: BOTH but depends the application

      To create simple web applications such as shopping carts, content management systems, or simple database management, I would go for PHP. You only need a webhosting with PHP enabled to use it.

      To create advanced optimized applications such a search engine (like Google), 3D rendering machine I would go for C++. They can run on servers if you have such privilege of installing on them.

      Can I merge both?
      Yes, you can write an extension for PHP with C++ to later use it into your PHP scripts.

      So what to learn first?
      I defnitely would go for C/C++ first. Once you have learned C/C++, PHP would be a piece of cake. Personal experience of this.

      As a matter fact for your information the PHP library used to run PHP scripts was built with C.

      I hope you this helps to give you the idea.
  • PHP is specifically designed for web applications. If you are going to learn a language for programming web apps, PHP is the way to go.

    HOWEVER, it is completely possible to do a web application in C++, and it's not as uncommon as people may think. OkCupid and Meebo are done in C++, and I'm sure there are lots of other examples. It just a much higher learning curve than, PHP, but there is nothing wrong with it per-say.

    In any case, PHP is sufficient for 99% of anything you'd want to do as far as web programming goes. That's what you should learn.
  • php is hypertext preprocessor language.it is a server side html embedded scripting language mainly build to t provides web developers with a full suite of tools for building dynamic websites whereas c++ is mainly used for buliding desktop applications.
  • There is not lot more difference in C++ and PHP both have almost same syntax... please try to learn programming not Programming Language.. If you learn C++ you just need to learn the sytax of PHP..
  • Banned
    [DELETED]
  • The fact that PHP is more popular, C + + is a great language, use what you like best !
  • Banned
    [DELETED]
  • Both are totally different generally c++ and vc++ both are for the windows application development and php is for web development so i dont think its good to compare both of them
  • Banned
    [DELETED]
  • Banned
    [DELETED]
  • PHP focuses mainly on web and C++ is for desktop application so you decide what you want to do?
  • You shouldn't program in C++ unless you are writing code for the Arduino or a laser guided missile.

    You will spend a lot of your time debugging stupid stuff that you shouldn't have to think about in C++.

    You are better off with Python and Javascript. PHP is ok, but the trend is moving away from that and more towards Python. You can program server-side in Javascript using NodeJS.
  • I know that c++ is such a language by which all types of works can be done. But PHP is more easy for web app.
  • Banned
    Both are different similarity they are both object oriented ,
    PHP is better for web development and c++ is better for device level programming.
  • C++,
    i saw lots of responses like that :
    PHP : Web apps
    C++ : Desktop Apps

    Yes you can use C++ to generate web pages, but why you want to make your life impossible, you have PHP and lots of frameworks ???

    If you still want to use C++, and you worry about the design, use MVC, so you can focus on each part of your application.
  • Banned
    [DELETED]
  • Give PHP a shot, it should work for you and save you time.
  • Banned
    [DELETED]
  • Mostly c++ is used to build small desktop applications where as php is used to build websites or for web development. So both are used for their respective task and has completely different use.
  • C++ is low level language with high level features, were PHP is server side scripting language. PHP is fast and preferred to use in server side programming.
  • It depends in your preference Windows or Linux platform!!

    As discussed by the other experts "C++ is hosted on Windows and PHP is hosted on Linux"

    Its your choice now!!
  • PHP is very easy to learn and implement. It supports the web application development. Maintenance is very low.
    C++ support desktop application development. Requires huge code and maintenance.
  • Banned
    [DELETED]
  • C++ is used by many programmers to create computer software and applications that depend upon direct hardware manipulation.
    On the other hand, PHP is a powerful tool for making dynamic websites and also easy to use.
    So PHP is a better option for building your project.
  • PHP language is basically used to serve web development purpose. There are frameworks available such as CodeIgnitor, Laravel and Magento that eases the development work and also, enhance the quality of development work through its features and fucntionalities.
  • hi normally c++ is using to develop software but php or javascript is for websites .
  • PHP for the web app and c++ for the desktop app.
  • Basically C++ is a compiled language where PHP is interpreted language. PHP is easy to learn and user friendly and c++ is very strict language.
  • [DELETED]
  • Why is everyone always griping about memory management in PHP?
    Just because the language attempts to do garbage collection for you, doesn't mean that it's adequate, and you can forget about it.
    The memory you use in PHP does matter. And that's why you use functions like memory_get_usage(). Just because PHP is very forgiving and allows some awful practices to compile, doesn't mean that you should use awful practices in writing code.
    The biggest difference I see between PHP and C++ syntactically is that PHP has less brutally ugly syntax. If you compare PHP and C++ in the scenarios you would use PHP, they're very similar.
    You just need to remember to top load your libraries in C++, which I find annoying. C++ does appeal to my inner need to control every detail of execution, though.
  • If you are cleared that you need to develop a web application then you should use PHP for the web app development because C++ is used to develop desktop apps.
  • C++ is a general-purpose object-oriented programming (OOP) language, developed by Bjarne Stroustrup, and is an extension of the C language. C++ is considered to be an intermediate-level language, as it encapsulates both high- and low-level language features. Initially, the language was called "C with classes" as it had all the properties of the C language with an additional concept of "classes."

    Java is a programming language that produces software for multiple platforms. When a programmer writes a Java application, the compiled code (known as bytecode) runs on most operating systems (OS), including Windows, Linux, and Mac OS. Java derives much of its syntax from the C and C++ programming languages.

    Now, it's your turn you tell which is better as per your requirements.
  • PHP is behind most of the website, its easy to learn and you can do pretty much anything with it. C++ is much harder to code but is more stable. It always depends what you wish to do with the language. ascript or a website?
  • [DELETED]
  • PHP Built For Web Programming
  • [DELETED]
  • php faster, more convenient development
  • PHP fit for web development & C++ fit for windows application. You should select PHP cause it is so easy & popular for building a web application.
  • [DELETED]
  • [DELETED]
  • [DELETED]
  • [DELETED]

Next Topics on Trending Feed

  • 86

    Hey folks,I am bit confused as there are many scripting language but generally most web applications are made using PHP why? And if using C++ in place of PHP will it degrades the quality of web apps in terms of designing...Need reviews !!!:confused: