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

Beginner learning programming

  1. Dec 13, 2014 #1
    I wish to learn some programming basic during the holiday. I stumble across Java , C , C++ , Matlab , SQL, PHP and others. There're so much types of programming languages. Which one is the easiest to start?
     
  2. jcsd
  3. Dec 13, 2014 #2

    jedishrfu

    Staff: Mentor

    Many students play with Python or Java. My suggestion to you is to check out Processing IDE. Its free extremely easy to learn and is based on Java so you can get as complicated as you want..

    Processing was designed for casual programmers and for graphics artist who wanted to get into dynamic interactive art projects.

    processing.org
     
  4. Dec 13, 2014 #3

    Astronuc

    User Avatar

    Staff: Mentor

    What is one trying to accomplish with programming. Is one interested in webpage design/graphics, games, databases or data management, or computation.

    For example, "PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML." http://php.net/manual/en/intro-whatis.php

    For scientific computation, one would want to learn C++ or Fortran. These are necessary in computational physics/chemistry.

    For data management, one may wish to learn python.

    MATLAB is another analytical software - http://www.mathworks.com/help/matlab/
     
  5. Dec 13, 2014 #4
    Python is free and the programming commands and overall structure is very intuitive and easy to learn. I think with a background in python giving you the general structure of programming you can expand to lots of other languages quite easily. You can download canopy, which is a python editor containing the scientific analysis and plotting libraries like matplotlib, numpy, scipy and others for free here:

    https://www.enthought.com/products/canopy/

    I've also found coursera to be a valuable free resource. This course on high performance scientific computing gives you a general overview of both python and fortran (along with routines to combine both with which to make your code run faster), here:

    https://www.coursera.org/course/scicomp
     
  6. Dec 13, 2014 #5
    Either Python, or C. Here's why I don't recommend the others:

    Java has a lot of syntactic sugar. By that I mean, there's a lot of tedious work you have to put in to get your program to work.
    C++ is similar, and you'll likely be forced to use iostreams when starting out. They aren't very intuitive, and can confuse a beginner easily.
    MATLAB is okay, but it's not really a general programming language.
    SQL is not something you make programs with. It's a language to query databases.
    PHP is used for web development, not programs in the classical sense.
     
  7. Dec 13, 2014 #6

    jedishrfu

    Staff: Mentor

    All of you here should look at Processing. It's gaining a lot traction in the educational world. There are Vimeo videos of processing projects. True it's based on Java but in learning the language you learn portions of C and C++ which all have a common format.

    The beginning programmer needs to know very little to begin.

    Www.processing.org
     
  8. Dec 14, 2014 #7
    I've seen and worked with some projects using Processing with Arduino or Pic microcontrollers, it's nice but if the OP were looking for something more along simple/intuitive lines I'm not sure Processing is it.
     
  9. Dec 14, 2014 #8

    jedishrfu

    Staff: Mentor

  10. Dec 16, 2014 #9
    At what level of knowledge & skill are you? If an absolute beginner, consider this.

    My perspective is Old School since I learned foundational programming back in the 70's and honed my skills in the 80's doing industrial automation. Ancient History. A lot of methodology I was taught doesn't seem to be emphasized much anymore due to progression of the science & computing power/technology. Back in the day we would start by performing a very deliberate program design using flow charts, Jourdan diagrams, pseudo-coding, etc., to nail down the sequence and interaction of code first before punching keys. Now my more up to date colleagues inform me that creating programs is progressing to more graphical drag-and-drop of rigidly specified objects. I have taught Middle-School programming using Raspberry-Pi graphics packages which astounds me. One friend referenced Apple iPhone apps are supposed to be done by a very rigorous set of guidelines. I suppose that makes sense to ensure compatibility, and the iPhone success is a testament to this.

    But I am always shocked at the current generation that seemingly lacks any concept of slow, deliberate, patient plodding through code exercises. They appear to be "corrupted" by the concept that everything just simply works as with an iPhone: a couple of clicks / swipes and you're done. Rather than the realization that your task at hand will require 437 sequential steps, done properly, with sufficient time between steps for everything to work. Too many times I have students that just dive in, start randomly clicking or keyboarding, and throw up their hands in frustration because they are not immediately successful.

    Luckily you have available the fantastic free resources of the internet. If you're a complete newbie to any type of programming, I would gently suggest a study of flow charting methods. Easy & quick to learn. I still think this is invaluable for organizing thought and not punching keys blindly. Then a progression through different languages, from simple to more powerful. This will teach you the fundamentals of different variable types and standard programming constructs like IF-THEN-ELSE. I remember my first "self-taught" language was BASIC back in the day of Microsoft DOS & 2 floppy drives. I used it in graduate school to control a robot workcell. And it was quite simple, usable, and easy to understand. It seems there is a 21st century version of this called JustBASIC. This will give you the foundational skills to progress to Python which is amazingly well supported with MOOC classes many places on the web.
     
  11. Dec 16, 2014 #10
    Even though I'm far from a beginner, I feel as if making meticulous charts as you described could help me as well. I just jump in when making a program (as you described), and never, ever, expect a program to compile and run successfully the first time. I'm even skeptical when this does happen: something must be wrong. I work in both low-level and high-level programming environments.

    Designing a program with the rigor of mathematical proof heavily appeals to me. What sort of charts and diagrams should I be looking for?
     
  12. Dec 16, 2014 #11
    Of course, I JUST RECENTLY cleaned out my closet and donated the book to the library. But I was instructed by a much-smarter-than-me colleague from my Grad School days to study up on Structured Programming by <name forgotten...did I mention I was old?>. I recall it was cheesy paperback "textbook" that was powerfully instructive on the graphical structured analysis method. One diagrams data flows with curved pointers and circles and rectangles holding task or operation names. Only after this is done does one start the task of coding. And this developed the thought processes needed back in the day to set the foundational thought for multi-threaded programming and object oriented programming. Flow charting is another, more fundamental method of organizing thought for simpler sequential programming operations like industrial automation.
     
  13. Dec 16, 2014 #12

    jedishrfu

    Staff: Mentor

    Some good diagrams from an Object Oriented design approach are UML diagrams. The UMLet open source tool allows you to build them easily. My favorite is the sequence diagram where you list instances of objects as columns and each successive row is an action from one object to another.

    It captures the program flow pretty well for design documents that you might write describing how your program works. To me its more useful and perhaps a little more high-level than a flowchart.

    More info on UML diagrams may be found here:

    http://en.wikipedia.org/wiki/Unified_Modeling_Language#Diagrams

    and the UMLet tool here:

    http://www.umlet.com/
     
  14. Dec 16, 2014 #13
    I recommend you hop on Code Academy and just have fun. Don't worry about finding the *best* language. There isn't one. (Different languages, admittedly, have their strengths.) The good news is that the concepts you learn in your first language will apply in almost any other.

    Whatever language you choose to learn first, it is important that you enjoy the experience. (You're on holiday, after all.) That's why I recommend a guided, online learning experience. It'll help keep frustration to a minimum while you learn the basics.
     
  15. Dec 20, 2014 #14

    adjacent

    User Avatar
    Gold Member

    I don't think iostreams are difficult to grasp. I am a beginner myself and I understood it very easily. Why do you say it is confusing for beginners?
     
  16. Mar 2, 2015 #15
    I don't think MATLAB is the good software for learning programming at very beginning. It contains all kind of library and functions. Sometimes you don't need to know what did the MATLAB do for your script, and sometimes you just use the MATLAB as a calculator, not a programming software.
     
  17. Mar 2, 2015 #16

    DEvens

    User Avatar
    Education Advisor
    Gold Member

    Just keep in mind that software is a huge subject. You are unlikely to master it in "the holidays." It usually takes years to become more than a beginner. And the industry is always developing new stuff so old skills quickly become obsolete.

    My suggestion is to pick a project to build. That way you will have something at the end in addition to a new skill. Write your own calculator program or some such.

    Think also about learning to code well instead of just correct. That is, think about learning to make your code easy to understand, easy to modify, easy to test, easy to document, and similar things. Books such as _Code Complete_ by McConnel are a good place to look for this kind of thing.
     
  18. Mar 18, 2015 #17
    Like already mentioned above, it does depends on what's your final goal. I started with Java and then I continued with C, C++ and VHDL. Most
    universities start with Java because the syntax is generally the same as a lot of other programming languages.
     
  19. Mar 18, 2015 #18
    Improvement through practice is the best way to learn programming and develop your skills!
     
  20. Mar 18, 2015 #19
    If your goal is to make use of coding in a Physics or other Science degree, I wouldn't say start in Matlab because it's a script language and won't give you the basics of coding by various reasons. So I'd say start in Java, at least that's what many universities are teaching in the 1st year in degrees of this area. Then Matlab or R (for statistics-based course) is where you want to go, since 1 line of code in this type of software could take hundred of lines in a language like Java or C.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook