- #1
HeLiXe
- 440
- 1
Which one is better for a physics/astrophysics major? I will be taking Fortran as well.
Cool! Thanks eXorikoseXorikos said:A friend of mine used Fortran for his thesis where he modeled airflow in windmillparks.
Thank you so much PhDorBustPhDorBust said: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.
Thanks a zillion AstronucAstronuc said: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).
lol Thanks BorekBorek said:Downgrading from C++ to C is probably easier than upgrading from C to C++.
Yes this is helpful, thank you very much.DeadOriginal said: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.
phinds said: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.
HeLiXe said: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.
HeLiXe said: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.
Borek said:Yes. The only problem is to learn which parts of what you know you have to forget.
Vanadium 50 said:I know people who can program badly in many languages.
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.phinds said: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.
@_@Borek said:Yes. The only problem is to learn which parts of what you know you have to forget.
Vanadium 50 said: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.
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.eXorikos said: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.
bcrowell said: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.
bcrowell said: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.
:D Thanks gloriacollinsgloriacollins said:Choose C++ and Fortran... it will be good... :)
Thank you very much twofish-quant! This is great info :)twofish-quant said:It depends on what you are using the language for. If you are doing algorithmic programming, fortran is the right language. If you want large scale architecture, you'd like to use Java. If you want to use declarative style, then Haskell and ML. If you want to use low level languages, you use C.
The trouble is that in the "real world" you have to do algorithmic programming with large scale architectures with declarative bits and parts in which you have to go low level. At that point, you don't have any choice but to use C++.
No. No. No. No.
For some things the science *is* the coding. The nice thing about some science problems is that in order to get something done you *have* to look at the low level computer bits. You spend weeks looking at cache hits, because that's the difference between code that takes three weeks to run, and code that doesn't run at all.
Computational astrophysics is very computational.
Physics is a broad field that studies the fundamental principles of nature and the properties of matter and energy. Astrophysics is a subfield of physics that specifically focuses on the study of celestial objects, such as stars, galaxies, and planets.
Majoring in physics or astrophysics can open up a wide range of career opportunities in fields such as research, academia, engineering, and data analysis. These degrees also provide a strong foundation in critical thinking, problem-solving, and analytical skills.
Fortran is a programming language that is commonly used in scientific computing, including physics and astrophysics. It is designed for high performance and efficient calculations, making it a valuable tool for analyzing large datasets and complex mathematical models.
Yes, you do not need prior experience in physics or astrophysics to major in these fields. However, a strong foundation in mathematics, computer science, and problem-solving skills is essential for success in these majors.
Graduates with degrees in physics or astrophysics can pursue careers in research institutions, government agencies, aerospace and defense industries, and universities. They can also work in fields such as data analysis, software development, and engineering.