I'm a programmer with a solid grasp of both C++ and Fortran. I'm curious about the best path forward for math-related projects. I've heard that you can integrate Fortran modules into C++, but I'm wondering if it's really worth the effort. What do you all think?
5 Answers
The decision can vary based on your project. For a fun hobby, go with whatever you find more enjoyable! But if this is for something serious, consider what kind of math you'll be tackling. Are you writing your own Fortran code or using existing libraries? Also, think about whether the math is parallel or sequential, as that can influence your choice.
It really depends on the type of math you're dealing with. If you need specialized libraries, especially some complex ones from Fortran, it's worth linking them. Plus, modern Fortran can communicate with C, which opens up a lot of possibilities without needing to rewrite anything, which is a huge bonus. I personally prefer not to mess with working libraries if I can avoid it!
I'm leaning towards C++ too. It seems like it'll serve more purposes in the long run, and Fortran doesn't show up much these days. Just my two cents!
For geometry tasks, I'd stick with C++. It handles those types of problems extremely well and has a wealth of resources available.
Honestly, it really comes down to what you need. If there's something specific that Fortran does better than C++, then go for it. But if you’re just doing general math, C++ is often the better choice. It has more applications, and I think you'll have a wider range of opportunities to use it in the future.
Thanks for the insights! Sounds like C++ might be the safer bet for future projects.