Live data from Hacker News

What was the nicest codebase you've inherited without the original author(s)?

news.ycombinator.com

11–20 of 74 posts

Re: What was the nicest codebase you've inherited without the original author(s)?

#11
I inherited a popular open source charting library. People like it because it has a data model - you can automatically brush and filter between charts.

It is intentionally a leaky abstraction so that there is always a way to customize it if it doesn't work the way you want.

There is only enough design to make it reusable, no claim to a "grammar" or other highfalutin abstractions.

There have been dozens of contributors and many parts are inconsistent.

Yet it still gets a ton of use 7 years on because it does 80-90% of what you want.

I've learned so much from this. Worse is better. Don't box yourself in with designs you don't understand.

Solve one big problem and after that be humble and let users work around anything you didn't think of.

Re: What was the nicest codebase you've inherited without the original author(s)?

#12

My current works codebase. I've never seemed to like other peoples code. Not even my own after 1 month But this code is very good. I would attribute it to the strong set of rules and design patterns everyone follows. All code/services are broken up into `unit` which all follow the same pattern, of how it's called, how the code is arranged etc. This means there is no ambiguity for any new starters trying to contribute…

> In addition to that our linter doesn't allow you to push code if it detects any errors.

I just added a couple of linters to a new project and am looking forward to having the computer flag any obvious errors before allowing a git commit.

Re: What was the nicest codebase you've inherited without the original author(s)?

#13
Well, I'm only a lowly WordPress developer, but I'll say that most WordPress plugins are a PITA to extend the functionality of, but that the WP Store Locator plugin was very nice to work with. Just sensibly implemented object-oriented programming and extensive use of WordPress hooks.

Re: What was the nicest codebase you've inherited without the original author(s)?

#15
post #9
post #8

Earlier quoted context omitted.

Wow, that's some wisdom right there :) +1. Whole new meaning to "best code is the one that doesn't exist".

There's a talk by Greg Young regarding this topic called "The art of destroying software" [1]. It's a fairly interesting talk about designing your software with deletion in mind. [1] https://vimeo.com/108441214

It may be a good message, but it's so hard to take it through such a condescending and off-putting way of delivering.

Re: What was the nicest codebase you've inherited without the original author(s)?

#16
I haven't inherited it but the C source of the simple terminal st is really really clean and good: https://st.suckless.org/

I highly recommend it, it's only a couple thousand lines so it's worth the read. Never before have I seen such readable and clean C code. I read it and then implemented my own terminal emulator from scratch, which we now use on an embedded platform at work to debug problems that cannot be debugged using a PC (for example because Ethernet and serial connections to the device are broken).

Re: What was the nicest codebase you've inherited without the original author(s)?

#17
I inherited an internal tool from someone who left the company. They weren't a software developer. Everything had comments (not function comments/XML headers), behavior comments. Some were "someone who knows how to code should clean this up", "I want to do x but couldn't figure it out, this is close". It lacked clear abstractions, it was mostly one file. It wasn't even in a repository. The program was however purpose built for use by the developer, and people in a similar role at the company.

The team who was supposed own it hated it, so I get to work on it :)

Re: What was the nicest codebase you've inherited without the original author(s)?

#20
People who inherit code will always complain about something as that's just the nature of it. But often those complaints are more to do with the inheritor not understanding the intent. Code comments in those cases should describe the underlying design decisions or there should be thorough documentation of the design that explains it.
Post reply on HN