Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Deciphering programs

I have four programs, which are very good, it seems like i would need a comment on every line, i see a lot of variables and its been tough trying to figure out what they stand for. Is there any place on the internet where i can upload the program and get a genius to add comments until i get good enough to decode them myself ? Does anyone have any suggestions ?..

Comments

  • edited November 1 Posts: 744

    Go here find bad samples of noobs like me and try to understand what the user tried to write. I’ll give you links in a moment:

    Edit:
    https://codea.io/talk/discussion/7043/moved-to-general-tokouts-cool-work
    https://codea.io/talk/discussion/7136/tokouts-collection
    https://codea.io/talk/discussion/7731/mine-field-version-1-0-1-alpha
    https://codea.io/talk/discussion/8690/cc-documents [Forgotten Topic]

    Project which topic died:
    https://github.com/TokOut/InOneClass/tree/master/Win5

    I hope that’s what you asked for :P

  • dave1707dave1707 Mod
    edited November 1 Posts: 6,325

    @kendog400 I have a suggestion, try doing it yourself. Yes, it will be hard in the beginning, but after awhile it will get easier. If you don’t try, you’ll never learn how to do it yourself. Not everyone puts comments in their code, me included.

    PS. Commenting a program isn’t fun. Commenting someone else’s program is even less fun.

  • Posts: 57

    I've been trying to figure out what the variables are in the programs...
    I been putting comments in myself, it hasen't been easy...I would like to show 1 segment of the program, and point to a variable...

  • dave1707dave1707 Mod
    Posts: 6,325

    @kendog400 If you want to show a section of code you’re having trouble with, I’m sure you’ll get plenty of help. But to comment a small section of code without seeing how that section relates to the whole program might be hard.

  • Posts: 57

    I think I have an idea : How bout I put comments on every line, and then someone tells me where I'm wrong ? I like to put comments in red, so its easy to see its a comment, but I dont see a way to change the text color on the fourm. Which is ok, since I like to be greatful for what little (or alot) I get...

  • Posts: 553
    @kendog400 I have to agree with @dave1707: I strongly recommend doing this yourself.

    Although I might differ from him in regards to commenting other people’s code. I find it enjoyable inasmuch as it is like putting together a puzzle, having to figure out what this single-letter variable name does as opposed to that other single-letter variable name.

    I will try to summarize how I tackle the problem:

    - first I look for anything I *do* understand, and start with a comment marking it off
    - then I take the variable names in that code and turn them into understandable names, so for example “s” might become “stringsForTouches” or something like that
    - then I search out all the other places “s” is referenced and replace them with the clearer name
    - sometimes that has a cascade effect, where understanding the variable in one area helps me understand a variable in another area, and then I rename the other variable, and it leads me somewhere else, etc etc. when this happens it is very helpful
    - when I understand a section of code I try to pull it out of where it sits and turn it into a single function that can be called from the place it used to be. So for example if there was a loop that iterated over the variable “s” to extract any strings that began with “the”, I would turn it into a function like “function extractStringsStartingWithThe(stringsToExamine)”
    - doing this bit by bit can be painstaking but gradually the code comes into focus, and that is extremely rewarding.
Sign In or Register to comment.