Most active commenters
  • alankay(4)
  • alankay1(3)
  • nickpsecurity(3)
  • wslh(3)

←back to thread

1401 points alankay | 41 comments | | HN request time: 1.263s | source | bottom

This request originated via recent discussions on HN, and the forming of HARC! at YC Research. I'll be around for most of the day today (though the early evening).
1. di ◴[] No.11940134[source]
Hi Alan,

In "The Power of the Context" (2004) you wrote:

  ...In programming there is a wide-spread 1st order
  theory that one shouldn’t build one’s own tools,
  languages, and especially operating systems. This is
  true—an incredible amount of time and energy has gone
  down these ratholes. On the 2nd hand, if you can build
  your own tools, languages and operating systems, then
  you absolutely should because the leverage that can be
  obtained (and often the time not wasted in trying to
  fix other people’s not quite right tools) can be
  incredible.
I love this quote because it justifies a DIY attitude of experimentation and reverse engineering, etc., that generally I think we could use more of.

However, more often than not, I find the sentiment paralyzing. There's so much that one could probably learn to build themselves, but as things become more and more complex, one has to be able to make a rational tradeoff between spending the time and energy in the rathole, or not. I can't spend all day rebuilding everything I can simply because I can.

My question is: how does one decide when to DIY, and when to use what's already been built?

replies(6): >>11940184 #>>11940254 #>>11940350 #>>11940433 #>>11940618 #>>11943999 #
2. ◴[] No.11940184[source]
3. jjnoakes ◴[] No.11940254[source]
I tend to do both in parallel and the first one done wins.

That is, if I have a problem that requires a library or program, and I don't know of one, I semi-simultaneously try to find a library/program that exists out there (scanning forums, googling around, reading stack overflow, searching github, going to language repositories for the languages I care about, etc) and also in parallel try to formulate in my mind what the ideal solution would look like for my particular problem.

As time goes by, I get closer to finding a good enough library/program and closer to being able to picture what a solution would look like if I wrote it.

At some point I either find what I need (it's good enough or it's perfect) or I get to the point where I understand enough about the solution I'm envisioning that I write it up myself.

replies(2): >>11940409 #>>11940420 #
4. stcredzero ◴[] No.11940350[source]
Isn't the answer contained in the quote? Do a cost/benefit analysis of the "amount of time and energy" that would go "down these ratholes" versus the "the time not wasted in trying to fix other people’s not quite right tools."
replies(2): >>11940384 #>>11940454 #
5. austinjp ◴[] No.11940384[source]
But how can you assess this until you have gone down those rat holes?
replies(4): >>11940449 #>>11940486 #>>11945633 #>>11954395 #
6. igorgue ◴[] No.11940409[source]
If you don't have the time or energy for such projects then you CAN'T do them. The answer is there.
7. quantumhobbit ◴[] No.11940420[source]
Yes. If it takes me longer to figure out how to use your library or framework than to just implement the functionality myself, there is no point in using the library.

Some people claim you should still use the 3rd party solution because of the cost of supporting the extra code you have written. But bugs can exist in both my code and the 3rd party code and I understand how to fix bugs in my code much more easily.

replies(1): >>11944585 #
8. alankay ◴[] No.11940433[source]
This is a tough question. (And always has been in a sense, because every era has had projects where the tool building has sunk the project into a black hole.)

It really helped at Parc to work with real geniuses like Chuck Thacker and Dan Ingalls (and quite a few more). There is a very thin boundary between making the 2nd order work vs getting wiped out by the effort.

Another perspective on this is to think about "not getting caught by dependencies" -- what if there were really good independent module systems -- perhaps aided by hardware -- that allowed both worlds to work together (so one doesn't get buried under "useful patches", etc.)

One of my favorite things to watch at Parc was how well Dan Ingalls was able to bootstrap a new system out of an old one by really using what objects are good for, and especially where the new system was even much better at facilitating the next bootstrap.

I'm not a big Unix fan -- it was too late on the scene for the level of ideas that it had -- but if you take the cultural history it came from, there were several things they tried to do that were admirable -- including really having a tiny kernel and using Unix processes for all systems building (this was a very useful version of "OOP" -- you just couldn't have small objects because of the way processes were implemented). It was quite sad to see how this pretty nice mix and match approach gradually decayed into huge loads and dependencies. Part of this was that the rather good idea of parsing non-command messages in each process -- we used this in the first Smalltalk at Parc -- became much too ad hoc because there was not a strong attempt to intertwine a real language around the message structures (this very same thing happened with http -- just think of what this could have been if anyone had been noticing ...)

replies(3): >>11940805 #>>11944937 #>>11952371 #
9. stcredzero ◴[] No.11940449{3}[source]
For many particular examples, there have already been enough rathole spelunkers to provide useful data. Maybe start looking in the places where there isn't already useful data?
replies(1): >>11940836 #
10. alankay1 ◴[] No.11940454[source]
The real reason to do the 2nd order is get new things rather than incrementing on older poorer ideas.
11. dsr_ ◴[] No.11940486{3}[source]
You gain experience by going down similar rat holes, until you feel that you can adequately compare the situation you are in now to an experience in the past.

You'll still be wrong, but perhaps less often.

12. shostack ◴[] No.11940618[source]
Specifically with regards to languages and OS's, I wonder how much that cost/benefit equation shifts as things have become so much more complex, and as we continue to pile on abstraction layer after abstraction layer.
replies(1): >>11940852 #
13. pault ◴[] No.11940805[source]
> I'm not a big Unix fan

What is your preferred technology stack?

replies(1): >>11940846 #
14. DasIch ◴[] No.11940836{4}[source]
Any area in which enough such spelunkers are found is unlikely to be significantly improved by adding your own effort.
replies(1): >>11945667 #
15. astrodust ◴[] No.11940846{3}[source]
What's a good non-UNIX open-source operating system that's useful for day-to-day work, or at least academically significant enough that it's worth diving in to?
replies(4): >>11941148 #>>11941329 #>>11941698 #>>11950724 #
16. astrobe_ ◴[] No.11940852[source]
I think the problem is not complexity but size. Most of the source for the Linux kernel is in the drivers, for instance. As for languages, most of the weight is in the libraries.
17. edejong ◴[] No.11941148{4}[source]
I'd assume that depends on your measure of worth, I'd say. Many operating systems had little academic significance when it was most academically or commercially fruitful to invest time in. Microkernel and dependency specific operating systems would be interesting. Or hardware based capability based operating systems.
18. nickpsecurity ◴[] No.11941329{4}[source]
Here's a list of alternatives I put together to see some capabilities or traits UNIX lacked:

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

I think, usable day-to-day, I'd say you're down to Haiku, MorphOS, Genode, MINIX 3, and/or A2 Bluebottle. Haiku is a BeOS clone. MorphOS is one of last Amiga's that looks pretty awesome. Genode OS is a security-oriented, microkernel architecture that's using UNIX for bootstrapping but doesn't inherently need it. MINIX 3 similarly bootstrapping on NetBSD but adds microkernels, user-mode drivers, and self-healing functions. A2 Bluebottle is most featured version of Oberon OS in safe, GC'd language. Runs fast.

The usability of these and third party software available vary considerably. One recommendation I have across the board is to back up your data with a boot disc onto external media. Do that often. Reason being, any project with few developers + few users + bare metal is going to have issues to resolve that long-term projects will have already knocked out.

replies(1): >>11946388 #
19. wslh ◴[] No.11941698{4}[source]
SqueakNOS? http://squeaknos.blogspot.com ;-) It has a native TCP/IP stack in Squeak.
replies(1): >>11942202 #
20. philippeback ◴[] No.11942202{5}[source]
http://pillarhub.pharocloud.com/hub/mikefilonov/pharonos
replies(1): >>11942537 #
21. wslh ◴[] No.11942537{6}[source]
The difference is PharoNOS has a Linux running behind while the idea of SqueakNOS is to build a complete operating system via Squeak. In this way you can quickly hack it. There is a great page about these initiatives here: http://wiki.squeak.org/squeak/5727

BTW, prior to SqueakNOS we implemented this: http://swain.webframe.org/squeak/floppy/ (using Linux and modifying Squeak to work with SVGALib instead of X) in just 900mb inspired in QNX Demo Disk: http://toastytech.com/guis/qnxdemo.html

replies(1): >>11947071 #
22. 50CNT ◴[] No.11943999[source]
I think you have to weigh your qualms against the difficulty of implementation. They're both spectra, one from 'completely unusable' to 'perfect in its sublime beauty', the other from 'there's a complete solution for this' to 'i need to learn VHDL for this'.

There's some factors that help shift these spectra.

Configurability helps. If I can change a config to get the behavior I want, that is incredible, thank you.

Open source helps. Getting to see how they did it reduces reverse engineering work immensely if I ever have to dig in.

Modularity helps. If I can just plop in my module instead of doing brain surgery on other modules, that makes it a lot easier.

Good components help. Say I need a webscraper and know python. Imagine there was only selenium and not even urllib, but some low level TCP/IP library. I get a choice between heavy but easy or slim but high maintenance. But there's the sexy requests library, and there is the beautiful beautifulsoup4. I tell requests what to get, tell bs4 what I want from it, and I'm done.

Another great example for this is emacs. python-mode + elpy (almost complete solution), hide-show mode, electric-pair mode, and if anything still bugs me, it is fixable. If it were OOP, I'd inherit a lot of powerful functions, but I can always override anything that is wrong.

Expertise helps. If I have written a kernel module, that's another avenue to solving problems I have.

Expertise is a special case here worth more attention. It's the main thing that changes for any single programmer, and can skew this equation immensely. Expertise grows when you struggle with new things. Preferably just outside what you know and are comfortable with.

Considering that, DIY whenever you can afford to DIY (eg. pay the upfront cost of acquiring expertise), DIY whenever it is just outside what you can do, or DIY when it makes a lot of sense (eg. squarely in your domain of expertise, and there's a benefit to be had).

In concrete examples, that means don't DIY when you're on a tight deadline, don't attempt to write your own kernel after learning about variables, don't write your own parser generator when say, YACC, solves your problem just fine.

23. MaulingMonkey ◴[] No.11944585{3}[source]
Other points of consideration: My coworkers might not already know some library, but they definitely won't know my library. My coworker's code is just about as "3rd party" as any library - as is code I wrote as little as 6 months ago. Also my job owns that code, so rolling my own means I need to write another clone every time I switch employers - assuming there's no patents or overly litigious lawyers to worry about.

But you're of course correct that there is, eventually, a point where it no longer makes sense to use the library.

> Some people claim you should still use the 3rd party solution because of the cost of supporting the extra code you have written. But bugs can exist in both my code and the 3rd party code and I understand how to fix bugs in my code much more easily.

The problem is I got so tired of fixing bugs in coworker / former coworker code that I eventually replaced their stuff with off the shelf libraries, just so the bugs would go away. And in practice, they did go away. And it caught several usage bugs because the library had better sanity checks. And to this day, those former coworkers would use the same justifications, in total earnestness.

I've never said "gee, I wish we used some custom bespoke implementation for this". I'll wish a good implementation had been made commonly available as a reusable library, perhaps. But bespoke just means fewer eyes and fewer bugfixes.

replies(1): >>11945081 #
24. calibraxis ◴[] No.11944937[source]
Could someone give hints/pointers that help me understand the following? "parsing non-command messages in each process ... not a strong attempt to intertwine a real language around the message structures (this very same thing happened with http"

Does that mean the messages should have been part of a coherent protocol or spec? That there should have been some thought behind how messages compose into new messages?

replies(1): >>11945123 #
25. jjnoakes ◴[] No.11945081{4}[source]
It's all trade-offs.

If there happens to be a well-tested third party library that does what you want, doesn't increase your attack surface more than necessary, is supported by the community, is easy to get up and running with, and has a compatible license with what you are using it in, then by all means go for it.

For me and my work, I tend to find that something from the above list is lacking enough that it makes more sense to write it in-house. Not always, and not as a rule, but it works out that way quite a bit.

I would also argue that if coworkers couldn't write a library without a prohibitive number of bugs, then they won't be able to write application or glue code either. So maybe your issue wasn't in-house vs third party libraries, but the quality control and/or developer aptitude around you.

replies(1): >>11948352 #
26. alankay1 ◴[] No.11945123{3}[source]
Smalltalk was an early attempt at non-command-messages to objects with the realization that you get a "programming language" if you take some care with the conventions used for composing the messages.
replies(1): >>11945383 #
27. infinite8s ◴[] No.11945383{4}[source]
By non-command-messages do you mean that the receiver was free to ignore the message?
replies(1): >>11946506 #
28. TheAdventMaster ◴[] No.11945633{3}[source]
Having gone down several myself, I can say it's hard. You lose time. You have to accept you've lost time and learn how not to do it in the future.

My advice is to collaborate with people who are much, much smarter than you and have the expectation that things actually get done because they know they could do it. You learn what productivity looks like first, at the most difficult and complex level you're capable of.

That sets the bar.

Everything has to be equal to or beneath that unless your experience tells you you'll be able to do something even greater (possibly) with the right help or inspiration

29. TheAdventMaster ◴[] No.11945667{5}[source]
Agreed. It's often much, much harder to articulate why an idea is bad or a rat hole. You just move on.

I've come up with explanation by analogy. You can demonstrate quite easily in mathematics how you can create a system of notation or a function that quickly becomes impossible to compute. A number that is too large, or an algorithm that would take infinity amount of time and resources to solve...

It seems to be in nature that bad ideas are easy. Good ideas are harder, because they tend to be refinements of what already exists and what is already good.

So pursue good ideas. Pursue the thing that you have thought about and decided has the best balance between values and highest chance to succeed. Sometimes it's just a strong gut feeling. Go for it, but set limits, because you don't want to fall prey to a gut feeling originating from strong intuition but an equally strong lack of fundamental understanding.

30. MustardTiger ◴[] No.11946388{5}[source]
Minix isn't bootstrapping on netbsd, the entire goal of the system is to be a microkernel based unix. It uses the netbsd userland because you don't need to rewrite an entire unix userland for no reason just to change kernels.
replies(1): >>11946589 #
31. alankay1 ◴[] No.11946506{5}[source]
Yes
replies(1): >>11947286 #
32. nickpsecurity ◴[] No.11946589{6}[source]
Mental slip on my part. Thanks for the correction. I stand by the example at least for the parts under NetBSD like drivers and reincarnation server. Their style is more like non-UNIX, microkernel systems of the past. Well, some precedent in HeliOS operating system but that was still detour from traditional UNIX.

https://en.wikipedia.org/wiki/Helios_os

33. nickpsecurity ◴[] No.11947071{7}[source]
I was going to mention QNX Demo Disk in my UNIX alternatives comment. I think I edited it out for a weak fit to the post. It was an amazing demo, though, showing what a clean-slate, alternative, RTOS architecture could do for a desktop experience. The lack of lag in many user-facing operations was by itself a significant experience. Showed that all the freezes and huge slow-downs that were "to be expected" on normal OS's weren't necessary at all. Just bad design.

It's neat that it was the thing that inspired one of your Squeak projects. Is SqueakNOS usable day-to-day in any console desktop or server appliance context? Key stuff reliable yet?

replies(1): >>11947789 #
34. bcjordan ◴[] No.11947286{6}[source]
Akin to "signals" / "event emitters"?
replies(1): >>11948623 #
35. wslh ◴[] No.11947789{8}[source]
We implemented SqueakOS while some friends implemented SqueakNOS. I don't think they are being used anywhere but for educational purposes it is amazing that drivers and a TCP/IP stack could be implemented (and debugged!) in plain smalltalk. There was some more information here: http://lists.squeakfoundation.org/pipermail/squeaknos/2009-M...
36. MaulingMonkey ◴[] No.11948352{5}[source]
You're not wrong. The fundamental issue wasn't in-house vs third party libraries.

The developers around me tend to be inept at time estimation. They completely lack that aptitude. To be fair, so do I. I slap a 5x multiplier onto my worst case estimates for feature work... and I'm proud to end up with a good average estimate, because I'm still doing better than many of my coworkers at that point. Thank goodness we're employed for our programming skills, not our time estimation ones, or we'd all be unemployable.

They think "this will only take a day". If I'm lucky, they're wrong, and they'll spend a week on it. If I'm unlucky, they're right, and they'll spend a day on it - unlucky because that comes with at least a week's worth of technical debt, bugs, and other QC issues to fix at some point. In a high time pressure environment - too many things to do, too little time to do it all in even when you're optimistic - and it's understandable that the latter is frequently chosen. It may even be the right choice in the short term. But this only reinforces poor time estimation skills.

The end result? They vastly underestimate the cost of supporting the extra code they'll write. They make the "right" choice based on their understanding of the tradeoffs, and roll their own library instead of using a 3rd party solution. But as we've just established their understanding was vastly off basis. Something must give as a result, no matter how good a programmer they are otherwise: schedule, or quality. Or both.

37. alankay ◴[] No.11948623{7}[source]
If you think about the "whole system", even if it's just a Shannon channel, what do you actually need?
38. cyphar ◴[] No.11950724{4}[source]
There's GNU, which is by definition not UNIX. ;)
39. MichaelMoser123 ◴[] No.11952371[source]
well, in this talk it sounds like you do advocate tool building - isn't tool building a way to try elliptic orbits instead of the circular ones ?

https://www.youtube.com/watch?v=NdSD07U5uBs 'Power of simplicity'

replies(1): >>11952921 #
40. alankay ◴[] No.11952921{3}[source]
Yes, I do advocate tool building -- basically "if you can do it without getting buried, you should".
41. jonoCodes ◴[] No.11954395{3}[source]
The Lean Startup advocates proportional investment in solutions. WHEN the problem comes up (again, after deciding to do this) determine how much your time percentage wise this took out of your week or month. Invest that amount to fix it, right now. My interpretation would be, spend that time trying to solve part of it. Every time that problem comes up keep investing in that thing, that way if you've made the wrong call you only waste a small portion of your time. But you also are taking steps to mitigate it if becomes more of an issue in the future.