|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Dears
How Are you ? Wish you are all fine i am a fresh graduated Aerospace Engineer , during the 4 years in my department , i had to use matlab , so i didnt learn much about fortran or C/C++ . i am started my Master Degree , and i will have to write a code for my simulation , and i really dont know what to choose , Fortran or C/c++ ?? someone told me that fortran is Dead , and people now uses C and learning fortran will make me a bad programmer , and it is a waste of time . on the other side , someone told me that most of the big companies make its program based on fortran , and it is still being used and i really dont know want to choose ! My professor told me that i have to choose one and he refused to help me in choosing . thank you very much looking forward for your replies |
|
|
|
|
|
|
|
|
#2 | |
|
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 31 ![]() |
Quote:
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
||
|
|
|
||
|
|
|
#3 |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
||
|
|
|
|
|
|
|
#4 |
|
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 17 ![]() |
It depends on what you intend.
Fortran code ist often faster than C++, because of the pointer concept in C++. A C/C++ compiler cannot decide from the pointers wheter two memory objects are identical. Thes prevents some optimization. Of course both, Fortran and C++ are faster (in principle) than Java or C#. This depends on their strong object orientation: You are forced to use objects even if you don't need them. Memory cannot be reused in an easy way, and the memory management may eat a lot of calculation speed. I don't think that Fortran is dead. There still exist large Fortran libraries which are still in use. If you primary intention is to learn programming a contemporary language, use C++. If you want to write the fastest possible program, Fortran could be the better choice.
__________________
Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950) |
|
|
|
|
|
|
|
|
#5 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
i am looking for a speed program beside a language that gives me a chance while searching for a PhD degree . someone told me that acceptance may depend on the language you use , if they use C++ , they will need someone who knows C++. so i am looking also for wide-usage beside speed . what do you think about the part " fortran makes me a bad programmer " ? |
||
|
|
|
||
|
|
|
#6 |
|
Super Moderator
|
If you are going to be doing computational work for a living, then you should learn all three of them.
The speed advantage of fortran is not so important today unless you are going to be doing massively parallel computations. When you are a beginner, the speed difference between fortran/C/C++ is not a relevant thing to worry about. You can write badly performing code in any language. However, you can easily write badly performing C++ code if you unthinkingly use advanced concepts in C++. It is less easy to write bad code in fortran and C. If you are going to do be doing a lot of multi-dimensional array based coding, then fortran is nice for that. This means it is great for cartesian and structured grid codes. |
|
|
|
|
|
|
|
|
#7 | |
|
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,460
Rep Power: 50 ![]() ![]() |
Quote:
Sure, someone who uses goto in 2018 should be punished and I would consider that bad programming. But if you start learning now, just learn modern Fortran. |
||
|
|
|
||
|
|
|
#8 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
|
||
|
|
|
||
|
|
|
#9 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
" It is not because Fortran is hard, it is, but this is not a problem. It is not because it is a dead language, it is, but this is not its major flaw. It is because fortran will make you a terrible programmer, not a bad one, not a slow, underqualified one, but a terrible one. A programmer that no one will want to read, understand, or maintain their code. The code you will write in fortran will be dead before it compiles already. Scientific and research software is written in fortran. That used to be the case, but not anymore. Enormous codebases have been rewritten in C/C++ (e.g LAMMPS, LAPACK, ...) and more things are being rewritten. No one starts a project today in fortran no matter what. Learning fortran today is like mastering the design of sail ships, a skill highly in demand up to the 18th century but no one needs to do it now. Learn, and master, professionally, C++ and use it for any scientific simulations you are working on. If you truly know how to use it, you will realize why fortran is not faster than C++ or anything of that sort. You just need to know what you are doing." |
||
|
|
|
||
|
|
|
#10 | |
|
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,349
Rep Power: 36 ![]() ![]() |
Quote:
In my personal very subjective opinion, I agree with the gist of the message. If you have to learn and program then use C++. It is not just about writing the code one time, it is about maintaining it, adding and removing features to it and then reusing it in future. |
||
|
|
|
||
|
|
|
#11 |
|
Super Moderator
|
For a student, the language you use may depend on whether your advisor already has some code on which they want you to work.
Learning the basics of fortran/C/C++ wont take you too much time. You can do that over the course of your master program. Mastering any one of them will take longer than your master program. I think it is quite true that most new major scientific software projects are NOT started in Fortran and will be in C++. That means definitely learn C++ also. You seem to be worrying about your future employment prospects. Then you should be ready to learn new skills. The days when you could master one skill and get lifelong employment in industry are probably gone. |
|
|
|
|
|
|
|
|
#12 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
but isnt worrying to think about , that company like ansys use fortran inside its product ? it is like people still using it , and modify it . i am sorry if i ask much , but i really want to be sure about my decision |
||
|
|
|
||
|
|
|
#13 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
i think i will start from scratch , that is why my supervisor made it up to me to choose one of them . so you think it will be better to learn C++ rather than Fortran right ? |
||
|
|
|
||
|
|
|
#14 | |
|
Super Moderator
|
Quote:
Bjarne Stroustrup, A Tour of C++ (Very short book, he also has a much bigger book on C++) Peter Gottschling, Discovering Modern C++: An Intensive Course for Scientists, Engineers and Programmers Once you have some experience coding in one language, it will be easier to learn another language, if you need to do so. |
||
|
|
|
||
|
|
|
#15 | |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Quote:
what is better , working on Windows or Linux ? |
||
|
|
|
||
|
|
|
#16 |
|
Senior Member
|
C++ is certainly giving you more chances to find a job. This is a fact.
Yet, today, Fortran is probably even more capable than C++. Maybe FORTRAN created bad programmers 30 years ago. But today, if you are a bad programmer, it is only your fault. Nonetheless, algorithms are naturally procedural, and fancy OO stuff is not gonna give you performance there. |
|
|
|
|
|
|
|
|
#17 | |
|
Senior Member
andy
Join Date: May 2009
Posts: 358
Rep Power: 19 ![]() |
Quote:
C++ is a ridiculous programming language but it is widely used. Fortran was the programming language for numerical methods but it has grown and rather lost it's way. C is a bit awkward but is likely the most flexible to use with other software, libraries and scripting. I would perhaps suggest C with a view to adding C++ and/or Fortran at a later date. |
||
|
|
|
||
|
|
|
#18 |
|
Senior Member
|
I would personally recommend C++. More and more open source solvers are based on C++ now. Those top-notch universities, e.g., Stanford, choosing C++ as their major language for their solvers, such as CharLES.
I don't think modern C++ would be slower than Fortran anymore. Many comparisons have been done on this topic. Well, at least for all I know, there is not much of difference between C++ and Fortran in terms of speed and efficiency. Plus, the C++ has more active communities and more open-source libraries than Fortran does. Those linear libraries, such as Boost, Eigen, work very well on C++. They can be great resources if you want to use linear algebra libraries. But I'll say C++ is difficult than Fortran to learn. The learning curve is pretty sharp. Fortran is much easier in this way. But personally, I am really uncomfortable with the Fortran syntax. They are really wired (from the way I see it). PS: maybe in the future, Julia would be the major language in the CFD community. Who knows, right? Last edited by TurbJet; September 28, 2018 at 01:34. |
|
|
|
|
|
|
|
|
#19 |
|
Member
Yusuf Elbadry
Join Date: Sep 2018
Posts: 65
Rep Power: 9 ![]() |
Thank you all
i think i am going to go with C++ , i see many says it is more use-able , more editable . my question , should i work on Windows or Linux ? |
|
|
|
|
|
|
|
|
#20 |
|
Senior Member
|
Linux hands down... I can't think of a single library or relevant development tool that is available in Windows and not Linux.
|
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| User fortran to input/output file in a parallel run | doublestrong | CFX | 5 | March 31, 2017 09:15 |
| Fortran Compiler-CFX12.1 | Araz | CFX | 13 | March 27, 2017 06:37 |
| CFD Code Conversion from Intel Fortran to GNU Fortran | pitto | Main CFD Forum | 4 | August 4, 2016 15:51 |
| Using Fortran with CFX: How to connect Fortran to CFX? | l.te | CFX | 0 | October 21, 2012 12:42 |
| visual fortran | Monica | Main CFD Forum | 1 | August 28, 2004 21:45 |