ddhr.org | 2020 | 03 | 02 (2) about | archives | comments | rss

Code quality and comments Mon, Mar 02, 2020
I think well-written, good quality code can forego the need for comments.  I'll admit most of the code I've written up to this point has neither been high quality nor well commented.  I'm trying to change that.  Here's something I wrote a few years ago to calculate the acceleration of gravity at a certain altitude: 

out.gr = 9.8066504*(6356766/(6356766+atmo.alt+pos(2)))^2;

There's a bunch of repeated numbers in there, and a whole bunch of parentheses.  It's hard to follow what's going on without writing it down.  Also, no comments.  I redid that code recently, and here's the same calculation, spaced out a little, and with a few minimalist comments: 

standard_gravity = 9.8066504; % [m/s^2]

earth_radius = 6356766; % [m]

local_gravity = standard_gravity*(earth_radius / (earth_radius+geometric_altitude))^2; % [m/s^2]

On steroids Mon, Mar 02, 2020
Bottom line up front:  I'm not on steroids. 

I think one of the biggest misconceptions about anabolic steroids is that they magically make people stronger, better, and faster.  That seems to be how they're perceived in sports:  An athlete takes steroids, a known performance enhancing drug, and is temporarily or permanently banned or is forced to have an asterisk next to their name. 

I think a more accurate way to look at it is that steroids don't make you stronger, they give you the ability to work harder.  You still have to actually work harder, but your body is able to recover faster, which enables you to put in more hard work.  Steroids aren't just a magical pill that give you an ability.  They give you recovery, so you can keep doing what you would otherwise be doing to develop your ability. 

I'm not trying to make the case that steroids are good or that they don't provide an inherently unfair advantage.  I just think their vilification detracts from the immense amount of time and effort their users actually put into their craft. #science