3
mw108
22d

I'm working on a project that uses a 3rd party library. We've got the source code to that library and I'm exploring its code, looking to find out how the author did something. I just discovered a Paint function that has over 7,000 lines of code, with nested sub routines, awful indentations and line spacings and lots of IFDEF conditions ... Wow, I'm amazed that this thing works at all and I'm wondering how the author is even able to maintain that code.

Comments
  • 3
    This is typical for beginners in programming.

    The code of my first game was like that.

    I‘m surprised that your company is using a lib which is apparently written by a rookie 😄
  • 3
    @Lensflare Yes, isn't it? But he doesn't seem to be a rookie. The library works fine and fast, there are no weird bugs or issues so far. The support from him is nice and responsive. The lib is on the market since 2001 and even has won some awards. Don't know what happened here. I guess the code is as old as the library itself.
  • 1
    Unfortunately from an auditor's point of view, "some-library": "1.2.3" is one very clear and simple line of code, whereas if you wrote the functionality yourself that would be hundred of potentially complicated lines.

    Now you may be tempted to say "in that case the auditor is a retard", and you would be correct, but if you say that then the auditor will go through everything you're working on like a dose of the clap.

    Obligatory mention of leftpad.
  • 2
    @donkulator Yup and the manager being afraid "to waste effort"/don't re-invent the wheel even when the lib is a buggy piece of shit (yes I'm still salty about it filling sentry/slack with errors)
  • 2
    @whimsical to be fair, in most cases we use libs not because we can’t write the code ourselves but because we don’t want to.

    And most libs don’t try to keep their code secret anyway.
  • 1
    @whimsical I do. Just a rough look of course, it's why I'm so annoyed about that broken lib since I said it's shit but noooooo
Add Comment