52
Tamirse
7y

30,000 lines of undocumented code. How do I deal with that?

Comments
  • 6
    Fast lol
  • 10
    Try to find the main players. Look at what the end program does, break it down into functional chunks, then do a lot of Ctrl + F ing and breakpointing to find those chunks. Mark them immediately so you don't lose them. Pay attention to vars, params, and functions that pop up repeatedly.

    There are also tools available to help with this sort of thing.

    https://sourcetrail.com/blog/...
  • 16
    Of course all undocumented code ist SELF-DOCUMENTING!

    It must be a masterpiece.
  • 24
    Ctrl + A
    Delete
    Commit
    Push
  • 2
    Marry your code!
  • 0
    Some kind of static analysis?
  • 2
    What is your job with that code?
  • 0
    Single step it with a debugger and add documentation as you do
  • 5
    Email original dev if you can for a brain dump
  • 0
    SHIFT + DEL while code folder is selected.
    Thank me later.
  • 0
    Delete everything 😈😈
  • 5
    Well that's my 2 pennies:
    a. find the main entry points to the application: API, UI (web/desktop), unit/functional/integration tests.
    b. debug the main flows that you want to understand.
    c. comment strange shit for later ref.
    d. write unit/functional tests and refactor the most shitty parts, be sure to cover the code/flows you touch to ensure you don't fuck up.
    e. fund people.of reference using blame and history of your SCM that might still be around and ask for a crash course if possible.
  • 1
    Kill it, kill it with fire! 🔥 🔥
  • 3
    Step 1) Pray code is well written

    Step 2) Confirm dark fear of code being an absolute clusterfuck

    Step 3) Get a big ass paper and draw the components and the program flow to get a bird's eye view and then read each file for specifics.
  • 0
    With fire.
    Copious accounts of fire.
  • 1
    Have you tried turning it off and on again?
  • 0
    @chadd17 neat, now I need it for python, that would be great
  • 0
    That's just one class of the 1000s in our legacy project ^^ none of them documented 😅

    Don't have any good advice 'tho 😕

    Burn it with fire?
  • 0
    @CWins 1. Add comments as you make changes and/or research code to figure out how to make changes. 2. Place any special information in a document in a document in the format of your choice so other people can read it. 3. Be very patient.
Add Comment