Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

this is why bugs exist

Name: Anonymous 2006-09-11 16:24

The reason why bugs exist in software amounts to one word (well technically two):

BRAINFARTS

look at this... I didnt catch this for a whole hour in my code:

Vector3D Vector3D::add(Vector3D vect)
{
    Vector3D v;
    v.x = x * vect.x;
    v.y = y * vect.y;
    v.z = z * vect.z;

    return v;
}


;_;

I'm not even drunk or high.  Why the shit did I do this?  i must be stupid

sigh

Name: Anonymous 2006-09-12 18:22

properties are stupid for a simple 3D vectors.
Yeah, in this case they are. The reason why properties are useful is because if you start by accessing public variables directly, you can later change the class implementation without breaking all the code that uses that class.

For example (purely hypothetically!), one day you may decide that using a float for x, y, z isn't good enough, and want to replace it with a complex number implementation. Using properties this is simple, without having to fix all external references to x, y, z.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List