Best comment ever

Started by
106 comments, last by Finalspace 6 years, 10 months ago

Doesn't work, still crashes.

int dontcrash[21474836478];

Advertisement

In a VBA project at work:

' Bear in mind that every time the middleware gets updated, the API changes; I presume simply to keep VBA developers on their toes.

This was in the code for a map editor in the game I bought the rights to.

http://i.imgur.com/eJf9FSF.png

This is my main account: https://www.gamedev.net/user/206824-conquestor3/

But google logins aren't working right now, so this is my temporary one.

Relevant log entry while coding deep in the night :p

In college recently

// Don't try to read this. I was drunk when writting it.

The code was a mess... couldn't read it. Couldn't figure out what was going on. But it compiled and worked just fine some how.

The old code stoned, review sober paradigm. Some of my best, least understandable code was written that way.

Learning how to code should happen before puberty or GTFO.


Severely uncool, if your downvotes aren't indicator enough.

I know people who learned to program relatively "late" in life and are easily better at it than I am.

Youth (or lack thereof) means nothing.

For the record, this is not the first derisive or excessively combative thing I've seen from you in the past few days. Please carefully consider your attitude towards others in the community (both GDNet and the programming world as a whole).

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


For the record, this is not the first derisive or excessively combative thing I've seen from you in the past few days. Please carefully consider your attitude towards others in the community (both GDNet and the programming world as a whole).

I'm honestly at a loss as to what other posts you found derisive or combative. If you could PM me with details Ill review and edit them.

I write often somthing like that:


struct SomeStruct {
// @REMOVE: Remove this eventually
... Insert random fields here
};

internal b32 IsAABBOverlap(const AABB &a, const AABB &b) {
	// @SPEED: This is the slowest aabb overlap test ever exists on this planet!
	r32 distanceX = a.max.x - a.min.x;
	r32 distanceY = a.max.y - a.min.y;
	r32 otherDistanceX = b.max.x - b.min.x;
	r32 otherDistanceY = b.max.y - b.min.y;
	r32 bothRadiusX = (Abs(distanceX) + Abs(otherDistanceX)) * 0.5f;
	r32 bothRadiusY = (Abs(distanceY) + Abs(otherDistanceY)) * 0.5f;
	r32 otherCenterX = b.min.x + otherDistanceX * 0.5f;
	r32 otherCenterY = b.min.y + otherDistanceY * 0.5f;
	r32 centerX = a.min.x + distanceX * 0.5f;
	r32 centerY = a.min.y + distanceY * 0.5f;
	r32 diffX = Abs(centerX - otherCenterX);
	r32 diffY = Abs(centerY - otherCenterY);
	r32 overlapX = diffX - bothRadiusX;
	r32 overlapY = diffY - bothRadiusY;
	b32 result = !(overlapX > 0 || overlapY > 0);
	return(result);
}

// @SPEED: Build one matrix to rule them all!
Mat4f scaleMat = Mat4ScaleFromVec3(V3(renderCommand->transform.scale.x, renderCommand->transform.scale.y, 0.0f));
Mat4f translationMat = Mat4TranslationFromVec2(renderCommand->transform.pos);
Mat4f rotationMat = Mat4RotationFromMat2(renderCommand->transform.rot);
Mat4f modelviewMat = Mat4Mult(Mat4Mult(scaleMat, translationMat), rotationMat);



And guess what. It never gets removed or optimized :D

In the past i have written tons of comments in all my code, even things which are obvious.
Now i am using very long names for everything instead and just comment big logical blocks and dropping hungarian notation was the best choice ever ;)

This topic is closed to new replies.

Advertisement