Sign in to follow this  
alkisbkn

Best comment ever

Recommended Posts

Cwhizard    100

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.

Edited by Cwhizard

Share this post


Link to post
Share on other sites
ApochPiQ    22999

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).

Share this post


Link to post
Share on other sites
Cwhizard    100


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.

Share this post


Link to post
Share on other sites
Finalspace    1140

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 ;)

Edited by Finalspace

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this