4 ms·
To answer my own questions about the intended use for "Code Browser", see: http://tibleiz.net/code-browser/tips.html http://tibleiz.net/code-browser/tips.html
by nicklaf 12y ago
To answer my own questions about the intended use for "Code Browser", see:
http://tibleiz.net/code-browser/tips.html http://tibleiz.net/code-browser/tips.html
Understanding existing source code
Code Browser can help you to understand existing source code.
There is a lot of tools dedicated to program understanding that will do the job better than Code Browser, but if the source code is written in a too obscure language or too old, it can be a cheap alternative.
Here is some tips to make more sense of a flat text file by extracting a structure and reducing its apparent complexity:
- nicklaf 12y agoAnother text editor that treats text as having no grammatical structure (it doesn't even do syntax highlighting), but nevertheless attempts to give the user some really snazzy shortcuts--not keyboard shortcuts, but mouse shortcuts--is Acme[1]. In fact, years ago, I'd contemplated adding text folding to Acme by adding another chord. I don't exactly remember what I had in mind, but one approach that immediately comes to mind now is to have the chord cut the selected text, and then insert in its place a shorter block of predefined text which starts with the name of an rc script to create a file[2] representing a new "fold" containing the cut text, and positioning the cursor immediately after the command. The user would immediately type a name for the fold, and middle click the whole string to execute the script with the name as its argument, thereby creating the fold. Finally, the selected command just executed should be replaced simply with the name of the fold, which should then be selected, so that the user would now be only a right click away from immediately unfolding the text. I think the reason I never got around to doing it was that it seemed that this kind of feature really begs for acme to follow the names of the synthetic files representing the "folds" as files themselves to be opened (via right click, which always opens a file in acme), but at the same time, not literally open the file, instead unfolding it. Writing this comment makes me think now that it wouldn't be so hard to get the semantics of the synthetic "folding" filesystem right, so that Acme remains simply a text editor with a few conventions for working with files, with the "fold" synthetic filesystem doing the work to preserve this simple worldview. What actually concerns me more is the kind of code that would require you to fold it! If need to fold a significant amount of code in order to make sense of your source code, perhaps you would be better if if actually reorganized your project's file structure, and not rely on fancy text editor features as a crutch. [1] http://acme.cat-v.org/ http://acme.cat-v.org/ [2] Of course this feature would use a filesystem to manage the code folds! It's a Plan 9 program, after all.