Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Best programming language

  1. Feb 19, 2014 #1
    This might sounds stupid but I'm just curious, what is the best programming language we have today?
     
  2. jcsd
  3. Feb 19, 2014 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    There isn't a single answer. There are many good languages in common use today. If you're trying to pick one for a project, you should tell us more about your project.
     
  4. Feb 19, 2014 #3
    If you only know one programming language, it is the best - just ask any beginner programmer.
    I remember COBOL programmers asserting that anything could be coded in COBOL.

    If you were going to write an operating system, I would suggest C++.
    If you want to teach structured programming constructs, perhaps PASCAL.
    If you have a quick calculation, perhaps BASIC.
    If you want to integrate with a lot of Windows office tools, perhaps Visual Basic or C#.
    If you're working with a microprocessor, you may want to stick with assembly.
    If you really like reverse Polish notation and you love being cryptic, I would suggest Forth.

    I've done a ton of coding in FORTRAN, but not in the past 15 years. I'm surprised to see people still using it.
    So, if the only thing you have available is some old FORTRAN tools, go with FORTRAN.

    The Air Force used to push Ada pretty hard. If you need to maintain some of that code, go with Ada.

    If you're working in a COBOL shop, go with COBOL. Often there will be too much of that code to try to convert in one shot.

    If you are just looking for a course to select and you want something generally useful and you can deal with some cryptic syntax, and you're ready to work with an OS API, go with C++.

    If you are looking for something a lot simpler, go with Pascal.

    There was one poster last month who only knew Excel (spread sheet), so I showed him how to solve his problem with Excel.
     
  5. Feb 20, 2014 #4

    SixNein

    User Avatar
    Gold Member

    This depends.

    Assuming the path of least resistance.. Select the language with the best library support within budget for what you need.
     
  6. Feb 20, 2014 #5

    rcgldr

    User Avatar
    Homework Helper

    Except that in many cases, IBM mainframe programs are a combination of COBOL and HLASM (high level assembler). Part of the reason for this is that the early disk file structures like ISAM (indexed sequential access method), were primarly implemented as macros for the assembler, but typically there's other HLASM code in what would be called a COBOL shop, and too much of that HLASM code to bother trying to convert what can be converted into currernt versions of COBOL.

    As far as best programming language, it depends on what you're trying to do. Some super-computer companies have made extensions to Fortran and focused their optimizing efforts on Fortran, so Fortran is used on those systems. Also, there's a huge number of library like functions implemented in Fortran, and it's not worth the effort to convert what is already working and well optimized code. COBOL seems best for business type applications, especially for banks where banking laws in most countries effectively require the used of fixed point packed decimal as opposed to binary based floating point for calculations involving money. For windows type programs, a GUI builder environment is useful for generating the user interface code by creating the user interface with drag and drop like tool set. For math stuff used by students or engineers, matlab is good, but it's more than just a programming language.
     
    Last edited: Feb 20, 2014
  7. Feb 20, 2014 #6
    Last edited by a moderator: May 6, 2017
  8. Feb 20, 2014 #7

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Well, I can't really abide by anyone telling someone else to learn Ada (specialized) or BASIC (dead) or Visual Basic (double dead)...

    Some of the most common programming languages in the world today are, in no particular order:

    C/C++
    Python
    Java
    Ruby
    PHP
    Objective-C
    JavaScript

    If you're looking for a simple, flexible, general-purpose language, Python is probably the best on the list.

    If you want to do scientific computation, Python is probably the best on the list. (Using numpy, SciPy, etc.)

    If you want to make simple GUI apps, JavaScript (in a browser) is probably the best on the list. Python also has some capable GUI toolkits like wxPython.

    If you want to write web services, Ruby or PHP (slowly dying) are your best choices.

    If you want to write fast algorithmic code, C/C++ is probably your best choice.

    If you want to be able to interact with most other developers and libraries on the planet, C/C++ is probably your best choice.

    If you want to write apps for mobile devices, you'll use Java or Objective-C.
     
  9. Feb 20, 2014 #8

    phinds

    User Avatar
    Gold Member
    2016 Award

    When you have such questions, you might think about doing a forum search. This particular question has been asked here pretty much every month for years, I think.
     
  10. Feb 20, 2014 #9

    jtbell

    User Avatar

    Staff: Mentor

    In fact, if you look at the bottom of this page at the list of "Related Discussions", you'll find one or two such threads. After reading one of those threads, look at the bottom of that page and you'll probably find a few more. Etc. Etc.
     
  11. Feb 21, 2014 #10
    Wow... Thanks everyone!! That's very informative for me. I'll look for those threads. =)
     
  12. Feb 21, 2014 #11
    Malbogle.
    o:)
     
  13. May 11, 2014 #12

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    C and C++ are fundamental. Java and C# are fairly modern and advanced general purpose languages (both derived from C++). Several good specialized languages exist: MATLAB/Simulink for science and engineering, SAS for statistics, Open GL for graphics, etc. I like Perl for quick and dirty scripting of otherwise tedious jobs. Don't get too attached to any one language. Don't stop at C, include at least one object oriented language.
     
  14. May 12, 2014 #13

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Even better,
    • Whitespace (http://compsoc.dur.ac.uk/whitespace/), which redresses the gross injustice that most computer languages do to white space characters. Quoting from that site,
      Most modern programming languages do not consider white space characters (spaces, tabs and newlines) syntax, ignoring them, as if they weren't there. We consider this to be a gross injustice to these perfectly friendly members of the character set. Should they be ignored, just because they are invisible? Whitespace is a language that seeks to redress the balance. Any non whitespace characters are ignored; only spaces, tabs and newlines are considered syntax.
      ...
      The interpreter was written by someone who shouldn't have stayed up so late, Edwin Brady, and the language was designed by two people who shouldn't have had so much to drink, Edwin Brady and Chris Morris.​
      Here's Hello World in whitespace:
      Code (Text):
      Say hello.  
                 
                     
                     
                       
                       
                         
                       
                       
                             
                         
                   
                           
               
                             
                             
                         
                             
                         
                       
                           
                       
                             
                   
                           
               
                             
                             
                               
                       
                                 
               
                         
                         
                         
                     
                           
                     
                             
                     
                           
                     
                             
                         
                               
                 
                                 
         
                   

                                                                                                 

                                                                                                                                         




                                               
             
         

                                                                                             
       
                   
       
                                                                                                                                                                           
         
             
             
       
                                                                                             

                                                                                                                                                                       
       

       


         

                                                                   
       
       
         
                       
                   
             
                                                                                                                                               
       

         
             
       
                                                                   

                                                                                                                                           
       

         
                 
               
         

                                                                                                                                     
               
                 
         
         
       
          end
      Note well: The above is a cut-and-paste, and it most likely has some of the key characters (tabs versus space) wrong. Note that the stuff you can see, "say", "hello", and "end" are comments in this language. On the other hand, the space between "say" and "hello" is significant.

    • Brainf*** (Wikipedia article), whose sole purpose is to mess with your brain. It's a Turing tarpit language. Here's Hello World in this language:
      Code (Text):
      ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
     
    Last edited: May 12, 2014
  15. May 12, 2014 #14

    adjacent

    User Avatar
    Gold Member

    I wonder what's the use of making life difficult?
     
  16. May 12, 2014 #15

    jtbell

    User Avatar

    Staff: Mentor

    Sometimes people invent things just for fun, instead of for practical reasons. :biggrin:
     
  17. May 12, 2014 #16
    Last edited by a moderator: Dec 26, 2015
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook