3 ms·
It isn't necessarily analogous to compare the study of writing in college to that of learning to program. For one, by the time you are in college, you have been
by DarkTree 10y ago
It isn't necessarily analogous to compare the study of writing in college to that of learning to program. For one, by the time you are in college, you have been speaking, reading, and analyzing (via communication) your native language for ~15 years. Because we already have such a vast foundation to work from, we can venture into deeper parts of the language and meaning and interpreting how authors use it to create meaning.
I think programming is more analogous to learning a new language. Now I can imagine studying Spanish (a non-native language for me) without reading a ton of books, and analyzing and critiquing other Spanish writers, because I simply can't and it isn't that beneficial - from the beginning - to start that without have some foundation to work from. It is only after you learn some vocabulary, grammar, semantics, sentence structure and some cultural significance, that you venture into analyzing and critiquing their writing.
I think for beginner programmers, it isn't supremely beneficial to read a bunch of others code, because you don't really know what is good and what isn't or even what to really look for. However, when a programmer creeps into the intermediate level of things, I think reading other's code becomes amazing beneficial, because from that foundation, you can understand, analyze, critique, and maybe most importantly, internalize what that programmer is really trying to achieve and how you can use their methods going forward.
Now in reality, we don't really know the point we hit that intermediate level, and we will inevitably be reading other's code at the beginner level. I think it's just a matter of shifting the weight that we put on reading other's code as we mature as programmers.
- tibbon 10y agoThe other side to it is that you'll rarely be writing completely new code from scratch in the majority of development positions (especially as a new developer). Being able to dive into someone else's code, think about it, an add something to it, is probably more important on a day-to-day basis than being able to create something from scratch.
- grey-area 10y agoI think programming is more analogous to learning a new language. I think your analogy is spot on, and yet reinforces the OP's point - one of the best ways to learn a new language is to read a lot of good writing in that language - you absorb idioms, subtle points of grammar, and vocabulary, all of which would be a struggle if you just try to focus on the basics or use a grammar textbook to help. Immersion in the right environment is by far the best way to learn. The current situation with most people programming is that they spend years looking at code written by other beginners (stackoverflow, tutorial articles), and very little time studying real production code written by people who have been doing it for a long time. That is as the OP points out a huge mistake and one it takes many people decades to remedy if they ever do. It's like trying to learn a language by putting 30 beginners in a room with a textbook and making them speak to each other. I'd honestly recommend absolute beginners to spend at least some time reading simple code by someone they admire, if only to demistify the process, and make them realise it is not as complex as they fear. Beginners almost never do this though.
- tracker1 10y agoHowever, it's not really a story you can read through end to end so often as a choose your own adventure with thousands of routes to move through. Though there are smaller projects you can work through and better, or less organized structures... it depends.
- noshbrinken 10y agoReading code becomes beneficial at the moment your biggest concern is no longer "does the application work?" but "how does the application work?" I ceased to be a beginner when I became confidant that I could make something work. My concerns ceased to be "can I make this work?" and became "is there a better way to make this work?" Confidence to answer the former question is gained through writing code. Understanding to answer the latter question is gained through reading code.