What language for what?

18 replies
Is there a list of best uses in terms of programming languages?

I mean if I want to create a web script for example.

How do I determine if Java, javascript, or php is the best?
#language
  • Profile picture of the author sorinnunca
    OK so:

    There are multiple types of "programming languages". There are the regular windows programming languages ( the ones you use to code a windows application) : C, C++, C#, Java and many others.

    Then there are server side languages ( languages you use to create web sites and applications): Ruby on Rails, Python+Django, (Java even has a library for websites) and so on but the most used language around is PHP.

    Then there are client side languages: CSS (client side scripting language), Javascript (there's a really popular javascript library, jQuery, that improves javascript a lot) and so on.

    You can definitely build static pages (pages who don't change content other than manually) with client side languages only (HTML + CSS +Javascript)

    But in order to have a dynamic website built, a site that allows user registration for example you're going to have to use PHP or other server side language.

    On warrior forum the most used language server side language in web scripts / apps is definitely PHP. It's easy to find hosting with php installed, most of the people have it already so if you want to sell a script, PHP is definitely the way to go.

    BUT it's not PHP alone, a web script / application is a mix of PHP + HTML + CSS + Javascript.

    I hoped I cleared out some stuff for you, let me know if you have any more questions.
    {{ DiscussionBoard.errors[8469078].message }}
    • Profile picture of the author DanCoder
      On the web pretty much everything can be accomplished using PHP and Javascript. So for that reason, I don't see why you would need Java unless you're making a game or something.

      I suppose you could say, use PHP to do things with a web page. Use Javascript when you want to do things on a web page. E.g. Javascript to collect information from a form, PHP to store it in the database. PHP to retrieve that information and display it on a page, Javascript to make it do the harlem shake.
      {{ DiscussionBoard.errors[8469103].message }}
  • Profile picture of the author peteJ
    Generally for web scripts you'll want to look at java script or PHP.

    It boils down to this: is what you want to do client side or server side?

    If you want something to dynamically change on the page, for example a photo slider, your going to want to use javascript because it is executed in the browser.

    But, if you want to do something on the server, like check a database to see if a use exists you'll want to use a language run on the server like PHP.

    There is a way to dynamically run server sided languages called ajax, but at it's most basic form this is the root of what you want to ask yourself.


    Java I believe is used for more applet type things. If your building a full blown application that you perhaps want to be able to run as a stand alone program you might use java, but I would usually stay away from that as there are better choices out there.
    {{ DiscussionBoard.errors[8469123].message }}
    • Profile picture of the author zannix
      Originally Posted by peteJ View Post

      Generally for web scripts you'll want to look at java script or PHP.

      It boils down to this: is what you want to do client side or server side?

      If you want something to dynamically change on the page, for example a photo slider, your going to want to use javascript because it is executed in the browser.

      But, if you want to do something on the server, like check a database to see if a use exists you'll want to use a language run on the server like PHP.

      There is a way to dynamically run server sided languages called ajax, but at it's most basic form this is the root of what you want to ask yourself.


      Java I believe is used for more applet type things. If your building a full blown application that you perhaps want to be able to run as a stand alone program you might use java, but I would usually stay away from that as there are better choices out there.
      Great answer. But I can't imagine a programmer knowing how to write JS w/o knowing at least basics of PHP; and vice versa.

      It's just tied together in many many occassions. AJAX being a great example. You'd definitely want to learn both if you jump into the "web development" area.

      Javascript is becoming increasingly powerful though, you already can code desktop apps with it, but learn it alongside PHP.

      You'll be glad you did.
      {{ DiscussionBoard.errors[8469680].message }}
      • Profile picture of the author seasoned
        Originally Posted by zannix View Post

        Great answer. But I can't imagine a programmer knowing how to write JS w/o knowing at least basics of PHP; and vice versa.

        It's just tied together in many many occassions. AJAX being a great example. You'd definitely want to learn both if you jump into the "web development" area.

        Javascript is becoming increasingly powerful though, you already can code desktop apps with it, but learn it alongside PHP.

        You'll be glad you did.
        Actually, there are likely MANY that know PHP and not JS, and vice versa.

        AJAX is a METHOD to have javascript interact with server code. AJAX still uses Java Script. You know the autocomplete code in googles search box? THAT uses AJAX. That is only ONE thing it could do, but it is an example.

        JAVA is used for:

        1. stand alone programs that can be clients,
        2. APPLETS that can acts as clients to a server through an HTML browser.
        3. SERVLETS that can operate in an application server.

        PHP is used for server side operations.(Kind of like #3 for java)

        Javascript is used for client side operations. (Almost like #2 for java, and often better)

        CSS is cascading style sheets and NOT a language.

        Steve
        {{ DiscussionBoard.errors[8470052].message }}
  • Profile picture of the author Geraldm
    Originally Posted by James Foster View Post

    How do I determine if Java, javascript, or php is the best?
    Just remember:

    Java/Javascript - Executed on the client side.
    PHP - Executed on the server side.

    Obviously if you don't want users to see your website 'code' or your code contains sensitive information then DON'T USE Java
    {{ DiscussionBoard.errors[8470938].message }}
    • Profile picture of the author seasoned
      Originally Posted by Geraldm View Post

      Just remember:

      Java/Javascript - Executed on the client side.
      For java, add OR SERVER side OR STANDALONE.

      [quote]PHP - Executed on the server side.

      Obviously if you don't want users to see your website 'code' or your code contains sensitive information then DON'T USE Java
      WRONG! javascript is interpreted and clear text. JAVA is compiled and obfuscated.

      Steve
      {{ DiscussionBoard.errors[8472230].message }}
      • Profile picture of the author Geraldm
        [quote=seasoned;8472230]For java, add OR SERVER side OR STANDALONE.

        PHP - Executed on the server side.
        WRONG! javascript is interpreted and clear text. JAVA is compiled and obfuscated.
        Steve
        Sorry!! I meant Javascript!
        {{ DiscussionBoard.errors[8474985].message }}
  • Profile picture of the author windowindia
    Javascript is best.
    {{ DiscussionBoard.errors[8478479].message }}
    • Profile picture of the author tonyla
      java is compiled to a virtual machine language . then it is interpreted. so it is both.
      {{ DiscussionBoard.errors[8608640].message }}
      • Profile picture of the author seasoned
        Originally Posted by tonyla View Post

        java is compiled to a virtual machine language . then it is interpreted. so it is both.
        Yeah, but it is far harder to read than normal text. REAL compiled languages are getting rarer. VB, for example, moved to real compiled for VB4 and VB5, but .net is bytecode, akin to the virtual machine language you speak of.

        Steve
        {{ DiscussionBoard.errors[8610679].message }}
  • Profile picture of the author tongnk
    I prefer ruby on rails for websites and python for scripting. But its up to you pretty much.

    Just have a look at the communities and the support out there. If you learn any OOP language it's pretty easy to pick up another.
    {{ DiscussionBoard.errors[8610378].message }}
  • Profile picture of the author Crystal88
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[8619047].message }}
    • Profile picture of the author Brandon Tanner
      A few in this thread have mentioned that Javascript is a client-side language... but I just wanted to point out that it is also being used as a server-side language now (Node.js).

      Node.js - Wikipedia, the free encyclopedia

      ^ I've been messing around with it a lot in recent months, and it's pretty cool. Node can do basically the same stuff as PHP, but faster & more efficiently.
      Signature

      {{ DiscussionBoard.errors[8619159].message }}
      • Profile picture of the author wayfarer
        Originally Posted by Brandon Tanner View Post

        A few in this thread have mentioned that Javascript is a client-side language... but I just wanted to point out that it is also being used as a server-side language now (Node.js).

        Node.js - Wikipedia, the free encyclopedia

        ^ I've been messing around with it a lot in recent months, and it's pretty cool. Node can do basically the same stuff as PHP, but faster & more efficiently.
        Hey, that's cool to see you experimenting with something other than PHP Brandon, I think I remember a while back when this came up in a thread somewhere and Node was a brand new concept to you. You'll probably be like me, still use PHP for quick and dirty projects, but have another platform you prefer (I use Python + Django), for bigger production deployments.
        Signature
        I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
        {{ DiscussionBoard.errors[8619583].message }}
        • Profile picture of the author Brandon Tanner
          Originally Posted by wayfarer View Post

          Hey, that's cool to see you experimenting with something other than PHP Brandon, I think I remember a while back when this came up in a thread somewhere and Node was a brand new concept to you. You'll probably be like me, still use PHP for quick and dirty projects, but have another platform you prefer (I use Python + Django), for bigger production deployments.
          Yeah, it wasn't all that long ago that I first heard about Node, from someone else on the board here. Don't get me wrong... I still use PHP all the time (and love it)... but it's always nice to have options, because no single language is the best for all tasks (as I'm sure you know).

          As for Python, Rails, and stuff like that... I really haven't gotten "geeky" enough yet to do more than just simple experiments with those languages.... maybe one day though. You gotta be hardcore to get into that stuff.
          Signature

          {{ DiscussionBoard.errors[8619705].message }}
          • Profile picture of the author wayfarer
            Originally Posted by Brandon Tanner View Post

            I really haven't gotten "geeky" enough yet to do more than just simple experiments with those languages....
            I don't know, I think Node is the new geek's alternative...
            Signature
            I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
            {{ DiscussionBoard.errors[8620261].message }}
            • Profile picture of the author Brandon Tanner
              Originally Posted by wayfarer View Post

              I don't know, I think Node is the new geek's alternative...
              I like that description. Using "new", "alternative", and "geek" in the same sentence makes me sound smart and sophisticated.
              Signature

              {{ DiscussionBoard.errors[8620346].message }}

Trending Topics