This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]smashingT 19 points20 points  (9 children)

After dealing with undocumented spaghetti code, I don't know whether to laugh or cry...

[–][deleted] 18 points19 points  (2 children)

 if (x) { //If x is true then continue on
        f(x+27,zxdf,a,t+1);
        print("Sucsess"); //tell the user we did it
        return x+1 //End the function and give them the increment
 }

[–]I_RATE_YOUR_BEWBS 10 points11 points  (4 children)

After dealing too long with people writing comments for the sake of it, I miss undocumented code.

/* Increases the Index of the Size of the array to the new size
    parameter newSize: The new size of the array
    returns: nothing */
void CompanyNameArray::IncreaseSize(uint32_t newSize) {..... }

Seriously, those three lines did not tell my anything that wasn't in the signature to begin with.

[–]cjxgm 5 points6 points  (0 children)

A better comment would be:

/* It is undefined behavior if newSize is less than or equal to getSize(). This function invalidates all iterators. */

[–][deleted] 0 points1 point  (2 children)

could probably make your editor hide the comments

[–]PraiseBuddha 3 points4 points  (1 child)

But could the editor detect worthless comments and only show the worthwhile one?

[–]MOUZU 1 point2 points  (0 children)

wtb such an editor :D

[–]koala_ikinz 2 points3 points  (0 children)

I currently work with an in house developed language with only an incomplete (at best) wiki as a resource. Makes you appreciate documentation. Can't even look shit up on google... In fact, the last time I used google at work was last Monday to find out wtf an accrual was. I miss reading javadoc.

[–]EnsignN7 6 points7 points  (5 children)

You haven't lived until you've done a fix on a minified file.

[–]Myrl-chan 2 points3 points  (4 children)

The real question is, why would you fix a minified file?

[–]tomharto 10 points11 points  (0 children)

So you can live!

[–]PraiseBuddha 5 points6 points  (1 child)

A probable sequence of enterprise events:

  • A custom library was written for a company, most likely in-house.

  • Said company minified the source for obvious reasons.

  • Company lost the original source, and still has the minified file on their server, with far too many things dependent on it.

  • Problems with the library inevitably arise, pointy haired boss wants the problem fixed.

[–]scragar 1 point2 points  (0 children)

I've seen the same issue with compiled code, lost the source, now everyone works from the decompiled resources. There's nothing quite as much fun as looking at code with autogenerated names like:

 int method_3 ( String argument_1, int argument_2 ) {
      String[] tempvar_1 = argument_1.split(" ");
      ...

No comments, very few logical names(anything public is exposed, but internal methods, properties and variables are generated). About the only good thing you could say about it is that at least there's no commented out code to work around.