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

Weighing the languages

  1. Aug 12, 2009 #1
    So I just graduated from high school and am heading to college with the intention of getting a BS in physics. I took a semester of programming in Pascal my senior year, but had to drop the class the second semester (to get a freakin' art credit to graduate. God**** arts...), so I didn't learn nearly what I wanted to get from of the class.

    I learned the basic syntax of programming in Pascal, input and output, data types, loops, nested loops, and just generally writing a lot of programs to calculate stuff (all console applications). Since I wasn't in the second semester I didn't learn about functions, libraries, window applications, or any of the good stuff I see online sometimes.

    In my free time I will sometimes write little programs to do things like calculate Pi, find Fibonacci numbers, etc.

    Now that you know where I stand, what programming language should I learn (or should I stick with Pascal)? I know Pascal is a pretty ancient language, and I don't think it's very widely used. I'd like to get very skillful at programming in general, so why not do it in a language I will be using in the future?

    What language would you recommend for a fairly newbie programmer?
  2. jcsd
  3. Aug 12, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Learn Python http://python.org.
    (You don't have to give up Pascal...
    You can use both... You might find one language is better for a particular task than the other.)
  4. Aug 12, 2009 #3
    If no one says different shortly, I'm going with your advice.
  5. Aug 20, 2009 #4


    User Avatar
    Gold Member

    just to spice things up, my fav language these days is C#. And I've worked with a wide variety of prog. languages including Python, Ruby, Java and C. So you might consider C#.NET.
  6. Aug 20, 2009 #5


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

  7. Aug 20, 2009 #6
    I haven't learned python but it is cool because you can do a lot of programing styles in it (e.g. functional programing). It also is a good language to interface with open office and Apache is programed in python.
  8. Aug 20, 2009 #7
    I read the pocket language reference for C#. It seems like a pretty cool language. Supports lambda expressions and language integrated queries. It also somewhat supports generic programing. ".Net" gives the programmer access to a huge amount of libraries which could make programming tasks easier. Of course it relies on the user having the right components installed on their system which could add bloat. I find ".Net" doesn't function that well on old computers.

    It is somewhat portable in that in theory because .Net platform could be installed on any platform but it is a Microsoft specific product so it is likely to work best with windows. I guess, as for learning a language, ask your self some questions: how important is speed, how important is portability, what programing styles might you want to learn (functional, logical, declarative, object oriented).

    Also ask you self, what do you want to accomplish. Are you trying to make university easier or do you want to learn something you might not learn in university. What do you want to do with the programing lanuguage. Will your applications be graphical based, database oriented, computational intensive, do you plan to interface with any programs, like office programs or firefox? Are you interested in web programming, or perhaps even facebook programming? Are there a particular set of libraries (e.g. linpac) or packages, which you might want to interface your program with.

    Also keep in mind, depending on what you want to accomplish maybe you want to learn the scripting language of a mathematical package (e.g. MATLAB, Maple, Mathematical).

    Some other notes:
    -If you want to interface with microsoft office, learn visual basic (although C++ and C# would work)
    -If you want to learn to inteface with octive learn lisp (also okay if you want to learn functional programing)
    -If you want to learn to interface with firefox learn javascript
    -If you are using a windows platform, and you want speed, learn C++
    -If you are using a windows platform and you are willing to give up a bit of speed for a bit of excellence and portability learn C#
    -If portability is your top priority and speed is a low priority learn JAVA
    -If you want to learn functional programing learn Haskel
    -IF you want to learn logical programing learn prolog
    -If you want to learn web programing and you are using a lunix server learn php
    -IF you plan to do a lot of text processing and use a lot of regular expressions learn PERL (note perl is close to php and also good for the same type of tasks)
    -If you plan to do web programing but want to use a windows server then learn ASP (your choice of C# or visual basic dot net).
    -If you are doing numeric analysis or signal processing, I'd recommenced, C, C# or FORTRAN.
    -If you are programing hardware (e.g. microprocessors in robotics) then learn C or assembler although C++ might be okay.
    Last edited: Aug 20, 2009
  9. Aug 21, 2009 #8
    By all means learn (at least) the basics of C++. Alot of modern scientific computing is done with C++.

  10. Aug 21, 2009 #9
    Java and C# are very easy to learn. There seem to be more job offerings using Java, which is also more cross platform, but C# is a better designed language. C++ gives the most control, making it the best high level language for serious programmers, but it's also the most complicated. Python is a scripting language, not very good for serious work but some people seem to enjoy using it anyway.
  11. Aug 21, 2009 #10
    You could have written the above only if you haven't the faintest idea what you're talking about.
  12. Aug 21, 2009 #11
    The OP is just out of high school and is looking to learn a language. He doesn't care about interop, lambda expressions, CLIs or CLRs because he doesn't know what they are. He most likely won't care about them until he leaves college, if ever. Trying to sell him on the supposed benefits of C# is a bizarre thing to do given his stated goals.

    The OP should go away and learn Python, as others have said. If he likes it enough there's plenty of time for him to get his teeth into C-like languages later on.

    If you suggest to a prospective employer that C# is a good approach to serious numerical work, you'll be laughed out of the building. You may also have things thrown at you as you leave.
  13. Aug 23, 2009 #12
    Sorry, my mistake. I meant to type C++
  14. Aug 23, 2009 #13
    I wasn't trying to sell the original poster on C#. Someone else mentioned it and I said it was a cool language with some neat features. I listed several languages, and where I thought those languages were best suited.
  15. Aug 23, 2009 #14
    If you read my post #6 you'll see that I said that python seemed like a cool language. I never stated anything against the original poster learning python. As for him learning over a c like language, I'll leave that up to him.
  16. Aug 23, 2009 #15
    I've been programming for 30 years and have forgotten more languages than many currently know, and I say Python is the best first language I've ever seen. It is remarkably easy to learn and an excellent introduction to programming in general (a precursor to other more popular languages), but can easily be kept as your primary language--there's a rich set of libraries. the only drawback is slowness when you code loops yourself, because its interpreted. But python libraries are usually written in C++, so they are fast. Be sure to get a good IDE though--with a decent debugger and GUI builder. I'll let others make the suggestions because I haven't bothered to take my own advice, yet, on the IDE (I just edit my python source in visual studio and code the GUIs directly with Tkinter--yeah, go ahead and laugh)

    Note also that Jython makes it compilable, but then you can't use other python libraries (but CAN use java libraries)
  17. Aug 23, 2009 #16
    Pupil, if you want to stay with Pascal, download a free version of Turbo Delphi which is just object oriented Pascal. http://www.codegear.com/downloads/free/turbo [Broken] The free license expires after only 100 years, though.
    Last edited by a moderator: May 4, 2017
  18. Aug 23, 2009 #17
    Last edited by a moderator: Apr 24, 2017
  19. Aug 29, 2009 #18
    Another language to check out is Scala--it has all the advantages of Java (and can be fully mixed with java modules and libraries) but it doesn't have nearly the wordiness of java.
  20. Aug 30, 2009 #19


    User Avatar
    Gold Member

    Pupil, I am not pushing any particular language over any other language. But my opinion is, that there are a few posters in Physics Forums who are what I would call "Python zealots". It seems to me that they are trying to sell something too hard. I have used Python and I like it. I have used many languages. There are things to like, and dislike, about each of them. My advice (unsolicited of course) is to beware of anyone who is overzealous about any one language.
  21. Sep 12, 2009 #20
    Pascal is very great to use as an introduction to programming... I say learn Pascal and if master or atleast master it to an extent, you should not have any problems with any other language.and BASIC is also ideal for a beginner.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook