430 points · by fancyfish · 7y ago · 91 comments
Truly talented leaders tend to realize that high cognitive load comes from lots of places besides technical considerations too. It can be hard to think about a problem when you're also dealing with a toxic team member, untrustworthy leadership, lack of organizational focus, shitty HR policies, feeling unsafe at work, etc. Unfortunately, fighting against those elements is a never-ending battle.
Leaders that mix low cognitive load with clear direction and an interesting problem start to approach that highly-sought-after "early startup productivity" that so many companies can't seem to figure out. At least until a re-org, acquisition, or change in the c-suite comes along and blows it all up.
Just to add, this generalizes beyond just development orgs.
I've scaled out analytics orgs at a few companies, and one of the most difficult aspects is penetrating into the workflows of business functions. As a rule, most[1] business users tend to operate at a high level of cognitive load, with little in the way of support structures to reduce that. But effectively integrating operational analytics requires[2] contextualization. So more often than not, the analytics scaling acts as a forcing function to put in place the operational and process supports needed for that contextualization, which has the secondary effect of reducing the cognitive load of the end users. In more than one occasion, I've seen that secondary effect have a greater impact than the analytics itself.
[1] A major exception to this rule are tech companies and companies with technical founders. If the core of your business is a technical system, then your business functions are created as extensions of that system and you get a lot of process/structure "for free" on the business side due to that fact. And if that's not the case but you still have technical founders, those individuals will approach business functions with a process/systems-first mentality since that's how they approach technical problems. While it has it's own issues, it does lend itself to reducing the cognitive load of those functions and enabling more efficient scaling. Business leaders will take the opposite approach, where they leave the function mostly unstructured and (ideally) create process, structure, and systems based off of the emergent needs.
[2] You can certainly provide analytics deliverables without contextualization. But it won't be nearly as effective, will mostly be ignored, and will rarely actually help anything since it leaves the onus of contextualization and interpretation on the end user and therefore does nothing to reduce their cognitive load.
I do think it is possible at large companies. I've built, been part of, and talked with managers that have created teams that obviously have low load (due to how much they produce, satisfaction with work, and level of trust). But it never lasts for long. Inevitably something like Radford is implemented by HR or some VP gets the reorg itch and tears down the system because these sorts of details haven't made it into boardrooms beyond "two pizza teams". Pluralsight and Amazon are my personal experiences with large companies.
Or in other words... less intelligent people make better leaders.
On a side note, less intelligent people also write more readable code. The principle, Keep it simple stupid, aka kiss is indeed better followed by people who are described by the acronym. So in other words... A simple and stupid person is better at keeping their code and designs simple and stupid than a smart and complicated individual.
Experience and technical maturity do not equate with intelligence.
Abstractions serve one purpose and one purpose only: to reduce cognitive work load. Any abstraction above a primitive implementation only can offer added inefficiencies . Ex: SQL is less efficient than C++ which is less efficient than assembly. A zero abstraction code base is the usually the most efficient implementation and it will be written in assembly.
So from a technical standpoint, we use abstractions only to reduce cognitive workload because other than that abstractions can only offer inn-efficiencies.
Intelligent people do not put in the effort to learn about or implement proper abstractions because they usually deem it unnecessary to abstract what they perceive to be trivial cognitive workloads..
Regardless of how simple your delivered system ends up being, you still have to understand what problems you're solving and the reasons behind it. This is almost always a product of factors outside of your control.
Let's assume that in the worst case, you're going to be facing a very complex situation. Now you have three possible outcomes here when delivering.
A) Your solution is simple, because you either did not grasp (or were otherwise unaware of) the complexity of the problem, did not acknowledge it, or disregarded the severity of the problem. Or your organization's engineering culture puts pressure on you to cut corners (e.g. "Move Fast and Break Things").
B) Your solution addresses the complexity of the problem, but it was a lot of work to solve and you did not have the time or experience needed to build it in an elegant or optimally maintainable way.
C) Your solution addresses the complexity of the problem, and is built in a reasonably elegant, simple manner.
Which of these did you say correlates with intelligence again?
Edit: There's also a fourth outcome, reserved for the real rockstars out there.
D) Your solution is to not solve the problem at all, because you found a way to avoid your organization/product having to deal with the problem to begin with, or you otherwise re-assessed the assumptions surrounding the problem. The famous post from a few years ago "Why I Strive to be a 0.1x Engineer" comes to mind.
Less intelligent people are better at this because they have no choice but to do this. Less intelligent people do not have the cognitive power to design the full system so they have to resort to relying on the team to do it.
Very intelligent people tend not to do this. They rely on their own intelligence to direct the team and often times just use the team members as grunts to implement there grand designs.
No matter how smart you are, your cognitive powers will always be lower than the cognitive powers of the entire team combined, therefore any attempt to have the team follow your lead rather you following the lead of the team will be worse off.
The science supports this. Teams with leaders that empower team members are statistically more successful than teams that don't. My anecdotal observation is that these types of leaders tend to be the less intelligent types. They empower you and than get out of your way because they really don't have the intelligence to get in your way.
Here are two statistics about humanity that will lend support to my thesis. Your IQ does not correlate with how successful you will be in life, success being measured as how high you climb the corporate ladder and how much money you make as an individual. This is an actual correlation. In direct contradiction to this... the average IQ of a country highly correlates with the economic success of that country. These two statistics say something about the nature of leadership. It says that leaders succeed off the backs of people more intelligent than them.
This perspective seems based on a premise of "intelligence" being a one-dimensional scale where everybody has an absolute ranking. I think this is generally a problem with the "IQ" concept that we've all agreed on. It seems extremely oversimplified to me, at least if we want intelligence to mean something like "brain capacity".
Humans tend to construct biased logic around themselves to justify their weakness. We lie to ourselves so that we may be happier. In fact, although there is currently a crisis in the veracity of psychology papers, I recall seeing studies showing a positive correlation between how realistic a person was and how depressed he was.
I can tell you that I strive to be as unbiased as possible. I strive to remain unbiased even when it hurts. This is not a trivial skill. I have not seen anyone call themselves stupid even when they clearly are, in fact the way we lie to ourselves is so powerful that even if you are stupid, you wouldn't know it.
That being said I would say I am more intelligent then average. I don't have IQ test scores but I have data that by common sense should correlate. I went to UCLA where the admit rate for engineering 11%. By that fact, I would assume I have above normal intelligence.
I actually believe the opposite to writing unreadable code. In fact I have a bias for readability and extreme abstractions to a fault. I am a huge fan of functional programming. My observations about super intelligent people are of others not of me (note that I only believe I am higher than the average, not someone incredibly smart).
I also believe that I know what it takes to be a good leader, that's why I'm able to identify the traits that make a bad leader and thus come up with this conclusion.
Please stop trying to equate my personal experience with what I am trying to say. I present my views and opinions in a way where I strive to be impersonal. Please judge what I say with the same impassion.
>This perspective seems based on a premise of "intelligence" being a one-dimensional scale where everybody has an absolute ranking. I think this is generally a problem with the "IQ" concept that we've all agreed on. It seems extremely oversimplified to me, at least if we want intelligence to mean something like "brain capacity".
Well clearly when you have opinions about people. In your vicarious opinions you and others often make a judgement that person A is more intelligent then person B. The ranking is based off of that fuzzy general opinion and my thesis is in no way an exact law or proposition. My thesis is just a fuzzy generality that I believe is true.
Steve Jobs was not an intelligent person when compared to Woz. Yet Steve is often referred to as a genius. I don't think Woz could ever come up with the design ethos that Steve Jobs had around products and this is due in great part to Woz's higher level of general intelligence (IQ).
I ask because reading your comment leaves me with the impression that there's some conflation between intelligence & empathy + humility going on.
Right and this is in line with my statements. Less readable code by common sense will not correlate with being more useful in a work environment. Though intelligent people tend to have other benefits that allow them to excel.
>So how are you measuring intelligence to make these sorts of statements?
Anecdotal evidence. I try to be as unbiased as a biased creature can possibly be.
>I ask because reading your comment leaves me with the impression that there's some conflation between intelligence & empathy + humility going on.
I don't know where you get this from. All I am saying is intelligent people write less readable code... or vice versa That's it. I have not commented on any other factors.
Any fool can write words that any other fool can understand. Programmers write words that computers can understand.
This applies to the microservice/monolith debate as well. And it basically boils down to the observation that having lots of shallow services doesn't really reduce complexity. Each service may be simple unto itself, but the proliferation of many such services creates complexity at the next level of abstraction. Having well designed services with a simple API, but hide large amounts of complexity beneath, really reduces cognitive load for the system as a whole. And by "simple API" I think it's important to realize that this includes capturing as much of the complexity of error handling and exceptional cases as much as possible, so the user of the services has less to worry about when calling it.
[1]: https://www.amazon.com/Philosophy-Software-Design-John-Ouste...
What people forget when doing microservices, server-less, or other 'modern' ways of breaking up software into more or less independent things is that these are just variations of decades old ways of breaking stuff up. Whether you are doing OO, modules, DCOM components, or microservices, you always end up dealing with cohesiveness and coupling. Changing how you break stuff up does not change that. Breaking stuff up is a good thing but it also introduces cost depending on how you break things up.
In the case of microservices, the cost is automation overhead, deployment overhead, and runtime overhead. If your microservice is a simple thing, it might be vastly cheaper to build and run it as part of something else. I've actually gotten rid of most of the microservices and lambdas we used to have to get a grip on our deployment cost and complexity. We weren't getting a lot of value out of them being microservices. The work to get rid of this stuff was extremely straightforward.
Having just migrated a software to AWS, and seeing other project being re-engineered as lambdas, I can only related to this.
> But with the coming-of-age of IoT and ubiquitous connected services, we call them "stream-aligned" because "product" loses its meaning when you're talking about many-to-many interactions among physical devices, online services, and others. ("Product" is often a physical thing in these cases.)
Foreboding over IoT is not a strong argument against product teams. Whether it is product teams, streams, microservices, or monoliths: people have limitations on how they can maintain equilibrium and the current set of processes and tools overwhelm it at the cost of productivity.
I agree with the spirit of the argument, but I think it's counter intuitive to suggest "yet another" thought construct based on a premise of under-loading cognitive faculties.
It certainly got better in some ways, but nowhere near the military precision of a well tuned and experienced film crew.
Developer teams juggle multiple special-purpose vocabularies specific to the technology stack they use, the techniques they employ within the technology stack, the language of the domain they are encoding in software, and the language of the software solution itself.
The set of vocabularies gets expanded or swapped every time you add a person, a technology, or a new project.
Of course we're "bad" at communicating! It's a harder cognitive problem space to convey meaning in.
Conway's Law[0] says that communication will have a huge impact on most of the architecture design and roadmap itself, not just as a bottleneck.
Just considering a n parameters boolean function. You can build a simple formula around it and communicate well if there is simple pattern. For example, f(x1, x2, ...) = x1
When there is some exception? Fine, we can still talk about general pattern, while communicate particularly about the exception.
But when the mapping gets more random, at some point no one can describe it without going through each value one by one. The complexity will become O(2^n). You will spend whole day to communicate only tiny part of the function
I like the idea that human cognition has a huge impact on our lives and it certainly has. But trying to pull off a new pradigm shift on the congnition hype train is annoying.
What is true for me is that even average software and systems we build can get insanely complex. To fix it, it is just suggested to reduce the product size, train / hire people. It is absolutely not wrong, but the narrative is. If we talk about congnitive load we should look at formalism. Yes it sounds awful. But having clear rules of yay's and nay's is when designing and evolving systems can clearly reduce cognitive load, because I cannot remember all the stuff people failed at in history.
PS: Please don't mix up fomalisms with principles.
The most "correct" way I've ever seen applications divided is based on knowledge domains ala domain driven design (DDD). Drawing boundaries around the domain functionality of your business or operations means that the domain can be ignorant of other parts of your system.
We're meat bags selected for avoiding predators, telling stories around a campfire, and poking things with a stick and we're trying to reason about and craft functioning complex systems. Until the machines take over, the optimal language or architecture will be the one your team can both make sense of and employ with relative ease, full stop.
Not that there won't be tools to assist the human programmers, but the robot uprising will never occur until we can at least answer the very basic question of why will the robots care, and how exactly, in some non-hand-wavey fashion, will they get creative about solving novel problems?
Consider this: You can write a genetic algorithm maker which will randomly iterate through all possible abstract syntax tree morphs and then run a test that evaluates whether the code "performs better" as a solution to some given need, and eventually you might strike upon some novel way of solving a problem through pure randomness. But here's the thing: The ultimate arbitrator of "what is better" will always be a human and the ultimate agent of "need" is a human as well. Machines just don't "need" things, like a faster way to ray-trace so your videogame open-world simulation is more immersive, or even a nicer GUI, much less a better way to make money... People need all these things, and people evaluate whether the machine reduces those needs. Machines DNGAF.
Managing dependencies (briefly mention in the article) is even more important. In a large organization what show you down the most is having to wait for somebody else. Having autonomous teams as much as possible is part of the equation to keep a growing organization able to move fast.
That said everything else being equal (you are writing a good code, you have good engineers, etc), a monolithic system tends to be easier to debug (one stack trace is easier to debug than a trail of logs), the code base is usually easier to refactor.
Where a monolithic system makes things harder is asynchronously deploy different parts of the system and scaling different parts of the system at a different pace.
As a rule of thumb, trying to keep things in one system until it is evident where the cut should be and it is clear it is time to do it help to keep both infrastructure overhead and cognitive overload under control.
But there is no silver bullet.
Check also: http://www.codingthearchitecture.com/2014/07/06/distributed_...
If you are running things like sentry, wordpress, mediawiki, keycloak, forums etc and interconnect them in meaningful ways, that is essentially a microservices architecture.
Article gets this wrong immediately. Intrinsic should be to the characteristics of the feature being developed not about the mechanics of your tools. They are secondary brought in your solution space. It bothers me when core terms are misused making it seem not worthwhile to read on.
Nominally, languages support this, but a lot of it is still implicit. For instance, do you have a command you can point at a module of your code and get a complete report of A: what libraries this code uses and B: exactly which subset of calls from those libraries this code uses? There's so many languages and environments and IDEs and such out there I imagine the answer may be yes for a few of you, but probably not that many, and even fewer of you use it.
The primary reason I find myself moving this way is to try to make it so you can read a piece of code and the cognitive overhead is minimized, because there's a clear flow: 1. Here are my assumptions. 2. Here is my environment. 3. Here is what I do in that environment. 4. Here are the test cases that show that the thing I wanted to do is in fact done. In current languages, these things are not exactly "all mixed up", but they are not exactly cleanly separated, either.
I realize this may sound vacuous and obvious, but, err, if that's so, a lot more of us could stand to actually do it, to put it in politic terms. I think the languages and environments work against us in a lot of ways by making it very easy to add dependencies without much thought and weave all those concerns together into one big undifferentiated mass.
In the last few weeks, I've had a language coalescing in my head, which I'm not particularly happy about since I have no chance of being able to implement it, and one of the things it does is to encourage this sort of thing by making it easy. Basically, whenever importing a library, it would automatically add a layer of abstraction between your code and that library that allows you to override that library wholesale for testing purposes or something. I do this manually in a lot of languages I work in, but it involves writing a tedious layer that just takes calls to "A" in one side and routes calls to "A" out another. There's an idea of a "context" that you can pass to a module that would do this override. Basically it would be a statically-typed ability to monkeypatch, safely, and in a way where by and large, the compiler could optimize access to the "default" implementation such that you should generally not be paying an abstraction penalty. Then there would be a report that you could use the runtime tooling to generate that would tell you exactly what external functionality you're using, and you could use that to guide you in your override so you only implement what you need.
(I have a mental image of a cell, which being biologic, doesn't really do anything cleanly, but taking it metaphorically, you can see cell walls declaring the things they will allow to pass through, and with only a bit more work we can clearly declare what comes out.)
There are, of course, bits and pieces of this scattered all over the language landscape, but I'm not aware of anything that quite has everything I want in one place. (Perhaps surprisingly, Perl's "local" keyword is the closest single thing I know, albeit not written in a way that can support threading well which I'd want to fix. You can use local to override arbitrary function/method symbols, and it will be scoped within that local only, giving you that "dynamic language" monkeypatching while preventing it from being global state.)
Part of the idea of that report too is that it would be part of the documentation for a module, further increasing the ability to pick up any arbitrary module in a program, and cleanly cut away "look, this is exactly what this particular module does. You may not necessarily know what the other modules this communicates with is doing with that stuff, but at least you know what this module is doing." Again, that may sound like it's a thing that all languages already do when you bring up simplified mental model of a codebase, but think about this next time you're hip deep in code you've never seen before and you hit the thirtieth line of code and suddenly, oh crap, it just referenced another module I've never heard of.... this is when your cognitive load goes through the roof.
I have found this exact thing to be a very natural fit for functional programming. Which is also why I switched from Ruby (where I was already starting to write in a functional style anyway, for these exact reasons) to Elixir (which basically tries very hard to prevent you from writing in a non-functional style while also giving you guarantees that are simply not available in a mutable procedural/OOP language).
The vast majority of application code can be rewritten in such a way that it takes some struct or data, and spits out some struct or data, and has no other side effects (which include mutating the structs or data originally given to it). You can confine the side-effecting code to its own interface code... a principle embraced by https://blog.ndepend.com/hexagonal-architecture/ (also a natural fit for functional languages, but can also be utilized in OOP)
The advantages of this design end up being numerous: easier unit-testability, easier reasonability, easier maintainability, fewer dependencies, fewer bugs generated.
I'm not quite sure how this is different from classes. Visual Studio build out reports on call and data flow so you can easily see what calls what and what dependencies you have. You can also do neat things like see what code is dependent on a given library.
> In the last few weeks, I've had a language coalescing in my head, which I'm not particularly happy about since I have no chance of being able to implement it, and one of the things it does is to encourage this sort of thing by making it easy. Basically, whenever importing a library, it would automatically add a layer of abstraction between your code and that library that allows you to override that library wholesale for testing purposes or something. I do this manually in a lot of languages I work in, but it involves writing a tedious layer that just takes calls to "A" in one side and routes calls to "A" out another. There's an idea of a "context" that you can pass to a module that would do this override. Basically it would be a statically-typed ability to monkeypatch, safely, and in a way where by and large, the compiler could optimize access to the "default" implementation such that you should generally not be paying an abstraction penalty. Then there would be a report that you could use the runtime tooling to generate that would tell you exactly what external functionality you're using, and you could use that to guide you in your override so you only implement what you need.
C# has this feature and calls it "Microsoft Fakes" but they got a lot of vocal pushback from the TDD community who see great value in adding dependency injection and an interface to every library call you make. But boy is it useful for unit testing legacy code and reducing boiler plate required for testing.
Honestly everything you mention is available on the .NET stack.
Hah, adding a matching interface for every..single..class is something that drives me nuts! Many C# devs seem to have fallen into this trap, because "I need it for mocking". Sure, but do you actually need to mock out the dependency? IMO, overuse of mocks makes for brittle tests that are painful to maintain. I prefer only mocking "complex" dependencies.
In any case, hopefully C# 8's default interface methods will help alleviate this madness.
Well, depending on your definition of classes, I suppose. "A struct bundled together with methods for operating on it + some sort of polymorphism" on its own doesn't say anything about dependency management. But get 10 programmers together and ask for a definition of "class" and you can easily get 15 answers.
"Visual Studio build out reports on call and data flow so you can easily see what calls what and what dependencies you have."
Does it really have a report of exactly what APIs you use out of a module? I'd love to see an example of that if it's not too difficult, not because I disbelieve you, but because I'd love to see it. I know I've seen plenty of flow diagrams for what "libraries" or "modules" you use (whatever word is appropriate to your language), but knowing that you use "the AWS S3 module" is much less informative than knowing "you only use GetObject", to be specific about an example.
"C# has this feature and calls it "Microsoft Fakes" but they got a lot of vocal pushback from the TDD community who see great value in adding dependency injection and an interface to every library call you make."
I am not intimately familiar with this feature, so please do correct me if I am wrong. But I observe that according to this page: https://docs.microsoft.com/en-us/visualstudio/test/isolating... that for stubs you have to manually create an interface, and for shims you're in a situation where the code is being rewritten dynamically. I would propose making it so that all library usage is automatically an interface type created by your usage. And as it would be implemented in the language spec, rather than being done by instruction-rewrite very late in the process, it would also be something that could be built on by other things.
To be clear A: I'm well aware that I, just like everybody else, do not have any totally unique and new ideas literally never considered by anyone ever, so I am well aware that there are things like this in various bits and pieces elsewhere and B: I'm not exactly "criticizing" the .NET stack, especially with my vaporware-beyond-vaporware ideas. I'm just observing that there is an engineering difference between the things that run as instruction-level rewrites very late in the process and things integrated at the beginning. That's one of the ways Microsoft and Oracle/Java punch above the "weight" of what I'd otherwise expect from the languages in question merely on their features, and a legitimate advantage of being on their stacks, but even for something the size of Microsoft, that's where you have to stop advancing. You can't really build on that sort of tech because you can't stack that many such features together before the complexity exceeds what even those entities can deal with.
(There's also some other features in my highly vaporous vaporware language that this integrates with in some other ways, which is why I'm concerned about needing to be able to build on these features more officially than last-minute assembly rewrites.)
But here's an example of a dependency graph from ndepend(a plugin) https://www.ndepend.com/docs/visual-studio-dependency-graph You can break it up by namespace or class(I believe).
> and for shims you're in a situation where the code is being rewritten dynamically. I would propose making it so that all library usage is automatically an interface type created by your usage. And as it would be implemented in the language spec, rather than being done by instruction-rewrite very late in the process, it would also be something that could be built on by other things.
Mind explaining the advantage of auto-generating interfaces for library usage over shims? And a couple of other questions, is an interface automatically generated on compile for every exposed class? How does this work for static class usage?
I think the goals are great but addressing them at the architecture level is better, especially with tools to really take advantage of that modularity. Something like this:
https://github.com/LiveAsynchronousVisualizedArchitecture/la...
If it doesn't just go away in another couple of weeks, I think I'm going to sacrifice an evening or two to writing out the ideas and hope that satisfies my subconscious that something came of it and it's OK to drop the idea now. I mean, in some sense, the best case is to publish it, get it on to Hacker News, let it go infect someone who does have the time to deal with it, and then use their language when they're done.
I'm hoping perhaps even typing this much may do the trick...
The whole point of design is reducing cognitive load. Whenever you are looking at a given thing, you shouldn't need to keep more than about 10 things in your head to understand it completely, preferably less. Programming hardly ever blows up your brain with one fantastical concept. Instead, you're worn down with a hundred thousand cuts.
Forget X vs. Y. Cognitive load is what matters.
It will be because it involves prediction. Cognitive load is unknown. If predicting when a project will complete is hard, predicting how large and where the most cognitive load will be is going to be just as hard if not harder.
The cog load should be fairly similar weather you jave micro or monolith.
There are good and bad abstractions but in the end the cog load is a sum of the leaves and this never changes in the tree. In fact the cog load is better with bad abstraction , or no abstraction.
Hard coding is no cog load. Its in that file that function for that feature.
(Feel free to sub in "complexity", "cohesiveness", et cetera, for "cognitive load")
"...the situation is as it ever was: the stuff liked by me is rationally oriented by reasonable goals; the stuff liked by people who disagree with me is nothing but a post-hoc rationalization of their arbitrary preferences."