4 ms·
Out of curiosity, is there anything in particular that makes C++ preferable for simulations? I’ve been trying to get into the topic lately - for now I’ve stuck
by harha 6y ago
Out of curiosity, is there anything in particular that makes C++ preferable for simulations? I’ve been trying to get into the topic lately - for now I’ve stuck to python and Julia for the visualizations that are more familiar to me.
- HPsquared 6y agoPerformance, I'd assume. Simulations can take a lot of number-crunching.
- dgentile 6y agoC++ is really nice for low-level OOP, and compared with C it adds generics and classes. Compared to Python, C++ is lower-level and can have significant performance gains with a well written program. With regard to Julia, if you write your code in "the right way", it is also compiled and low-level.
- harha 6y agoMakes sense, I can see some benefits in having more control of what happens with the memory, rather than trying to fit the model I have in mind into the datatypes python. Found this post [0] fitting: > The best thing you can do when dealing with lower-level languages like C and C++ is understand that things like lists, strings, integers, floating point numbers, objects, etc. do not actually exist. They are simply abstractions. There are only the CPU and memory. [0]: https://news.ycombinator.com/item?id=8356400 https://news.ycombinator.com/item?id=8356400