Doesn't work, still crashes.
int dontcrash[21474836478];
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.
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.
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 ;)