Earlier quoted context omitted.
I disagree. The problem with believing that "good code" is good enough to deliver business value is short-sighted. Good code is highly maintainable so that you can continue to meet business objectives in a timely manner without regressions. Often this means (ironically) taking a little bit of extra time early on to think about how to make your code readable and "simple enough" for someone else to be able to jump in a…
"maintainable" code is disposable. Modern web stacks are built on the idea that you can delete a file and re-implement its interface with a different service behind it later on. Instead of writing code which will be easy to modify, write a good interface which solves your problems in a way that's easy to reason about, and feel free to write garbage implementations that will get "refactored" (thrown away) every year o…
Ask HN: Where do I find good code to read?
141–150 of 216 posts
Re: Ask HN: Where do I find good code to read?
#142Re: Ask HN: Where do I find good code to read?
#143Earlier quoted context omitted.
"Ask HN: What's the best source code you've read?" https://news.ycombinator.com/item?id=32793534
It's worth clicking for the top post.
Beast mode. This is a great way to understand more about how the high level code we write actually performs. I learned the basics of compilers long ago but never though to apply it in this way, where you can have a reference implementation against which to test an assembly rewrite. Very cool!
Re: Ask HN: Where do I find good code to read?
#144You would hopefully find that the most compelling aspect of well-designed software systems is the data. In "data-driven" applications, 100% of the application state and configuration can be made to live in a database somewhere. In these scenarios, seeking code examples is not going to tell you much of anything.
My advice is to look at a bunch of SQL schemas (ideally, ones you know to be under successful products) and compare them to the problem area they support. Think about how you would answer questions a reasonable person might ask of that business by way of a query. Then, consider how much code you just now did not write to answer a realistic business problem.
Relational modeling can eliminate entire repositories worth of bullshit code that should have never existed in the first place. Do you want to train yourself to rely upon something that a true wizard can walk in and disaparate at the snap of his fingers?
Re: Ask HN: Where do I find good code to read?
#145Peter Norvig's Pytudes was recently posted here. I think that's some of the best code I've read, although they're only small problems and not a bigger project. Still very much worth a read, he goes through the whole problem solving through code process. https://github.com/norvig/pytudes
That's very interesting. I found his code to be unreadable
That makes me think of parmesan cheese -- "params" would be a better fit.
Re: Ask HN: Where do I find good code to read?
#146Re: Ask HN: Where do I find good code to read?
#147https://github.com/grantjenks/python-sortedcontainers/blob/m...
Re: Ask HN: Where do I find good code to read?
#148I think reading code itself is only valuable when you need to explore a specific domain. Trying to extract coding patterns from an unfamiliar domain very difficult; it comes with unseeable assumptions.
Re: Ask HN: Where do I find good code to read?
#149Most code is bad, so I think it would help to find some bad code to read
Re: Ask HN: Where do I find good code to read?
#150* Protocol implementations(e.g. TCP, HTTP, MIDI)
* Smaller compilers(PUC-Rio Lua, Forth-80)
* Commercial video game sources [0]
When studying protocols, you can compare apples-to-apples because the protocol has to work the same way by design, but the implementation can vary. With compilers, you're getting a look into programming in its maximally symbolic form - and every strategy a compiler uses is one you can directly apply to abstract your own code. And commercial video games have another mode of apples-to-apples in that the original release - the dirty, meets-deadline stuff - often can be compared with fan remakes and patches, which have the luxury of an exact specification and no deadlines. To actually ship in industry, you have to accept and know good dirty code hacks, but it's worth comparing them to their counterparts.
[0] https://en.m.wikipedia.org/wiki/List_of_commercial_video_gam...