Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Banned
    Join Date
    Oct 2007
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    What Is Harder, JavaScript Or PHP?

    Hey all,

    Maybe seems like an odd question to ask but the reason I ask is because I am learning JavaScript which I find fairly hard to pick up and I am going to start learning PHP soon and so I wondered if I am going to find it easier or harder than JavaScript?

  • #2
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well... The simple answer is Both are easy !

    Be it PHP, Java, C, JavaScript or Dot.Net The only difference is the syntax and architectures. All you need to be conformable if the logic and analytic skills.



    Thanks and Regards,
    Rochak Chauhan.

    www.rochakchauhan.com

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, JavaScript is by itself much easier and more consistent than PHP. But then JavaScript by itself cannot do much. JavaScript operates on a web page inside a browser, however, and the browser and webpage add a whole different level of complexity. On top of that, you have multiple browsers working slightly different that should all be able to handle the script, which adds further to the complexity.

    PHP on the other hand doesn't have as clean a core as JavaScript. And in PHP very much of the language is bolted on afterwards. The server and database also add complexity to PHP, but normally the code only has to run on one server with one database, not a whole bunch of them.



    All in all, I don't think you can say if one is harder than the other, though - PHP is in itself harder if you ask me, but once you figure things out on your server and database you don't have to go change that code much. With JavaScript you on the other hand have to deal with multiple browsers.

    Then there's the issue of code size. If you don't have an AJAX-heavy site, then you'll probably be doing more work on the server than in the client. That means even if you find PHP itself easier, you'll have to dive deeper into that language. Or the other way around for AJAX-heavy sites.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Both languages are very similar. The biggest difference is that you can test JavaScript just by installing four web browsers on your computer (IE, Firefox, Opera, Safari) whereas to test PHP you either have to upload to your web hosting or install a web server on your own computer.

    The only other significant difference is that PHP can read and write files and databases while JavaScript can't. For just about everything else it is just a matter of slight differences in the syntax you use.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •