I only program my side projects on the weekends, when I come back to the code I realize how poorly it's been written, especially if I've skipped a weekend. I'm really striving to make my code readable. A great book I read is "The Art of Readable Code", and while it focuses on code readability from a micro-level (making a small code sample readable), I find more knowledge is needed to make a program readable when reading it from start to finish.<p>The code I find most readable is imperative code that can be read line-by-line. I find abstractions hide away important knowledge of understanding completely how things work. Additionally I prefer reading algorithmic code than reading a bunch of helper functions that are at a level of indirection away from understanding the code at hand. For this reason I try to write in more imperative style instead of OOP or functional. But I find that programs I write that can be followed line by line end up having a lot of variables that make it hard to keep track of everything.<p>I've tried to look for other projects that can be read line by line easily but I haven't found one yet. I'll end up spending way to much time trying to figure out what helper objects, functions, or structs are doing and they require jumping to a bunch of other files while trying to keep in my head what I read previously.<p>It seems these 2 things are at odds with each other: readable code vs code that can be read and understood completely. I don't want algorithms hidden away but when they are right there in place with the other code it becomes too much.<p>Is completely readable code even possible? I've heard "abstract just barely as much as you need" or "just use right level of abstraction" but that doesn't give me anything concrete I can do. Is there a project that you know about that was large but very easy for a new person to read and understand completely? Do you know how to write code like that?<p>Any ideas are appreciated. Thanks!
I know there's a lot of code out there I cannot read and suspect we're hardly alone with that issue.<p>I comment my own code very heavily so I don't have to spend as much time studying it at a later date.<p>And I don't try to get too tricky either. I don't fret over converting a block of code into an obfuscated one liner. I avoid that instead.