Live data from Hacker News

Ask HN: Where do I find good code to read?

news.ycombinator.com

21–30 of 216 posts

Re: Ask HN: Where do I find good code to read?

#21
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

Separately, if you won’t be dissuaded from this pursuit, check out redis.

Re: Ask HN: Where do I find good code to read?

#22
I'll shoot with two examples:

(Tooting my own horn) A Fitbit watchface that I wrote a few years back: https://github.com/GWBasic/Binaryish-Clock

An event/threading library for C#. I keep a fork in my Github because the original source was archived: https://github.com/GWBasic/retlang

Note that both examples are "functionally obsolete." The Fitbit studio environment is deprecated in favor of Android Watch; and if you're using C#, you can should be using Tasks to get similar functionality to Retlang.

Re: Ask HN: Where do I find good code to read?

#23
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

So much this. Good code is code that delivers business value.

Also, good code is code that respect constraints and objectives from test suites

Re: Ask HN: Where do I find good code to read?

#24
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

Taken at face value, this advice is probably just as bad as the opposite ("write perfect extensible modular code with 100% documentation and test coverage"). There is a lot of room in between where the enlightened developer can find happiness.

Re: Ask HN: Where do I find good code to read?

#26
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

So much this. Good code is code that delivers business value.

I would amend this just to “delivers value”.

Re: Ask HN: Where do I find good code to read?

#27
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

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 and maintain it.

Re: Ask HN: Where do I find good code to read?

#28
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

So much this. Good code is code that delivers business value.

Where business value has a time dimension.

Re: Ask HN: Where do I find good code to read?

#29
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

In general agree with the sentiment not to obsess over perfection, but not sure it’s great advice for someone looking for code to read and understand.

Re: Ask HN: Where do I find good code to read?

#30
post #17

Give up on “good code”. Its pursuit is how junior devs pesters senior devs based on a delusion that such a thing is possible. Good code is working code, code that pays the bills. Focus instead on writing code you can throw away easily, code that you are wholly unattached to and is isolated enough that rewriting it won’t cost absurd hours.

I would say a take on this is good code is code that is worse than the next code you write. Don't pursue perfection, pursue improvement over time. Make things work but learn new stuff that makes your old stuff look foolish. Improvement is more important than perfection.
Post reply on HN