4 ms·
You're right, of course. I guess what I'm really longing for is ease-of-use and ease-of-setup. For ease-of-use, the default action is navigation (just like read
by coder5506 10y ago
You're right, of course. I guess what I'm really longing for is ease-of-use and ease-of-setup. For ease-of-use, the default action is navigation (just like reading a web page) so that I can drill-down and mentally execute code not unlike being in a debugger. For ease-of-setup, I don't necessarily want to clone something, create tag files, and possibly install a language mode... I just want to read.
Perhaps this seems a bit lazy, but I think of reading code as similar to reading books or articles: not everything is worth the same level of investment. Yes, some things I want to really get into, and get dirty running (or writing) tests, refactoring, and commenting. Other things I want to just (passively) read or even skim.
I feel like a full IDE, or the recommendations in the parent article, lean toward the in-depth study that I don't find appropriate for every task.
(It's been 20 years since I last used Visual Studio, so my understanding of its capabilities is obviously dated.)
- jlg23 10y ago> Perhaps this seems a bit lazy, but I think of reading code as similar to reading books or articles: not everything is worth the same level of investment. The point of reading code is to understand it. How to read code efficiently depends also on language and coding style. Which would require full blown IDEs just for proper code navigation. And honestly: If setting up an IDE for the language you want to read is too much trouble, programming is and therefore there is no need to read code at all. EDIT: When I review code that reads like a book, the programmer immediately makes into my hall of fame. Such code is so rare that its coders should be paid their weight in gold - per hour.
- pfranz 10y ago> The point of reading code is to understand it. There are varying levels of understanding (or desires to understand something). I use Python a lot. For a lot of the language and libraries my understanding is superficial; dicts have key/values, lists are ordered and mutable. As I use it more I'll dig more into specific parts as needed; how do lookups happen for a dict, how are lists allocated? If I downloaded cPython and read it top to bottom trying to understand everything I likely wouldn't retain those relevant parts I need. I also don't need to download and build all of cPython to answer most of those questions. Also, new projects get posted all of the time here. I'm curious about other languages and frameworks not because I need to know and understand everything, but I'm curious how I can approach something in a new way. It'd be nice to have a browsable interface on the web. Your argument here sounds like it would be against having syntax highlighting in anything that's not an IDE (like GitHub) because if you cared enough, just download it and open it in an IDE.
- jlg23 10y ago[deliberately responding out of order] > Your argument here sounds like it would be against having syntax highlighting No, but syntax highlighting is just something that helps parsing a single page. I'm talking about "show documentation for function/var/whatever under cursor", "jump to definition", etc... > There are varying levels of understanding (or desires to understand something). I use Python a lot. For a lot of the language and libraries my understanding is superficial; dicts have key/values, lists are ordered and mutable. As I use it more I'll dig .... That "digging" is what I am talking about. Code is rarely read sequentially; it's reading docs for functions/classes/vars, jumping to definitions and finding call-sites. To do this, you need a very good understanding of the target language by the "viewer"-tool. Thus: You need an IDE for proper code reading. And probably still a good grasp on /usr/bin/find for those things your IDE cannot help you with.
- pfranz 10y agoI still think I have different (lighter) needs when skimming code online. I do think an IDE would be the ideal solution. What I saw the parent looking for is a middle-ground, maybe you have something like VSCode, but cull out compilation, editing, and debugging to it loads more quickly. > That "digging" is what I am talking about. Those are examples I gave are where I don't need to navigate the codebase. The answer is in a single file. So far I manage with the current web interfaces. Locally, I'd use grep and vi. GitHub works ok, but it's hard (but possible) to compare versions or jump between files. Using Google Code or SourceForge I have trouble finding the "Browse" button to even find the code.