4 ms·
Interesting that it specifies "speed reading". I think speed reading for code is actually an anti pattern since it is encouraging your biases and guesses instea
by anoncoward125 5y ago
Interesting that it specifies "speed reading". I think speed reading for code is actually an anti pattern since it is encouraging your biases and guesses instead of actually reading the damn output. If you ever wondered how people ended up programming stochastically and just making random changes I'd say speed reading is part of it
- oatmealsnap 5y agoI mean, there's a time and a place for speed reading. Part of being good at speed reading is identifying the areas you need to slow down for and pay attention to. Another aspect of writing code is to think about future speed readers. Can your code be skimmed and understood on a cursory level?
- quickthrower2 5y agoThe best code is the code that doesn’t need to be read at all. This takes a lot of skill in abstraction. For example code a “user data cache” with lots of user concerns and people will be reading that code a lot. Code a “generic cache” and test the hell out of it and it’ll never need to be read (or rarely) There will need to be code that deals with users but it can interact with the cache so where business logic ends and caching begins is obvious. Then repeat: how can you split the user code up into generic concepts? Users vs. roles vs. credentials?
- geitir 5y agoGood insight
- nathias 5y agoOf course it will have to be read, what makes you think you can guess what people will have to read? This seems such an anti-pattern, instead of writing readable code that lives inside the domain where its used, you make an unnecessary abstraction. This is exactly how redundant complexity gets made and you wind up with 16 abstraction layers where each is used just once and a completely unreadable mess.
- verinus 5y agothis. While it is important to separate concerns where applicable (might be user related functionality and caching) generalization most of the time just adds complexity.
- quickthrower2 5y agoThe advantage of good abstracting is you can unit test one layer and make it super solid, then build the next layer with less mental load. I am not advocating making “unnecessary” abstractions. I’m not even advocating abstracting from the get go: sometimes you need to see the messy to appreciate the abstracted. This is modulo all common sense trade offs!
- nathias 5y agoMaking things into units and making things in generalities is something very different. There is no such thing as a new introduction of a generality that would lessen the mental load in itself, it is both a source of bugs and an obstacle to reading but of course sometimes the tradeoffs are worth it. It just that your solution to reading seems to imply that generalization as such is helpful, and I think its the main cause of redundant complexity.
- derangedHorse 5y agoI think you're too stuck remembering the bad implementations of generality to understand what the original poster is saying. Something like a cache is general and most likely will need to be used in multiple places. If I have a user cache and an application cache, it wouldn't hurt to build both off a general cache. That way I don't have to understand two different cache implementations that are supposed to do the same thing. Now when a new cache implementation is made in a particular domain, there will be no need to review the code that does the caching since developers should already be familiar from working with it in the past. I don't see how it could be "both a source of bugs and an obstacle to reading" unless done improperly.
- criddell 5y agoFor me, speed reading is trusting that the comments are correct.
- meej 5y agoGiven that her research is heavily focused on how people learn how to program, I can't imagine that any recommendations she might have regarding speed reading code would not be informed by her research.
- LeonB 5y agoThis is not a very sound assumption. How we learn and the speed at which we read (how we chunk the information together - and how as an author we put together information to be readily chunkable) are very closely tied together. Edit: hold on! I think i got lost in the double-negatives, and I agree with you. :)
- droidist2 5y ago>I think speed reading for code is actually an anti pattern since it is encouraging your biases and guesses instead of actually reading the damn output. Right, reading twice as fast increases the "WTFs per minute" metric by 4x: 2x because you get through twice as much, and 2x because you understand half as much.
- jbluepolarbear 5y agoDisagree, I can only speed read. I have dyslexia and I can’t read “normally” I basically read in blocks. My brain does the rest.
- auggierose 5y agoThat can't work well for anything non-trivial to read. Ever tried going through a math book like that? Did it work?
- jbluepolarbear 5y agoIt does, but I will say that I had to learn how to block read math. So I couldn’t read until the 6th grade because of how bad my dyslexia is. I taught myself speed reading before I knew what it was (I called it block reading). I knew that my brain could recognize symbols and words without reading it so I took it to the extreme. I started glance reading; looking at the text and looking away and see what I comprehend. Eventually I was able to read whole sentences without reading each word or using a finger. I kept doing it so I could pass the reading comprehension tests in school. I got to the point where I could look at the page and flip it over and answer the questions. I wasn’t comprehending anything, I was just able to keep the entire image in my head and my brain gives me the answers. Kind of how it works for me know. I more absorb text than read it.
- auggierose 5y agoVery interesting. Sounds like how some machine-learning algorithms would work!
- pronik 5y agoSpeed reading is training your field of view. I would agree that speed reading code is not really useful (even though skimming code looking for interesting stuff is), but what is immensely useful is being able to notice changes on your screen in general. Did something go from green to orange in your IDE? Was there an interesting keyword in the logs flowing by? Did this icon just blink? Has this counter just gone up? I'm often astonished by the stuff people don't see on their screens when helping them debug something. Replying to "how did you know?!" by pointing to the edge of the screen where some small blob went from green to orange or to red is something that happens more often that I'd expect.