1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Other Where to start computer science

  1. Feb 8, 2017 #1
    I am a high school junior who has completed the AP Physics C mechanics and E&M courses. I know that further down the road I will need to learn some programming. I have a little bit of time on my hands to get a start on this, but have no experience with computer programming. I have read I should first learn Fortran or C/C++, but others say fortran is dead and I should just start with matlab. Still others say to just go the normal route and start with python and javascript. What should I do? Also what is the best way for a complete novice to begin learning this? Does anyone know of any good online courses or books? Should I just wait a few years until I have a college course based on this?
     
  2. jcsd
  3. Feb 8, 2017 #2

    Mark44

    Staff: Mentor

    Fortran is very much NOT dead, but I wouldn't start with this language.
    I wouldn't recommend starting with matlab, either.
    Python, maybe. JavaScript, no.
    My recommendation is C first, if you can find such a course (increasingly hard these days, as so many courses start right off with C++). My reason for recommending starting with C rather than C++ is to get the basics of procedural programming (branching structures and looping structures) without the added complication of object-oriented programming.

    Python would be OK, but in some respects it is such a high-level language that it's hard to comprehend what all is happening "under the hood." With C, and to a lesser extent C++, you get more of a feel for what the computer is actually doing.
    My state (Washington) has a Running Start program in which high school students can enrol in courses in community colleges. As far as books, take a look at this thread: https://www.physicsforums.com/threads/what-is-the-best-textbook-for-learning-c.902078/
     
  4. Feb 8, 2017 #3
    Thanks for the advice Mark. I suppose I will start self teaching from a book similar to this:

    https://www.amazon.com/dp/013110362...e=df0&creative=395093&creativeASIN=0131103628

    But I also have a couple stupid questions, so just remember I have no experience in coding. So I have to download a "compiler". What is a compiler, does it matter where I download it from? Should it be free? Is it kinda just like downloading a game or something to my computer? I understand these questions don't really belong on this forum but my school lacks any sort of programming class and I have no idea what I'm doing.
     
    Last edited by a moderator: May 8, 2017
  5. Feb 8, 2017 #4

    Mark44

    Staff: Mentor

    This is a great book, but I wouldn't recommend it as a book to start with. Some people use it to learn C, but as you have no programming experience, other books would be better, IMO. The other thread I linked to lists a bunch of different books.
    A compiler is required for C, C++, Fortran, and other compiled languages. A compiler is software that translates the source code you write into instructions that the computer can execute. Other languages, such as Python, are interpreted languages, and these require software called an interpreter to do the translation. The major difference between a compiler and an interpreter (which are two kinds of program translators) is that a compiler translates your entire program all at once, while an interpreter translates your code one line or so at a time, runs that code, then translates another line, and so on.

    For C and C++, there are quite a few options for downloading compilers, including gcc and Microsoft's Visual Studio Community Edition. (Other editions of VS cost money.)
    For gcc, start here: https://gcc.gnu.org/ (versions for Linux and Windows)
    For Visual Studio, start here: https://www.visualstudio.com/vs/community/ (runs on MSFT Windows)
     
    Last edited by a moderator: May 8, 2017
  6. Feb 8, 2017 #5

    Stephen Tashi

    User Avatar
    Science Advisor

    You will need to obtain software such as a "compiler" or an "interpreter" unless such software is already installed on you computer. There are two general ways to approach creating programs. Some people prefer to use an "integrated development environment" such as Eclipse. This type of program offers the functions of a text editor specialized to write programs and it provides a window based "mouse oriented" interface to the tasks of compiling and running a program. The more nuts-and-bolts way to write programs is use an editor like gedit to write them and then to compile and run the program by typing commands in a terminal interface. Using that approach, you would download the programming language and its libraries as separate software. A compiler does not run like a game. It has no window interface. Any output it produces is printout to a text window.

    Either way you go, you are going to run into tasks that have to do with "system administration" rather than programming - such as seeing you have all the "library files" that are needed, seeing files are in the correct locations and have the right permissions etc.
     
  7. Feb 8, 2017 #6

    symbolipoint

    User Avatar
    Homework Helper
    Education Advisor
    Gold Member

    The question is still one of interest that I have. So many years ago, a beginner computer science or programming student just enrolled in a course, and the language was already available IN THE MACHINES, AT SCHOOL. Too much has changed and someone like me would be lost. As things WERE at the time, we just enrolled in a beginning computer science/programming course, read our book, attended lectures, did our homework and our laboratory assignments as best we could (not needing our own personal machine), and we learned how to program in our given language. These days, download a interpreter or compiler and what to install and how to adjust our own machine/personal computer.... not sure about the fundamental learning path to take.
     
  8. Feb 8, 2017 #7

    jtbell

    User Avatar

    Staff: Mentor

    That's still the way it's done in college or university intro programming courses. At least that's the way I used to teach those courses, and that's the way they still do it at the college where I taught, as far as I know. We did the lectures actually as combination lecture/labs, in a computer lab, where students used the compiler(s) that we had set up for them. We gave them instruction on how to use them, before doing serious programming with them. Outside of class, they could come into the lab and work on their assignments on their own. Some students of course went out and got compilers for their own computers so they didn't have to rely on the lab computers, but it wasn't required that they do so.
     
  9. Feb 8, 2017 #8

    phinds

    User Avatar
    Gold Member
    2016 Award

    I recommend learning C first. It's the basis for JavaScript and several other modern languages and is still a very widespread language in its own right, AND it is a natural lead-in to C++ (which I do NOT recommend starting with). I normally recommend the "white book" that Mark linked to but for someone with no experience at all, I agree w/ Mark that it's not the best choice (too terse for a rank beginner).
     
  10. Feb 8, 2017 #9

    StoneTemplePython

    User Avatar
    Gold Member

    There is some good advice here. Focusing C or Python first are both very good ways to start. A huge portion of modern languages inherit (heh) from C, and it is a bit closer to the metal than something like Python, so you'll get more familiarity with the computer hardware in the process.

    One thing that people perhaps don't think enough about is the role of complementers and network effects. There are tons of good online resources (e.g. books and moocs) for Python. There are some accessible things on C, but not as much, I think.

    If going the route of C, consider looking at https://www.edx.org/course/introduction-computer-science-harvardx-cs50x . It is perhaps the most popular intro to cs course and uses C.

    If you go the route of Python, consider things like the MIT courses on edx ( https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-9 ). In general MIT computing courses on edX use Python -- though you'll find one or two that don't. Also Allen Downey has some great free books, mostly covering Python http://greenteapress.com/wp/

    One additional thought:

    A huge part of learning programming is doing it repeatedly, over and over -- and pushing yourself on projects while you do this. In the event you happen to live in an urban area where you spend a decent amount of time on a train or subway, you might prefer starting with Python. To my knowledge, there are great portable Python installations available for iPad and iPhone (e.g. Pythonista). There is something called "C/C++ - offline compiler" which has decent reviews though I can't vouch for it.

    There was a time when I spent a decent chunk of my day on public transport and I made full use of coding on my iphone or ipad in Pythonista. An extra hour of coding a day, day in and day out, really does add up. (Incidentally Pythonista just rolled out for python 3.x... it seems that their much larger review base for version 2.x no longer shows up. My interests have outgrown the app so I'm not upgrading, but I still have fond feelings for it.)
     
  11. Feb 9, 2017 #10

    Stephen Tashi

    User Avatar
    Science Advisor

    One would have to be careful to consult resources that matched the version of Python one was using, since (I have read) that the latest versions aren't backward compatible with the older versions. Of course, that might be true of other languages.
     
  12. Feb 9, 2017 #11
    Thanks for all the advice guys. When I get some time I will begin learning C from the recommended edX course above. I was also able to find a senior at my school who knows a decent amount about programming, and he is willing to answer any further questions that I have. Thanks again!
     
  13. Feb 9, 2017 #12

    Mark44

    Staff: Mentor

    Right, they aren't. There were a lot of changes between versions 2.x and 3.x, not the least of which is how the print function works.
    In case your school contact gets stumped, you can also ask questions here. We have quite a few members who are knowledgeable in C and other languages.
     
  14. Feb 11, 2017 #13
    Don't start with a programming language but a programming course that uses no language at all. I took one online at a local community college. I found that it taught me a thought process, along with pseudocode and flowcharts. I took Java and C++ after that and found I was better prepared than my classmates. I ended up with a 98% and 99% in those classes. One of the books I kept from the programming fundamentals class was Programming Logic and Design by Joyce Farrell. I actually used it to teach programming basics to my middle school students in an after school program. It is a small book but I found it very easy to understand. She also has a Java book that I used with my middle school students for the second semester.
     
  15. Feb 11, 2017 #14
    Start with Python if you're just self teaching. C++ if you are very patient and good at learning from a very hard to read textbook, or if you have a mentor or someone to prevent you from getting into bad habits.

    I'd say Python.
     
  16. Apr 7, 2017 #15
    Anyone here thinks it's always a good idea to get a taste of lower level languages, such as machine code and assembly? I think that gives us a good idea what the computer does etc.
    I recall taking a mandatory such course (labcourse) in college back in the 80's, after a general information science introduction & Basic language as a first step (back then ...).
    [Received a good grade on it too! - though don't remember much by now ...]

    At the same time you can compare lower level languages e.g. to C etc.
    E.g. see:
     
  17. Apr 8, 2017 #16

    jtbell

    User Avatar

    Staff: Mentor

    Sure, after you already know some programming in a high-level language. We did that as part of a course called something like "computer organization" or "computer architecture", which CS majors took after the introductory courses.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted