4 ms·
Software engineer straight out of uni: # Get force of gravity as below to be used later F = G * m1 * m2 / r*2 Software engineer 5 years after uni: gravi
by ZaoLahma 3y ago
Software engineer straight out of uni:
# Get force of gravity as below to be used later
F = G * m1 * m2 / r*2
Software engineer 5 years after uni:
gravitational_force = (
PhysicsContextConstructorFactory.createByRelativisticEnum(SystemConfig.getRelativisticEnum()).construct().getGravitationalConstant().value()
* body1.getRelativisticContext(SystemConfig.getRelativisticEnum()).mass().value()
* body2.getRelativisticContext(SystemConfig.getRelativisticEnum()).mass().value()
/ SystemConfig.getRelativisticContext(SystemConfig.getRelativisticEnum()).distanceTo(body1, body2).value() \* PlatformUnsignedInt(PlatformMinMaxAwareUnsignedInt(2).value()).getUnsignedInt().value()
)*
Software engineer after 15 years:
# Newton's law of universal gravitation is well within wanted margin of error
F = G * m1 * m2 / r*2
- lloeki 3y agoSadly the 5y SE forgot about dependency injecting the computation... after all we're always on the brink of new physics discovery, we'd hate to have to rewrite all that code when we can readily swap in fresh laws with the proper architecture!
- ZaoLahma 3y agoOh, but that comes as a needs-to-be-fixed to the pull request from the 6y SE, so no worries at all.