7 ms·
Perhaps I'm jaded, but I notice that all the examples given here are developer tools or otherwise things with well scoped functional inputs and outputs (e.g. ff
by tschwimmer 7y ago
Perhaps I'm jaded, but I notice that all the examples given here are developer tools or otherwise things with well scoped functional inputs and outputs (e.g. ffmpeg).
Anyone have an example of a consumer application that has a good codebase? Chromium, GitLab, OpenOffice, etc? I feel like such applications inherently have more spaghetti because the human problems they're aiming to solve are less concretly scoped. Even something as simple as "Take the data from this form and send it to the project manager" ends up being insanely complex and nitpicky. In what format should the data be sent? How do we know who the project manager is? Via what format should the data be sent? How should we notify the project manager? When should we send the report? Some of these decisions are inherently inelegant, so I feel like you get inelegant code.
- aidos 7y agoI actually find Chromium to be a lot more approachable than I assumed it would be. Have only really checked out the layout / graphics part of Blink, but it’s laid out pretty intuitively. But yeah, Postgres also gets my vote. I guess there’s a bit of a bias there because devs are likely to read the code of the tools they use; either to track downs bug or just to understand how it works.
- inlined 7y agoYeah. I was amazed to find out it was designed so flexibly to inject C++ backed JS objects (eg write a request function which added requests to a queue after certain lengths based on multi-tenant fairness). Clients couldn’t circumvent because system code wasn’t necessarily in JS user space.
- westoncb 7y agoIt seems like that's how this question is always answered. I'd also be interested to see some good application code. Also curious about some good, not too hugely sized, game code (preferably something not written in C/C++, maybe like an indie game from the past decade or so). Anyone know something?
- tschwimmer 7y agoI almost feel like game code is a counter example. Unless you're making a massively multiplayer game, the code is throwaway because once you ship development effectively stops (or is limited for bugfixes and dlc). Would be interesting to see what the LoL or Warcraft codebase looks like though.
- mehrdadn 7y agoFor C, how about ReactOS?
- dudus 7y agoRedis would probably be better.
- mehrdadn 7y agoAny chance you could elaborate? How/why?
- chimpburger 7y agoRedis is widely used in production environments. The code quality matters.
- mehrdadn 7y ago> Redis is widely used in production environments. The code quality matters. That's how you judge source code quality? By measuring its popularity? And ignoring the actual code?
- chimpburger 7y agoThat's not what I said.
- orneryostrich 7y ago
- sharkjacobs 7y agoThe latest version of NetNewsWire is a nice example of a modern MacOS application codebase. https://github.com/brentsimmons/NetNewsWire https://github.com/brentsimmons/NetNewsWire
- slondr 7y agoNetHack's source code is absolutely beautiful. It's probably the most well-kept, well-designed, well-structured and well-implemented K&R C program in history. Although they are switching to ANSI syntax soon. It's even more amazing because NetHack is (1) a video game, where generally speaking code quality is sacrificed for efficiency, and (2) it has been developed by a constantly changing team of volunteers over the course of over thirty years, and there still isn't any spaghetti.
- philsnow 7y agoNethack suffers somewhat because the era in which it was birthed required a lot of portability, so there is a ton of #ifdef-ery which can be difficult to reason about. #ifdefs are themselves spaghetti; windows.c [0a] and files.c [0b] have tons of platform-related ifdefs (but, mercifully, not too much nesting), hacklib.c [1] has some deep-ish ifdef nesting (though, again mercifully, well commented) Ok on re-reading some of this, I guess it was worse in my mind than it actually is. Nethack was the first large codebase I ever made any changes to and tried to understand, so maybe the relative enormity at the time made a negative impression. Check out the source for Brogue [2] for what I consider to be pretty readable game code. [0a] https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/windows.c https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/wind... [0b] https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/files.c https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/file... [1] https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/hacklib.c#L865-L895 https://github.com/NetHack/NetHack/blob/NetHack-3.6/src/hack... [2] https://sites.google.com/site/broguegame/ https://sites.google.com/site/broguegame/
- myth_drannon 7y agoI bet they didn't have sprints and OKR like increasing the number of active users by 50% in one quarter. Nethack is a product of love to rogues and hobby software development.
- mikekchar 7y agoI have to agree with that. I once decided to hack in the "Drunken Master" after the Jackie Chan film. If you are a martial arts master, then every booze potion you drink increases your attack and your defence (thought you still walk around mostly randomly). If you drink too many (I forget how many it was), then you fall asleep. I also added a fortune cookie that said, "A boat floats in water, but sinks in it too". I think it took me a couple of hours to go from never having seen the code base before to completing the hack. Really lovely stuff. Unfortunately, I don't have the code any more, but if anyone wanted to add it, it's easy ;-)
- wp381640 7y agoIt shouldn't be a surprise that developers are more likely to read and understand the source code of development tools
- laumars 7y agosqlite is the usual example of elegant code in a domain that often breads inelegant code.
- christophilus 7y agoIt’s just a demo app, but I find the ClojureScript re-frame implementation of the real world app to be the cleanest of the bunch: https://github.com/gothinkster/realworld/blob/master/README.md https://github.com/gothinkster/realworld/blob/master/README....
- bamboozled 7y agoI think everything from Hashicorp is absolutely top-notch, working on their stuff taught me to be a much better Ruby and Go programmer.
- smt88 7y agoI'm honestly surprised to see Hashicorp mentioned here, not because I've read their code, but because I had so many hours of tear-my-hair-out misery using their products. I found them so under-tested and buggy that finally I just gave up. They're now blacklisted in my mind -- I'll never use one of their products again. I guess the lesson here is that good code doesn't always have a strong relationship to a usable or bug-free product.
- jan_g 7y agoHave you by any chance also used their Vault[0]? I'm looking at solutions for secrets management and theirs is mentioned often. [0] https://www.vaultproject.io/ https://www.vaultproject.io/
- smt88 7y agoI haven't and am not sure whom the target audience is exactly. Azure and AWS have secrets management, and most stacks have some open-source way to do it if you're the roll-your-own-server type.
- jan_g 7y agoYeah, cloud option isn't available for the product we're building (very specific needs with regards to data and services geo location). But to me it looks like that the target audience is anyone operating a Kubernetes cluster as it seems to be the most mature option for managing secrets that is also well integrated into Kubernetes. And their open source version already provides quite a few features. At least that's the vibe I got from reading various comparisons and blog posts about secrets management.
- bamboozled 7y ago
- lewaldman 7y agoRedis...
- blueprint 7y agoCheck out https://github.com/mymonero/mymonero-app-ios https://github.com/mymonero/mymonero-app-ios
- nstart 7y agoDiscourse is a wonderful code base to peruse. When I was just starting out building more complex web apps I repeatedly referred to it to learn common patterns such as how queues are used to offload tasks. Just to drive the point home, I was developing in Python and with no knowledge of Ruby, I was able to go through code using just github and I got what I wanted every single time.