Which one is better for a physics/astrophysics major? I will be taking Fortran as well.
I got the advice to learn C++ from a postdoc, but he gave no particular reason for that other than he'll be using it for dataselection. I don't know what is suitable for simulations.
A friend of mine used Fortran for his thesis where he modeled airflow in windmillparks.
C+=2 is my personal favorite.
But really, C++. Very few scenarios where you actually need C and I doubt, being a physicist, that you will be doing much systems programming.
C++ and Fortran is a good combination. Knowledge of basic C is useful.
In scientific programming, there seems to be two schools - proponents of C++ and proponents for Fortran. I think the Fortran school represents legacy programmers (old-timers).
Downgrading from C++ to C is probably easier than upgrading from C to C++.
I'm not too sure how it works in the physics world, but in finance C is outdated and no one really uses it anymore. Hope that helps.
C is the basis for C++. C is not object oriented, C++ CAN be object oriented, or you can just use C and say that you are using C++. If you want a language that forces you to be object oriented whether you like it or not, go with JAVA.
I think C++ is best and what follows from Borek's statement is that if you learn C++, you will then already know C it's just that if you then want to program in C, you'll have to remember that you can't use any of the object oriented methodologies.
Cool! Thanks eXorikos
Thank you so much PhDorBust
Thanks a zillion Astronuc
lol Thanks Borek
Yes this is helpful, thank you very much.
Thanks so much phinds, this is very helpful! I take it then that once one has taken C++, one will also know C from what you have said here. We worked with Java in intro programming, but of course it wasn't exhaustive.
I appreciate your response everyone! I will take C++.
Yeah, the fundamental underlying language of C++ is just plain old C, so you don't have any choice but to learn C on the way to C++, but C++ overlays all kinds of cool capabilities based on making it object oriented. You don't always need them but when you DO need them, there just isn't any substitue in basic C.
Yes. The only problem is to learn which parts of what you know you have to forget.
In my experience, this is much harder than it sounds.
Personally, I think it is much better to know how to program than any (or many) particular language(s). I know people who can program badly in many languages.
Count me in. While I have learned to not use goto back in eighties, I am afraid most of my code has nothing to do with languages I am using. I bogged down somewhere between Pascal and C++.
As they say, some people can write FORTRAN in any language.
Thanks again phinds. For some reason my school is not offering C++ in the Fall. There is only C, C#, and Object Oriented Programming with Java. They had it in the Spring, but not in the summer, and I thought they would have it for Fall. I'm not sure why they are not offering it.
I am asking because I did intro to comp programming last semester, and the only other courses being offered are language courses and object oriented programming with Java :/ I just found out there is no C++. I was also wondering because some fields use some languages more than others, so I was wondering which is best for the field I want to go into.
C++ is also object oriented, so Java might be a good idea. Object oriented programming is something totally different from other languages.
Learning C has the advantage of learning how to manage your memory you use. Java does this automatically, but C++ doesn't.
The argument against C++ is that it's simply a bad language. The reason it's a bad language is that they tried too hard to maintain backward compatibility with C. C is actually quite a nice language; it's a simple tool specialized for certain specific jobs.
More global advice for science grad students: don't waste your time learning lots of computer languages or doing lots of coding. Spend your time doing science.
Thanks eXorikos! I'm all confused now...so sorry if this is overkill...Do you think I should do both C and object oriented with Java? Maybe it's not necessary to take all these classes, and I can take the OOP w/Java and learn C++ by other means? I wonder if it is necessary to take the course to "prove" that you have learned it.
If you take one programming course that will be sufficient and it doesn't matter what language. It's impossible to learn every language. You'll learn other languages if you should ever need them. Basic programming skills is what you need, not syntax.
Separate names with a comma.