Skip to content

Instantly share code, notes, and snippets.

@modocache
Created January 19, 2017 16:34
Show Gist options
  • Save modocache/abac532468cdcfad2eb7d960591265e0 to your computer and use it in GitHub Desktop.
Save modocache/abac532468cdcfad2eb7d960591265e0 to your computer and use it in GitHub Desktop.

I've been reading a lot of C++ code in the Swift and LLVM codebases recently. Some of the class declarations span thousands of lines of source code, with many nested class declarations. There are also multiple sections marked protected: -- in other words, not all protected methods can be found in a single place. Example: swift::Decl, which is ~700 LoC.

Experienced C++ coders:

  1. Is this a good way to organize C++ code? Or would it be more ideal if these declarations were broken down more? Why?
  2. Is there an easy way to determine, for example, whether swift::Decl is an abstract class? With 600 LoC and several layers of nesting, it's easy for me to get lost when scrolling through the code in Vim. Is this why people use IDEs?
@modocache
Copy link
Author

Awesome, thank you! I'll definitely read that book.

I had been using YouCompleteMe for Vim, but I didn't find it that useful. Sounds like I should give it another try. Thanks! 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment