1. Not finding help here? Sign up for a free 30min 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!

Computer Engineering major changed to Physics.

  1. Jan 31, 2007 #1
    I was a Computer Engineering major, hated it, and changed to Physics. Now it seems like every Physics professor I speak to wants to know if I know C++. I don't, but I know Java very well. I guess if computing is so crucial for a Physicist to know I should continue learning it, although I won't like it.

    Anyway, to the point. Anybody know where I can find any good C/C++ tutorials online?
     
  2. jcsd
  3. Jan 31, 2007 #2

    verty

    User Avatar
    Homework Helper

    Since you know Java very well, I would skip the tuts and jump ahead to the language specification/references.

    Well, that's usually how I like to be introduced to new languages.
     
    Last edited: Jan 31, 2007
  4. Jan 31, 2007 #3
    I agree with verty, If you know Java, all you have to learn is syntax, you should already have a grasp of classes and objects, so you could basically just google for C++ tutorials there are about a bajillion.

    ALso if you were a Comp Engineering major don't you have any of the programming books or did they teach you java instead of C++?
     
  5. Jan 31, 2007 #4

    verty

    User Avatar
    Homework Helper

    Also you'll probably want to get a book on algorithms. (I have no opinion about which book since I don't know them well myself)
     
  6. Jan 31, 2007 #5
    Java :mad: :mad:
     
  7. Jan 31, 2007 #6
    I would rather learn Java than C++, our whole Computer Science and Engineering major changed because IBM asked Penn State why they arn't teaching us java, we want java programmers!

    So now they offer java, yay!

    PS: Make sure you learn standard java, not the old stuff!
     
  8. Feb 1, 2007 #7
    Is C++ the most important language for a physicist to learn? How about C, Fortran, or some other one. I know Matlab is important.
     
  9. Feb 1, 2007 #8

    Pyrrhus

    User Avatar
    Homework Helper

    Well at my school the languages for engineers were Fortran and BASIC. Seems pretty outdated to me, anyway i am self taugh in Object Pascal, which is a language i like.
     
  10. Feb 1, 2007 #9
  11. Feb 1, 2007 #10

    jtbell

    User Avatar

    Staff: Mentor

    If you already know some programming (e.g. in Java) and don't mind spending money for a dead-tree product, I highly recommend "Accelerated C++" by Koenig and Moo, published by Addison Wesley. It presents a modern view of C++, taking full advantage of the standard library (why re-invent the wheel?).
     
  12. Feb 1, 2007 #11

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

  13. Feb 1, 2007 #12
    I hope that doesn't include Computer Engineers!
     
  14. Feb 1, 2007 #13

    Pyrrhus

    User Avatar
    Homework Helper

    Hahahaha no, Manufacturing Engineers and Civil Engineers.
     
  15. Feb 2, 2007 #14
    go buy Stroustups the c++ programming language.
     
  16. Feb 5, 2007 #15
    Why only one language (esp. for CE and CS majors)?? Here you wouldn't make it out of first year without knowing at least basic MIPS/assembly and have a good working knowledge of C++/Java.

    I'm in science and by the end of the year (freshman) I'll have formally learned scheme/java/c++.

    I guess it depends on how much you know before you enter uni.

    You should know all. Well, I know I wouldn't be programming in fortran but at least being able to read it is important. You can call fortran routines from C/C++ as well. And good luck learning C++ without picking up the majority of C along with it :) (C++ is just a superset of C)

    To answer the OP, like others have said you should have no problem picking up C++ as Java stole a lot of syntax from C/C++ (though they might not admit it ;]). Find a condensed book with little intro material and/or look at some OSS or specification/syntax pages.

    I've used this place as a reference but haven't looked at it in any detail:
    http://www.cplusplus.com/
     
  17. Feb 5, 2007 #16
    He isn't a CS or CE major....

    in 2 semesters how do they teach you 3 languages?
    Or did you take AP CS courses in highschool to cover your intro to programming and intermediate programming?
     
  18. Feb 5, 2007 #17
    depending on the size of the application, physicists usually ask for one of f/c/c++ because most simulations these days deal with high performance computing (geometric or numerical) which may be limited in matlab/java. C/C++ usually becuase at some point you want to render or visualize your data.


    And its a lot nicer than fortran =] but thats my opinion cuz i started with turbo pascal and turbo C.
    printf, fprintf are your friends, i never got the handle on overloading the << and >> operators though i do like overloading math ops.
     
  19. Feb 5, 2007 #18
    I use FORTRAN, and have been dabbling in a little Visual C#. FORTRAN is extremely clunky, but it only does what you want it to, no more and no less, which is ideal for teaching programming for beginners.
     
  20. Feb 5, 2007 #19
    Overloading the >> and << operators are fantastic for reading into and out of a file, you can then populate any type of STL data structure that C++ supplies and do whatever you want with them.

    I'm sure C can do it too but the code is so ugly!

    C++ can be ugly too if you don't know what your doing but it can also be poetic looking and I have yet to see any pretty C code but I guess that doesn't matter if your a physics major.
     
  21. Feb 5, 2007 #20
    At my school you can enter the CS course stream at different points depending on your experience (you have to prove it in some way.) I chose to take a functional programming course even though it was an intro programming course (the 'norm' is a intro course in java) because I hadn't done any functional programming. However, since this is a CS department course they switch over to java close to the end of the second semester to match everyone else (up to basic algorithm design and data abstraction). We learned everything, including mutation and OOP in scheme and then they basically showed us java's syntax and static typing. These two courses were my two electives for first year.

    Since I'm really a physics major, one of my core courses first year is a scientific programming class that teaches numerical methods in C++.

    It is easier for me as programming was a hobby and I was nearly a CS major. (I did take CS in HS but visual basic sucks :D)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?