Meme of two women fighting while a man smokes from a pipe in the background.

The women fighting are labeled "mathematicians defining pi" and "engineers just using 3 because it's within tolerance"

The man smoking is labeled "astrophysicists" and the pipe is labeled "pi = 1"

you are viewing a single comment's thread
view the rest of the comments
[–] 55 points 1 year ago (2 children)

as an engineer, a lot of languages (even proprietary ones) have a built-in constant pi variable because it is so ubiquitous - its easier and more readable to use pi than 3........

  • source
  • hideshow 4 child comments
  • [–] 17 points 1 year ago (2 children)

    And then you’re using C++ and they scold you for including cmath for just M_PI because it increases compilation times.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 20 points 1 year ago (2 children)

    We're talking about engineers here! We're using MATLAB or Python if we're programming at all.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 35 points 1 year ago (3 children)

    Your not writing regular python code, your writing a special subset of python intended for engineers and scientists called "bad python code"

  • source
  • parent
  • hideshow 6 child comments
  • [–] 5 points 1 year ago (1 child)

    You can't say that for all engineers. I'm one and the biggest part of my job is programming in C++

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 1 year ago (1 child)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 1 year ago (1 child)
  • [–] 6 points 1 year ago* (1 child)

    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:

    #define M_PI   3.14159265358979323846264338327950288
    

    Yes, it's literally what math.h has defined.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 1 year ago

    I've also never seen a fellow engineer simplify pi to just 3, although I have seen a rise of memes from people who think they do.

    I would slap someone if I saw them try that, it's unnecessarily sloppy. 3.14 is the default, and trivial to work with if you're using a calculator (I would also slap someone if I saw them not using a calculator). Unless you just LIKE having all your calculations be off by almost 5%. Then you'll come back wondering why so many of your parts are out of tolerance.

  • source
  • parent