[HN Gopher] Become a Better Developer by Reading Source Code
       ___________________________________________________________________
        
       Become a Better Developer by Reading Source Code
        
       Author : 0x54MUR41
       Score  : 55 points
       Date   : 2020-02-08 14:05 UTC (8 hours ago)
        
 (HTM) web link (www.stevejgordon.co.uk)
 (TXT) w3m dump (www.stevejgordon.co.uk)
        
       | renox wrote:
       | I already _have_ to read source code by doing my team 's reviews,
       | and I don't enjoy it.
       | 
       | Maybe it's because of the responsibility (why didn't you caught
       | this bug in the review?), but it's really difficult.
        
       | swiley wrote:
       | Everyone should try and read busybox. It's a fairly complete
       | implementation of a normal "unix" user space without the libc.
       | Most commands are completely contained in files less than a few
       | thousand lines long and can be read through and completely
       | understood in an afternoon. I personally use it for most things
       | because of that even if some utilities are a little incomplete,
       | being able to double check the source easily makes me feel like I
       | won't get surprised.
        
         | thepete2 wrote:
         | Why not the GNU or BSD coreutils?
        
           | dastx wrote:
           | Presuming because they are significantly bigger compared to
           | busybox due to the limited feature set of busybox
        
         | dana321 wrote:
         | Had a quick look, found this little gem, a math evaluator with
         | precedence.
         | 
         | https://github.com/mirror/busybox/blob/master/shell/math.c
         | 
         | Some funny comments like "Think about it. * It makes sense."
        
       | thrower123 wrote:
       | Yes, it is great to read source code. One of the great things
       | about most things being on GitHub these days. Also great when you
       | can use decompilers (Java and .NET especially) to determine
       | exactly how the library code you use works.
       | 
       | One of my favorite exercises though is to port code from one
       | language to another. Reading the code gets you to one level of
       | understanding. Implementing it yourself while following along
       | gets you to another level. But translating it really gets you a
       | level of mastery of what the code is doing.
        
         | Ididntdothis wrote:
         | "Also great when you can use decompilers (Java and .NET
         | especially) to determine exactly how the library code you use
         | works."
         | 
         | Decompiling .NET and earlier reading leaked windows source code
         | have given me the revelation that the people working on these
         | systems are regular people like you and me. Somehow I thought
         | MS or Apple code was something special but it really wasn't.
         | 
         | But I agree: reading source code is good for learning and also
         | empathy. It's way too easy to look at a code base for five
         | minutes and declare this needs to be totally rewritten because
         | the previous devs wrote bad code
        
       | thepete2 wrote:
       | I want to read some good C code. Can anyone recommend me a
       | project that's not too big? I'm thinking of skimming some of
       | these core linux libraries [0]
       | 
       | [0] http://linuxfromscratch.org/lfs/view/stable-
       | systemd/chapter0...
        
         | dana321 wrote:
         | lmdb is one that comes off the top of my head.
         | 
         | But even that the main file is 11000+ lines of code.
        
       | hinkley wrote:
       | A big part of me wants Comparative Coding classes to be taught to
       | college students. Even though I have a pretty sad cautionary tale
       | about Comp Lit classes from a very good friend who went for an
       | English degree.
       | 
       | Some of the earliest conversations I recall were about the trap
       | of taking Comp Lit too seriously and not spending enough time on
       | the craft. Eventually your inner critic creates fear that your
       | work isn't good enough, and it becomes a self fulfilling
       | prophecy.
       | 
       | I spent the next decade watching helplessly as the inner critic
       | ate my friend's hopes and dreams one by one. In her head, she was
       | going to be a great fiction writer. But the only thing of hers I
       | ever remembered was her persuasive writing. She was passionate
       | about her causes, but somehow also had it in her head that this
       | wasn't 'real writing', and I didn't have the gravitas to convince
       | her she was wrong.
       | 
       | And so the sad fact is that if you look at what I've written and
       | shown to people, and what she's written and shown to people, it
       | would be charitable to say she's done three times as much as I
       | have, to an audience perhaps ten times as large. Me, who only
       | briefly wanted to be a writer in grade school, whose only
       | college-level English class was a technical writing class.
       | 
       | I am not a Writer, but I write. She is a Writer, and doesn't.
       | 
       | But even so, I've got body parts stuck in this same trap. I write
       | a lot less code that some other people. But I also work hard to
       | make sure that I'm on the right side of the Pareto principle.
       | It's not the lines that count but how you use them, or so I
       | reason. But I've started noticing the consequence of that choice,
       | and trying to find a new balance between quantity and quality.
       | Old habits die hard.
        
       | webdva wrote:
       | I synthesized a very small amount of programming ability and
       | skill from reading randomly chosen and scattered source files of
       | an open source Quake clone's source code (Digital Paintball 2),
       | even though its comprehension and understanding it was beyond my
       | capabilities at the time, especially at such a young and immature
       | age. That tiny amount was negligible, but it still functions
       | today as a segment of my present and current programming
       | knowledge infrastructure. So you can safely conclude that the
       | activity of reading "seemingly" insignificant programming source
       | code files is a future knowledge, capability, and understanding's
       | becoming-vital infrastructure. For what power does not have a
       | base or foundation to plant its feet upon?
        
       ___________________________________________________________________
       (page generated 2020-02-08 23:00 UTC)