“By reading the entire source code in a single file, you have global knowledge of the entire codebase.” (comment)
recommended by 1 user | 2020 | sillysaurusx on: Ask HN: How do you learn new libraries without much… | learning to code | original thread |
sillysaurusx on Jul 11, 2020 | on: Ask HN: How do you learn new libraries without much documentation? | view on HN

1. learn a good editor.

2. write a script to concatenate all the code files in a folder, separated by filenames.

3. pipe that result to your editor.

4. use your editor's "find" functionality.

By reading the entire source code in a single file, you have global knowledge of the entire codebase. All the information is available to you. I suggest you try it before dismissing the idea, as I once did.

https://github.com/shawwn/scrap is what I use. `codefiles | grep js$ | xargs merge | ft js` will open all javascript codefiles in vim, in JS mode. `cppfiles | xargs merge | ft cpp` will open all C++ files in vim, in C++ mode.

Free yourself from the loop of asking other people for answers. Stop that. Read code.

If you limit yourself to "projects that have good documentation," you'll miss out on 90% of the interesting code in the world.

One user recommended this comment. What they said:
rl3 Aug 15, 2020 | on: Brain Oriented Programming | context

This is where data-oriented design really shines, without even considering the excellent performance. It affords a purity in design very similar to what's achievable with functional programming. Granted, what you describe very much sounds data-oriented, with the exception of a high degree of coupling, and that would squarely place it in OOP territory.

>The experience was me slowly going insane from the sheer amount of jumping around files and the need to keep in my head 30 different strongly-typed aliases to std::string.

As for that problem, I've been meaning to try this person's approach since I'm pretty sure they're a genius ever since reading it.[0]

Likewise doing a projects in a small number of giant files can be beautiful. Sokol exemplifies this.[1]

[0] https://news.ycombinator.com/item?id=23800729

[1] https://github.com/floooh/sokol/blob/master/sokol_gfx.h