498
Order of magnitude is a hell of a drug
(lemmy.world)
A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.
Rules
This is a science community. We use the Dawkins definition of meme.
And then you’re using C++ and they scold you for including cmath for just M_PI because it increases compilation times.
We're talking about engineers here! We're using MATLAB or Python if we're programming at all.
Your not writing regular python code, your writing a special subset of python intended for engineers and scientists called "bad python code"
My code is not intended to be run by any idiots but myself! Anyways why can't i make sense of what i have written just a month ago?
Are you using the appropriate license?
As a comp sci that interacts a lot with engineers, I feel this in my soul.
Coder/engineer confirmed.
You can't say that for all engineers. I'm one and the biggest part of my job is programming in C++
Just wanted to say something similar. Any low latency high frequency code is written in c++, c or assembler. And that’s engineers work usually.
[glares in rust]
Still want to try rust but in my field it’s just not established enough unfortunately. But I love the idea of the language.
honestly, my rust comment was mostly a joke; rust is great for it, but its readability is really bad. i'm not a huge fan of writing/reading it, just using it.
As they should, if that's the only thing you are using it for, don't introduce a whole header file, just put the following in the constants.h or equivalent that the proj for sure has:
Yes, it's literally what math.h has defined.
If I'm not completely mistaken M_PI is not part of the C standard, so depending on your stdlib or compiler or even compiler flags you will have to define it yourself even in C.