Live data from Hacker News

Ask HN: What's the best source code you've read?

news.ycombinator.com

251–260 of 271 posts

Re: Ask HN: What's the best source code you've read?

#251

Earlier quoted context omitted.

Me but with Flask and its cohorts like Werkzeug. I always found the amount of security advisories with Django vs that to be something alarming. I might still use it once in a while for something like prototyping. Python is easy to write but writing it "right", in a way that doesn't compromise performance, is a thing.

You get CVE’s inside Django because it’s a large and widely used target, and because in Flask, FastAPI, etc. you end up implementing a lot more stuff yourself instead of using built in things. That doesn’t necessarily mean your code is more secure!

It ups your chances. I try and choose small, well-written libraries to work with in everything I do. Too many batteries included and they start to leak eventually.

Re: Ask HN: What's the best source code you've read?

#252
post #247

Earlier quoted context omitted.

With the sorry state of latex engine error messages and the version number still approximating pi, e, something, it is no longer an ideal to me. It represents stagnation. Being bug-free may be good, but at some point feature development is needed. (I know TeX and LaTeX are not the same)

There are some serious legacy issues with the LaTeX ecosystem. The lack of being able to version individual package dependencies for a document is a huge one. You’re at the mercy of lots of independent packages which often have complex webs of interdependency. Probably the biggest mistake was the choice to abandon the idea of having a LaTeX 3 version with its implicit breaking of backwards compatibility. Backwards co…

Best of luck

Re: Ask HN: What's the best source code you've read?

#254

The Smalltalk-80 core classes. Some parts left me breathless on first reading in their beautiful simplicity, and some burnt permanently into my brain. Class Boolean, for example. I could probably reproduce it exactly now after not looking at it for decades.

I second that. Smalltalk-80 classes source code is an excellent reference to learning pure OOP style. https://github.com/dbanay/Smalltalk/blob/master/files/Smallt...

Re: Ask HN: What's the best source code you've read?

#255
Last summer, I followed the step by step code in Crafting Interpreters by Robert Nordstrom (https://craftinginterpreters.com).

Beautiful c code. As a 30+ year programmer, one new thing really stuck with me. He wrote all comments as sentences: first letter capital, finish with a “.”.

Re: Ask HN: What's the best source code you've read?

#257

Earlier quoted context omitted.

> We're working on this, albeit slowly. tsserver's implementation predates LSP so it's nontrivial work to move forward in a way that doesn't adversely affect old clients or result in code duplication.

Good to hear you're still committed. By "not a priority" I mean we have been waiting since this was published back in 2016: "[LSP] also means any developer can have a consistent editing experience for their favorite programming language on any tool – even if that tool isn’t VS Code." https://code.visualstudio.com/blogs/2016/06/27/common-langua... The original bug against Typescript was opened in 2016 as well: https:/…

Note I merely quoted from the above Github ticket. :)

Re: Ask HN: What's the best source code you've read?

#258
post #204
post #154

Earlier quoted context omitted.

Pedantic note, which I'm writing just in case anyone misunderstands your recommendation: "The TeXbook" is the user manual for TeX. It is not the same thing as the book containing the (literate-program) source code for TeX, which is called "TeX: the program". (Both are excellent, but in quite different ways, and someone looking for interesting code to read would likely be disappointed by the TeXbook, which doesn't con…

You’re right! I had to go pull my copy off the shelf and check, but it really is TeX: The Program.

Make sure to check out the dedication!

Re: Ask HN: What's the best source code you've read?

#259

cperciva writes easily the most approachable, understandable code I’ve ever come across, e.g.: https://github.com/tarsnap/kivaloo

Thanks! I think kivaloo and spiped are probably the best quality code I've ever written.

Sure thing - I personally have ~zero use case for kivaloo, just came across it on here awhile ago and have basically been waiting for this Ask HN to pop up ever since:

https://news.ycombinator.com/item?id=24548103

Re: Ask HN: What's the best source code you've read?

#260

Earlier quoted context omitted.

Good to hear you're still committed. By "not a priority" I mean we have been waiting since this was published back in 2016: "[LSP] also means any developer can have a consistent editing experience for their favorite programming language on any tool – even if that tool isn’t VS Code." https://code.visualstudio.com/blogs/2016/06/27/common-langua... The original bug against Typescript was opened in 2016 as well: https:/…

Note I merely quoted from the above Github ticket. :)

I see. In that case, possibly replace "you" with "they" in my reply.
Post reply on HN