Ask HN: What code do you frequently read?
51–60 of 64 posts
Re: Ask HN: What code do you frequently read?
#52Also, Magento 2's code is beautiful, despite it's written in PHP :)
Re: Ask HN: What code do you frequently read?
#53I like looking at OdinMS's source for nostalgia.
Re: Ask HN: What code do you frequently read?
#54Aaron Swartz thought we should read djb's code: http://www.aaronsw.com/weblog/djb I haven't gotten to it yet, but hope to!
Re: Ask HN: What code do you frequently read?
#55Reading the Quake stuff is doubly enjoyable thanks to Fabien Sanglard's excellent Code Review series: http://fabiensanglard.net/quake3/ (he's also done them for many (all?) of the other open sourced id games.
Re: Ask HN: What code do you frequently read?
#56I really love the clean code the decompiler gives you, compared to packed JavaScript which is just a pain to read for a human.
Re: Ask HN: What code do you frequently read?
#57Re: Ask HN: What code do you frequently read?
#58Re: Ask HN: What code do you frequently read?
#59Re: Ask HN: What code do you frequently read?
#60Golang stdlib is an excellent reference for how to write idiomatic Go code https://github.com/golang/go/tree/master/src
https://github.com/golang/go/blob/master/src/strings/reader....
Some questions that come to me when looking at that code:
- In general, why is everything abbreviated? Storage isn't an issue and IDEs solve the typing problem. It feels really old school. Plus you lose a lot of meaning throughout the code (r.prevRune is actually an index, so why not reader.previousRuneIndex, or at least r.prevRuneIdx)
- What is int64? A cast? Why would you need to cast what appears to already be an int?
- what is a Rune? Why are we setting it to -1? -1 just seems like a special number that would make this more readable as a constant with a relevant name.
- Where does copy come from? why does it appear to work backwards compared to any other language array copy implementation?
- Why does the last return statement return nothing?
I'm not here to start a language war, I truly believe it is my inability to see the forest for the trees, but I find Go code to be hard to read and understand.