167 points · by sktrdie · 7y ago · 92 comments
The problems with this approach seem solvable to me, albeit with more experimental magic that could explode:
- The resulting big ball of mud (and subsequent performance problems of a long pipeline of relations) could be compiled away, resulting in a single artifact. That is, you'd develop in append-only style, but when you "commit" your release, you'd end up with a single, optimized artifact for deployment, which would also be readable. This seems really nice to me, since your changes, while being based on the behavior of the system, would create a diff in the implementation of the system, potentially reaching way back into upstream events (in the example, the behaviors that block hot water and substitute cold water would just completely eliminate the first pane and simplify to adding cold water). This would let you see your changes from multiple perspectives. This approach also seems really friendly to fuzz-testing, which would give you a third look into the behavior of the system, and you could write tests based on the final state of the system after a number of given events.
- Migrating data structures actually seems easier to me for an event sourced approach, since you'd just re-project your domain models based on the new flow of events. b-threads would allow you to re-compile your event stream just like you re-compiled the source artifact (having parameterized events remains a problem, since your historical data could end up being incomplete and invalid based on new policy, you'd have to adopt a permissive schema to keep stuff that validation would otherwise reject).
I'll agree that b-trees don't really solve anything, but they do bring up some interesting questions that I think are worth asking. Datomic and Darklang I think are much more practical, and seem to dabble in the same sort of areas.
I agree this would be nice, but think of this problem more deeply and you quickly run into major issues. The biggest one being that your compiler now has a large scale optimisation step to do completely automatically, better than a human.
In order to make this work, you'd effectively have to build everything out of composable components, which you then can switch on/off with some sort of layering system. The problem here is how do you come to a decision on what those composable units look like? You don't know what you don't know - i.e. what those future layers you append are going to need to turn off or on.
And coming back to optimisation - once you know the features you are combining together in an algorithm, only then do you know the data structures that fit the problem. Optimisation isn't a forward process when you turn parts off and end up with an efficient system. Optimisation requires a high level view, a low level view, an understanding of context, of memory requirements, of language capabilities, even leaps of logic.
For the last part when I mean is that whilst a compiler may be able to reorganize something in the form a*b=c (and even then knowing when to do this is a book on it's own), it can't know that if I, for example, disable a feature that adds nested nodes to a tree structure, that it could rewrite functions to no longer require recursion and instead treat them like serial lists.
You could rewrite the methods yourself and add them to your new layer, but you also will inevitably end up not fitting the previous composable structure.
I think the deeper problem is related more to the tying of syntax to structure, as structure is ultimately your application's performance profile. Untying these two though could lead to a way forward for the append style paradigm.
And this very much exists in the real world: every moddable video game, every audio/video tool accepting plugins, every multi-team business workflow, every browser plugin architecture, every SQL trigger... all are collections of independently developed state machines, intercepting a global event list and interrupting with their own events, just waiting to conflict with each other. Plugins and (blocking/yielding) extension points are the only real way to build software with massive feature surface areas.
The tooling to visualize and debug these flows is IMO quite lacking, and I don’t think this is helped by systems engineers’ general love for all things textual. One needs to not only understand the flows they think will happen, but also fuzz the ones they don’t, and all this needs to be presented in a way that doesn’t overwhelm human working memory. I don’t think that’s a solved problem by any stretch. And I doubt the solution will look like our current text editors. But it’s something I think about quite often.
Our original code path for Android on CDMA went A, B, C, D and E.
Then SIP came along, and we had to do A, B, E and D (C no longer required for SIP) but we still have to support CDMA.
Then step B got more complicated, so we had to do B and B2 at the same time (basically, B and B2 are data queries internally), so CDMA: A, B & B2, C, D and E. SIP: A, B & B2, E, D.
Then iPhone support comes along, and it doesn't matter if it's CDMA or SIP, we have to do A, B2, conditionally B (depends upon result of B2, so here we can't do both at the same time) and finally E2. And keep all the previous behavior intact.
In our case, we aren't replacing old code, but keeping it around and adding new features into the mix. I think either way we'll still end up with a big ball of mud.
So..something like `git rebase` or `git merge` for both code and data. That actually sounds cool, but certainly not trivial. Part of why I've always liked git, despite its warts, is that it's a robust tool that has never crashed on me, probably due to the immense amount of man-hours that have gone into hardening it to be usable for the kernel. According to my Google eng friends, there's even crazier levels of VCS sophistication going on to make the Google monorepo work. How hard would it be to make something like that for data? Call me crazy, but I've found it generally harder or maybe just _higher risk_ to reason about data, because incorrect assumptions result in bad things happening -- heisenbugs or zombie bugs.
Given that we're talking about data migrations...what happens when you have a merge conflict? That's the hard part. Fuzz testing and writing tests based on the final state of the system? Also hard, but will be hard no matter what because making sure the end state doesn't contain undesired corner side effects could end up being a combinatoric explosion that results in data corruption and an alarmed user (or more).
> "just re-project your domain models based on the new flow of events"
just re-project your domain models? Sounds like a migration to me.
I get a little annoyed by abstract models in the subject article because they 1) re-imagine things that already exist and 2) focus on making the easy things easier and not on making the hard things possible.
For example, I even see this in your reasoning, which I don't agree with. Time is already a first class concept in most software development models. If you're using an imperative programming language, sequence is the default. Likewise for most RDBMS migration frameworks I've used.
It's the data migration that's the problem. It's applying temporal evolution to data in a structured, testable way that scales and doesn't decay which is challenging. I've been thinking about writing a data migration framework for a while -- something like `alembic` but expressly for migrating data and testing that the migrated data is sane. Thing is, that's hard, and it gets harder the larger your data gets in volume and heterogeneity. At a certain problem, it's 100% a question of how well your understand your data, your UX, your business logic, and the history of your data. In fact, the majority of places I've worked at suffer from the situation where an old, inactive customer has bad data that no one bothers to fix because it's a poor usage of resources for the business.
New ideas of programming "styles" or "models" that don't emerge from these pains -- are they going to solve them? Maybe. But this one doesn't seem to do so.
>As a system grows in complexity we don’t necessarily care about how old b-threads have been written, hence we don’t care about maintaining them.
This post is essentially formalizing the process of creating a Big Ball of Mud[0] that is so complex and convoluted that it is impossible to understand. The motivation for formalizing this process seems sane and with good intentions: to add functionality quickly to code you don't really understand. Normally, doing something like is considered cutting corners and incurring explicit technical debt, and must be used sparingly and responsibly. However, the process of "append-only development" is embracing the corner cutting and technical debt as a legitimate development process. I can't get on board with this.
To be more specific, with an example (and maybe I am wrong in understanding the post, this would be the time to point that out to me), let's suppose you have a massive complex software system that was built over the years with this "append-only" style of development. One day you find a nasty bug in one of the lower layers, and to correct it, you have to change some functionality, which moves/removes some events that subsequent layers are depending on for their own functionality. Suddenly, you are faced with rewriting all of those layers in order to adapt to your bugfix. What you're left with is a nightmare of changes that disturb many layers of functionality, because they're all based on this append-only diffing concept: the next layer is dependent on the functionality of the previous layer.
This is what programming APIs are for: to change functionality in lower layers with minimal influence subsequent layers. This post and process seems to be imagining a world without APIs.
The thing is, I might be able to see this "working" in very simple and limited processes[0]... But going back to your example of the nasty bug in complex software, I believe the post's idea is that you shouldn't fix the bug in the layer it's happening, but, instead, write a new b-thread that corrects that behavior.
Which might sound nice in theory but I feel it's much more likely that you won't be able to fix it there (the info you need might be lost in a previous b-thread) or become a piece of code so complex that negates any supposedly benefit that this system had in the first place.
[0] It might be just me and completely off-topic, but this reminds me a bit of rule-based expert systems, where the rules get activated by certain conditions and produce effects (that can activate other rules). The idea was always that you could model very complex (and emerging) behaviors based on very simple, human readable rules. The thing is that you could definitely add/tweak/remove the rules as needed.
The only alternative I've seen without completely rethinking company structure, is having engineering management rebuking business and pushing for these initiatives. Which can be inadvisable from a career perspective, so usually does not happen. It's more politically savvy to push for a "new project" that will fix all the issues of the existent systems.
1. One commit per PR (so the commit history wasn't polluted with rough drafts and debug logs and such) 2. Every PR links to a bug 3. Design discussions happen in bugs
Then when you see some weird code, you can "blame" back to the commit, and from there look at the bug to see why the commit was needed. We also really encouraged people to separate refactoring from new features (refactor first, in a descriptive PR, then add the feature), so that you avoided the problem of seeing a complex refactoring in a PR called "add foo"
I agree with other commenters that encoding the design history of your project in its operation doesn't seem helpful, and in my opinion that's because it's solving the wrong problem. Finding the places in a complicated project that need to change is only hard because knowing, to a fairly complete degree, how the system already works is hard, and knowing how a system already works is mostly the product of understanding the problem that it solves deeply. Experienced engineers on a project usually have no problem figuring out which parts of a system need to be changed, because they already know the system well, and they don't know they system well by virtue of having all the code memorized, which would be impossible, but by having participated in all of the design discussions.
Therefore, the problem that needs to be solved is making the learning process as fast and easy as possible—thus the strict process around documenting changes and their motivation. Allowing people to quickly discover the existing code's motivation gives them the information that will actually need be committed to memory.
Offhand, it seems like linking all PRs in all repos back to the bug, and linking the bug to all of the disparate PRs might help. A version (possibly) of the "many PRs" problem that we sort of had was that it often took many PRs to close a bug. Our goal wasn't to minimize the number of PRs, and in fact we encouraged small PRs. Rather, the goal was to get engineers past the commit and PR to the underlying motivation and design.
I'm reminded of the golden hammer fascination with event sourcing, and I continue to see event sourcing applied inappropriately. Is it useful for some specialized applications? Yes, and it's a great tool there! But should it be the default tool you reach for to solve most problems over a relational DB and your most trusted, high level, stable programming language with a mature library ecosystem?
No to that question, and no to this.
(I still program all my side projects in this way.)
My thoughts on this are: append only programming is less effectual than having an over all append only system, where many programs take input (including the original source "message"), then hand off the out put to the next program in line. Which programs get run depends entirely on that run context's configuration. When you have disparate programs working towards a final goal, and these programs are defined in a readable configuration it gives you quite a few benefits. Good clean logging structures, easy to reason about, easy to change (feature toggling, data migration points, etc), and easy to clean up when required.
I call it unix'ing your systems.
There's a lot of comments calling this silly but please attempt to give it a few read overs and apply it to systems you've worked with. Hopefully they've been large enough to draw similarities to what he's talking about in a very clean, academic manner.
But the chart in graph 1 still applies, often when adding new functionality you realize you need to add or remove modularity and extensions.
1. You can’t see the blocking in the event stream behaviour so your change might mysteriously fail to work. I wasn’t super clear on what the semantics were but I think the last change to not show ads to enterprise customers accidentally breaks the normal case and causes the program to lock up once it hits isValid. Normal program changes also suffer from accidentally breaking existing behaviour. Especially eg a change to a superclass breaking subclasses or accidentally mutating some global state or throwing an exception in the wrong place.
2. There are lots of possible event streams and it is hard to predict how well your change will behave under all of them. This is also a problem for any sufficiently large and modified program.
3. You can’t block a block, so it is hard to undo modified behaviour in some cases (this is what causes the atm to lock up after the last change (if I’m right in thinking it does))
However I don’t think this means that this is a pointless area of research. It may be that good ways of dealing with these things are eventually devised. And the idea of lots of small processes doing simple things coming together to make something which holistically behaves in a smart reliable and resilient way seems popular and reasonable (eg see copycat).
One good thing about this method would be testability. A test can be just another bthread (or more) running in the system followed by printing a trace of the events. That way one might easily know if some existing behaviour is broken because the printed trace would change.
Another similar idea (without necessarily requiring append-only programming) is one from eve and a talk I don’t remember the name of where one writes prolog-like rules to manipulate a set of known facts over time. This also suffers from difficulties with negation.
I suppose a general idea is that with these “bag of interacting rules” systems (which seem a good start for building complex systems which can be modified and tweaked reliably and resiliently) it is hard to have negatives (thus blocking) and in particular very hard to have reliable double negatives (blocking a block).
So what is the solution? Well I don’t know and it seems that any answer could be unsatisfactory. One possibility could be to allow for more probabilistic or otherwise weighted behaviour but this seems bad for reliability of results. Another idea is to disallow negation but this seems to make everything hard. Another idea might be to somehow make synchronisation points better.
One could even formalize this system: a piece of code can be replaced if its behavior under its current set of events is guaranteed not to change.
Also, weighted/ordered behavior is sometimes necessary due to race conditions: two identical threads respond to events in different ways, which one wins? When I have made systems with plugin-like architecture, I always establish a global “pecking order” of sources for consistency, but anything that relies on the pecking order is a massive code smell. (That’s a rule I wish I could tell my younger self to follow more often!)
I’ve spoken in another comment about testability: https://news.ycombinator.com/item?id=20562272
I love these kinds of magical discussions :)
If your program is constructed this way at every layer of logic, not only will your program be amenable to append only styles of programming. But it will be amenable to decomposition. Often you find that your primitives are too big and you need to split your primitives... well if your primitives are itself made out of the compositions of lower level primitives then breaking apart that function is trivial.
There is only one primitive in all of programming that follows this composition rule. Procedures cannot compose, Objects cannot compose. What's left?
I'd argue those ain't "primitives" in that case; what differentiates a "primitive" from some other kind of computation is that it can't be broken down further.
> Procedures cannot compose
Depends on how you define "procedure". In the sense used in procedural programming, you certainly can compose them (i.e. by jumping into a subroutine that in turn jumps into other subroutines, pushing and popping things to/from the stack in the process). This is a pretty fundamental concept for threaded interpreters, and Forth in particular (as well as other stack-driven concatenative languages descended from it) exemplifies this as the very basis of the language itself.
> Objects cannot compose
Object composition (both by including objects within other objects and by using interfaces and implementations thereof) has been a thing for multiple decades now.
Usually when you program you don't create a library made out of the lowest level primitives. You start out with higher level primitives and hopefully if your design is correct, all upper layers are different compositions of this lowest level set of primitives.
I am talking about this layer of primitives. If you chose your primitives incorrectly and find out that you need to break apart your primitives, it is far easier to do this if your primitives themselves were also made out of compositions of lower level primitives. If your primitives were already a tangle of objects and procedures this would be very hard.
>Depends on how you define "procedure". In the sense used in procedural programming, you certainly can compose them (i.e. by jumping into a subroutine that in turn jumps into other subroutines, pushing and popping things to/from the stack in the process). This is a pretty fundamental concept for threaded interpreters, and Forth in particular (as well as other stack-driven concatenative languages descended from it) exemplifies this as the very basis of the language itself.
I defined what I mean by composition. By procedure I mean a list of procedures of instructions. What does it mean to compose steps One through five with steps six through ten? Is steps six through ten compose-able with another set of steps from a whole different sub routine? Most likely no. You cannot define a singular function compose(step1, step6) = step4 like I described in my definition.
>Object composition (both by including objects within other objects and by using interfaces and implementations thereof) has been a thing for multiple decades now.
Does this fit with what I defined as composition? No it does not.
Object composition is a horrible word. It is not true composition. Dependency injection is a more fitting word for what is actually happening. You are making one object depend on another object, you are not composing two objects to form a new object. When objects "compose" you create dependencies and custom glue code to make everything fit together.
When I refer to composition I am talking about how bricks compose to form a wall. There is only a singular form of composition to compose bricks into a wall and each brick can exist without a dependency to another brick.
"Object composition" is using as much concrete as possible to compose bricks of every geometric shape into a mishmash ball of solids.
Again objects and procedures do not compose like bricks. Another programming primitive is more suited for this. Maybe someone knows what this primitive is.
Those aren't primitives, though. Primitives are the lowest possible level; that's what makes them primitives. If something can be decomposed further (or is in turn composed of other things which are visible to the language without e.g. dropping down to assembly), then it is definitionally not a primitive.
I think the word you seek is "components".
> By procedure I mean a list of procedures of instructions.
That's a circular definition, and does not in any way clarify what you mean by "procedures".
> What does it mean to compose steps One through five with steps six through ten?
In the context of procedural programming, it would ordinarily mean to perform those steps in sequence (that is: the output of steps one through five would be the input to steps six through ten), or to define a procedure which in turn calls those procedures in sequence.
> You cannot define a singular function compose(step1, step6) = step4 like I described in my definition.
In pseudo-Forth (with punctuation turned into something more reasonable, and a couple imaginary procedures for creating (anonProcedure) and executing (execute) function pointers):
procedure stepOne anonProcedure finely chop end end
procedure stepSix anonProcedure pan add stir end end
\ [pop] is imaginary and purely illustrative of the idea of
\ taking function pointers off the stack.
procedure compose anonProcedure [pop] [pop] end end
procedure stepFour stepSix stepOne compose end
chicken stepFour execute \ equivalent to: chicken finely chop pan add stir
Looks pretty composed to me.> you are not composing two objects to form a new object
class Foo {
greeting = "Howdy"
hi = { puts $greeting }
}
class Bar {
farewell = "Adios"
bye = { puts $farewell }
}
class Baz {
greeter = new Foo
dismisser = new Bar
hi = greeter.hi
bye = dismisser.bye
speak = { hi; bye }
}
speaker = new Baz
speaker.hi # "Howdy\n"
speaker.bye # "Adios\n"
speaker.speak # "Howdy\nAdios\n"
Tada!> When I refer to composition I am talking about how bricks compose to form a wall.
You're talking about doing it in a way that assumes you're only allowed to use bricks on their own, piled high with noting actually connecting them together.
Procedures and objects work great as bricks. You just need some mortar and rebar.
> Maybe someone knows what this primitive is.
Maybe you'd do a better job conveying your point if you just said the "primitive" you mean instead of being needlessly coy about it.
And regarding this brick-which-cannot-be-named-for-some-reason: yes, they happen to snap together remarkably well like Lego bricks, but people don't (typically) build their houses with Lego bricks, nor do people normally write their business logic in Haskell.
compose(f, g) = \x -> g(f(x))
Difficulty in updating software isn't a new problem - but we already have much, much better solutions than this. I don't think there's anything wrong with changing existing code - and if changing existing code is causing you so much pain that you're led down this route, then you probably have bigger issues.
Maybe this methodology just isn't for me - but I really don't see how this improves anything from a development perspective. I only care about the current state of the code - and if I need to care about the previous state of the code, then I just check the history. The idea of having to understand the entire history of a codebase just to grok the current state seems insane.
For one, its not clear how this aids easier development - hasn't it just shifted understanding of a complex program to understanding a complex overlapping sequence of b threads instead?
Secondly, and I think the nail in the coffin, the compiler would have to be brilliant at optimisation to make the final program performant. The idea of 'show ads' later being disabled by another overlapping b thread - does this mean the network request is never performed? Or is it performed and the result thrown away, wasting resources. How would an 'offline mode' requirement be appended as a b thread in such a case?
Performance probably relates more to the ratio of time spent selecting the next event to time spent executing code between yields than anything else: a thread waiting on an event joins a queue, a thread requesting an event joins the same queue but also flags it as ready, and a thread blocking an event flags the queue as not ready. When a queue is selected, it's drained completely before a new queue is selected.
The run cost of the scheduler would depend mostly on the structure used to maintain the ready set, but a basic double ended linked list would provide linear time operations for ready/blocked management. Whole program compilation could provide lookups or perfect hashes for event queueing, or partial compilation could rely on imperfect hashing.
Optimising during compilation might work best by trying to fuse events such that the scheduler is invoked less often.
Things that are not apparent from a lightweight article like this include state transfer (how do I know details of the card inserted?) and the likelihood that I'd keep the code to each b-thread and hack on those to make new ones...
Just today, I had to write a simple navigation menu. Suppose that I have pages to navigate to that have /a/ through /n/. I abstracted away the button, but I didn't write a loop to loop over each route entirely. Why? Well, based on user interactions I might want to have the buttons change shape or color and I don't want to have to go back and unwind that abstraction.
Some people will look at that code and say its not DRY. Well, I like to make code WET - write everything twice. There is some ideal amount of boilerplate as well just so someone can read and understand the darn thing - if they have a few examples to play with it'll be much easier for them to understand. Also, it amuses me how much stake people put in nonsense acronyms, as if some sort of borrowed linguistic authority will cover ineptitude and not thinking for oneself.
Ultimately this looks like an over engineered technical fix for what amounts to a social problem. Coding is ultimately a social issue (unless you're out there grinding out 1s and 0s on cuneiform tablets) and requires social solutions.
For example, if I write 1,2,3 can you guess the next number? It could be a sequence, so answer=4, or just three numbers that happen to be 1,2,3 and the next number I need to add is 8, and later I will remove the 2 (perhaps they are hard coded user ids).
I am guessing your /a/ to /n/ structure is quite flexible. More like the latter of my example.
If you are saying WET event if it is a sequence then I'd argue that's OK if it is unlikely to change and it depends on other factors. Is there other metadata that depends on the letter for example that would benefit from the loop.
You don't know if anything will work or continue to work due to being randomly blocked or otherwise interfered with by code that either already exists or will be added tomorrow.
Basically this is just flow-based programming (FBP) in a new form.
https://en.wikipedia.org/wiki/Flow-based_programming
Every new generation of coders reaches a puberty characterized by uncontrollable excitement with multiple threads of control doing little things independently.
* But this is not strictly necessary. See also: Unix pipes, which fit the definition of flow-based programming while being possible - and in fact frequently done - with very-much-not-functional languages both implementing the individual steps and connecting them together.
I ask because if they are one in the same, then because the only way to link functions in functional programming is through function composition than functional programming is flow based programming.
For example, if I had to add a widget to a form, I could copy the implementation of an existing, similar widget and then make the necessary changes to it.
Similarly, I had to change the datatype of a field from string to integer all the way from the UI back to the database. This was fairly easy because I could make the change at one level, and then run the compiler to see what my change broke one level up. Fix, rinse, and repeat.
If I had to do any of this without access to the existing code, it would've been 100x harder.
More generally, does the claimed ease of modification come at the cost of expanding the amount of reasoning about concurrency that you have to do?
In the end, our code is complex because what we want to achieve is complex. Sure sometimes programmers add some extra complexity on top for no good reason, but there's a certain level you just can't get away from.
Moving the complexity to understanding event streams does not seem to be any improvement at all, at least as far as explained in the article. The toy examples were entirely too simple to give any real sense of how this could work in practice.
All of regular programming methodologies apply with b-threads. And most of the time changing requirements would require one to change the b-threads involved in that requirement. The append-only analogy was really more to showcase the feature of incrementality.
Technically one can develop a complicated system just via append-only but again you'll likely better off having clean b-threads that deal with specific behavior organized in specific and clean ways the same way we organize any other software.
From the comments it seems I wasn't successful at highlighting the key insights of this paradigm. One read that I suggested in this article that does a much better job at explaining these concepts is "The quest for runware: on compositional, executable and intuitive models" [1] where the authors essentially describe the need for something like Behavioral Programming (authors are the creators of BP). Some quotes from the paper:
> As mentioned earlier, it will be possible to represent new requirements, or changes thereof, in a new behavioral component or module, with minimal change to the previously specified parts of the model, and without sacrificing executability and manageability. Such modules will be simply added to the existing model, virtually ‘piled-atop’ it, with no component specific interface, connectivity, or ordering requirements.
> In our vision, the units of the specification and models are not assembled in detail like resistors or chips on a computer board, or methods and fields in an OO-programming object class. The interweaving of behavioral modules will be facilitated by their reference to common aspects of system behavior described using shared vocabularies (for example, common events), and not via mutual awareness and direct communication between components. From the point of view of such a module, the other modules could be transparently replaced by new ones. In fact, the implementation of any part of the specification or a model should be replaceable by some kind of ‘invisible box’, whose implementation remains a mystery, and the effectiveness of the remaining modules and the integrity of the overall system behavior will be preserved.
And from the conclusion:
> What will happen if and when the human way of expressing requirements for systems will become almost indistinguishable from the way this is done with computer programs? And what will be the result of a level of compositionality that would allow humans to add capabilities to a system with much less dependence on that system than is possible today?
> When a collection of specification units grows over time, accumulating an unmanageable collection of patches, exceptions, and enhancements, it is likely developers will call for merging or refactoring them into much more concise artifacts. The new modules will replace the existing collection in all its uses (final executing system, official record of the specification, and means for communication between humans) without changing other parts of the specification. Such refactoring will be acceptable, even if it ends up being done manually, as it will focus on capturing the human’s revised perception of the affected behavior.
1. http://www.wisdom.weizmann.ac.il/~harel/papers/Runware.pdf
1. Actor Model (ref: Erlang) or Communicating Sequential Processes (ref: Golang) as someone already mentioned in the comments.
2. Distributed replicated logs (ref: Kafka) acting as shared vocabulary for multiple data sources and sinks
3. D-Bus (for IPC b/w Linux processes)
4. Or any event-based system (ref: Node.js)
So there's definitely two separate threads (no pun intended) of discussion here:
1. The BP idea
2. The implementation (a la B-threads)
The BP idea's benefits can be seen, to an extent, in all the different models described above. But they also suffer from the same problems as any BP implementation:
1. Double negation[1] (as someone already mentioned in the comments)
2. If a specification change touches multiple "events" (aka shared vocabulary), it'll need refactoring across code organization units (eg. actors in Actor Model, B-theads in BP, functions/callbacks in Event-based systems, etc.) - which brings us back to the original problem of the human mind having to think of disparate execution paths to bring about spec changes in software.
Someone should probably post this on lobste.rs, which is a bit more open minded (I would, but don't have an account).
Maybe I'm missing some key insight, but this process seems like madness to me.
> Then we wouldn’t have to read and understand where to squeeze our changes. We’d simply add stuff based on the new requirements and things would somehow magically work.
But, at some point, someone has to understand if those requirements clash with the old ones that are currently implemented. The hot/cold water example is, I think, telling. At no point in the article does the author actually state what the requirements (new or old) are. You have some program that, whenever the water level gets low, adds three hot waters. I guess that was some original requirement.
Then another b-thread is added that also adds three cold waters. Now whenever the water gets low, twice as much total water is added. Presumably that's OK? When the second b-thread was added, was the requirement to fill the container with cold water instead of hot, or was it to fill the container with twice as much lukewarm water?
Finally, the third b-thread is added that interacts with the two previous ones to cause the hot and cold water adds to be interleaved. What requirement does that meet? The stated purpose of all of this is that you don't need to understand the original program to modify it, but the entire purpose of this third thread is to interact with the previous two. You have to know there are already two b-threads going, which events they listen to, and what they yield in order to create the third thread that blocks them. So I don't see how this is any better than needing to read the code in a normal program.
I feel like I'm taking crazy pills.
At one point, years into the Agile movement, we were wrapping up a very difficult meeting and I said words to the effect, "You know, we knew going into this that most of the problems in a project come from the requirements process. We have tons of studies that show that. And instead of tackling that problem, we just spent 10 years trying to get better at our part of the development process. Why did we do that? Did we think we would shame the business and management people into doing their jobs better?"
We are the drunk looking for his keys under the street light because the light is better here, instead of in the alley where we dropped them. I want another book called "the inmates are running the asylum" but about software development instead of design concerns.
And then, over time, it became clear that, for whatever reason, management just wasn't going for it. So all these different bits and bobs pivoted and morphed and re-scoped into a process by which the stone tries to squeeze more blood out of itself.
IMO, the most valuable bit of Scrum isn't user stories, or story points, or sprinting, or having a Scrum Master, or burndown charts, or anything like that. It's the idea of having a single, designated person whose job is to tell people, "no": The Product Owner.
The dirty secret is, velocity is a crap metric. It unskeptically measures total things implemented, even though we all know that only a portion - I'm guessing often less than half - of those actually needed to be implemented. Meaning that the best way to increase a product team's actual productivity isn't to increase velocity, it's to maximize the average usefulness of features being implemented. Preferably by identifying the useless and less-useful ones ones, and deciding not to implement them. Or, equivalently, identifying the ones that seem most likely to be useful given the currently available information, and making sure those are always the ones at the top of the to-do list.
My suspicion is that, the better your product manager is at that particular job, the less need there is for any of the fancy ceremonies. Because most of those ceremonies aren't there for the developers' benefit; they're really only there to make it easier for the PO to scope and prioritize features.
If the quality of your estimations has ever come up on your annual review, that's them bargaining you down by making you feel bad about yourself.
Someone in a video I watched recently pointed out that story points per week is a graph plotting time on both axes.
One of the earlier agile methodologies (FDD) had one thing figured out: the law of large numbers works just fine for long-term estimation, as long as you can identify the stories, and the range of story 'sizes' is within an order of magnitude (eg, a day vs 2 weeks). You don't have to give a shit if a story is 4 points or 7. That's a waste of everyone's time and especially energy. It's horizontal aggression condensed into a management model. We need to start refusing, as a collective, to engage. The only discussion you need to have is whether this story is less than two weeks, more than two weeks, or way more than two weeks. Those happen at a much lower frequency.
Yep I agree with that.
Although getting the development process right is critical too with all the complexity in today's web stacks etc. 20 years ago dev processes were horrible and error prone compared to today. For example if you had a word doc with the manual install steps that got printed and filled in with specific details for that customer deployment's to hand over to the team that does custom installs, you were lucky. We now have hooks from Github to deploy. That's one example.
A great deal of the problem of concurrent programming is just coming to grips with these traces, and decomposing them in a comprehensible way within the structure of your codebase.
The example with the ATM makes this clearer: by designing the system so that a trace has one clear path for a given input.
Which might not be workable for larger systems of course, but holds for certain categories of systems (like ATMs and industrial control systems).
Determinism is important, but it’s also not enough. You want some analogue of continuity / smoothness to be able to generalize observations based on one input to others that you haven’t tried.
Reminds me of a process I saw at work years ago. An employee was given an Excel macro to run on a weekly spreadsheet file. The instructions included "Unhide cells D through F". It turned out that the macro had code in it to hide cells D through F, but the employee didn't know how to just remove that code from the macro, so they had to manually undo something the code did, every single time they ran it.
Which you could do by checking the "event source" for the old commands.
I think the idea is that the system is a black box (you don't care for the implementation) and everything happens through those events, e.g. like through commands in the GoF Command pattern. By studying the existing commands issued, and by being able to interject new ones and block old ones you can change the system without caring about the implementation of those commands.
The way the overall system is described (both for the water example and the ATM) is that the system is also kind of immutable and composed of atomic facts, where e.g. a counter action -X will revert a previous +X action (e.g. if you have 3 "add hot water" commands, you can issue 3 "remove hot water" commands to cancel them out).
>Finally, the third b-thread is added that interacts with the two previous ones to cause the hot and cold water adds to be interleaved. What requirement does that meet?
Obviously to not have the water jump to hot or code by 3 units before it gets to lukewarm, but to incrementally make it lukewarm.
There's a sort of semantic shell game happening here, though. It's like:
1. Understanding the code is hard.
2. So instead we'll use these event things and you only need to understand the events.
3. And events are so great that we'll design a language around them and implement the whole program using them.
Step 3 is equivalent to step 1 now, except that instead of "statements" and "expressions" you have "events" and "yields". It's still "the code" for any meaningful definition. It's an authored system with behavior that you need to understand before you can profitably modify it. All you've gained now is that instead of textual code you can read and at least somewhat reason about statically, you have a dynamic stream of events coming from who-knows-where and you have to somehow hold the entire possible state space of them in your head in order to add new code that patches them on the fly.
> Obviously to not have the water jump to hot or code by 3 units before it gets to lukewarm, but to incrementally make it lukewarm.
Obvious to whom? What is to prevent some future maintainer from breaking that requirement when they bolt on their change?
There was clearly a previous requirement to have the water jump to cold by three units. Is that requirement null and void? How do we know?
Sure. The author doesn't communicate their idea their well, but it's an interesting suggestion (even if not practical at large). It's not far to what some protocols/systems do (though they do it at a higher abstraction that the code level).
>Obvious to whom? What is to prevent some future maintainer from breaking that requirement when they bolt on their change?
Nothing. What is to prevent some future maintainer from breaking that requirement when they bolt on their change on any other codebase? As long as one has access to source, they can break any and all kinds of contracts and requirements trivially.
>There was clearly a previous requirement to have the water jump to cold by three units. Is that requirement null and void?
That requirement (or function) never went anywhere. As the post explains, the new functionality is only triggered when the water level is low (and the old is untouched).
"The b-thread from before remains untouched. We added a new one to the right. For now there’s nothing surprising. The behavior of this program (compromised of these 2 b-threads) is that whenever “waterLevelLow” happens, we add hot 3 times and then add cold 3 times."
And no, this does not save one from understanding the rest of the code. :)