Crazy Comments

Not in robotics but in my AP Java class, I’ve seen some interestingly named variables and classes. Usually, as the first or second done with all the program assignments in my class, I tried to help out others. There were a few students that used variable and class names that made my head hurt. One that was irritating to remember was when a class mate had 2 length variables. One was named “leng” and the other was “lang”. Keeping them straight at first was a struggle.

Not necessarily comments, but sophomore/junior me used to have a sense of humor and some of my commit messages are kinda wonky/random. Here’s a few of my current favorites.

Yo deleto todo.

Committed robot code. Working speed control on drive!!!!!!!!! TOOT TOOT!!!!!!!!!!!! 
And implementation for the pot on the shooter, and two positions for it to go to. 
Only thing that needs set up and tuned now is the intake! :)

(This one's showing a really late night timestamp, guess I was a little excited)
I honestly have no idea what I changed, but thought I should commit.

Commit after deleting the unnecessary RexVector class. 
Plus, it was glitchy and would've required a rewrite, so good riddance. 
Also added that the wheels should c0ck into
turning position whenever not driving,
including a speed check so the base doesn't go crazy when stopping. 
That might not work.
As of this commit, the base is functional without turning while driving,
and with the untested stopped turning position function.

Ahh nostalgia. Thanks for bringing back some old memories OP.

And that reminds me of this…

One student, after dealing with some frustrating merge conflicts, posted a commit message something like “AAAAAH THIS IS WHY YOU DON’T MAKE CHANGES IN MY BRANCH!!!”

It can still be seen in our GitHub code repository.

We also have some fun commit messages:

We have one guy who just hates radians and another guy who wants them.

Not too much, though making Pokemon battles in our comments somewhere has been a tradition for a little while.

We put our mentor’s face in ascii art in our code. He blesses our autonomous routines and makes them function. :slight_smile:

That’s amazing.

And this is the true reason programming is never done! That’s amazing.

Also, I feel like our github notes slowly get worse and worse over time.

How overweight did those extra electrons put you?

Not strictly robotics-related, but the fast inverse square root is one of my all-time favorites.

float Q_rsqrt( float number )
	long i;
	float x2, y;
	const float threehalfs = 1.5F;

	x2 = number * 0.5F;
	y  = number;
	i  = * ( long * ) &y;                       // evil floating point bit level hacking
	i  = 0x5f3759df - ( i >> 1 );               // what the $@#$@#$@#$@#? 
	y  = * ( float * ) &i;
	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

	return y;

It’s pretty amusing on a purely mathematical level, too - it works due to a pretty ridiculous confluence of obscure mathematical coincidences.

It was quite heavy. instead of swiss cheesing our robot, we took some code snippets out. Some parts of we had to take out and the entirety of, but our autonomous worked so it’s quite the win-win :]

Use uppercase letters wherever you can, they weigh less. An uppercase “A” is ASCII code 65, a lowercase “a” is ASCII code 97. Lower ASCII codes result in more 0’s than 1’s in the binary data, and obviously 0’s weigh less.

Don’t bother indenting your code - all those tabs and spaces are just taking up unnecessary weight.

Shorten all your variable names - “operatorJoystick” and “driverJoystick”? No, just use “J” and “K”. Look at all the savings!

Finally, get rid of all code comments. You’ll save tons of weight here!

Follow my useful tips and in no time you’ll be writing lightweight robot code that will be the envy of every team!

Have you ever read any of Ether’s code?

This made me smile. Andrew, you have a long memory.

Crap, that was almost 4 years ago.

While not directly related to coding or comments, there was one day when our coders had nothing to do, so, naturally, I pulled up the chairman’s presentation, revised a few portions, and went to grab some caffeine. I returned to find our programming lead attempting to ctrl-h every space in the document to the word “science” . Naturally I ctrl-z’d my way out of the problem, but have since been more careful with important documents near our programming team.

Not gonna lie, that kinda looks like Woodie Flowers. :wink: