TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Complexity Has to Live Somewhere

324 点作者 mononcqc大约 5 年前

38 条评论

JoeAltmaier大约 5 年前
Oh this, I&#x27;ve known for years. I learned it early, as a new OS engineer at Convergent Technologies. There was a nasty part of the kernel, where programmable timers lived, that was a large part of the change history of the OS. Looking at it, I saw folks had been thrashing for some time, to get all the issues resolved. But it was a &#x27;10 lbs of feathers in a 5 lb box&#x27; kind of thing. One change would cause another issue, or regress a bug.<p>So I took 2 days, made a chart of every path and pattern of events (restarting a timer <i>from a timer callback</i>; having another time interval expire <i>while processing the previous</i>; restarting while processing <i>and</i> another interval expires; restarted timer expires <i>before completing previous expiration</i> and on and on). Then writing exhaustive code to deal with every case. Then running every degenerate case in test code until it survived for hours.<p>It never had to be addressed again. But it <i>did have to be addressed</i>. So many folks are unwilling to face the music with complexity.
评论 #23043201 未加载
评论 #23045337 未加载
评论 #23047159 未加载
评论 #23043193 未加载
评论 #23056181 未加载
UweSchmidt大约 5 年前
Complexity is often frivolously created during specification. If the true consequences of complexity (wherever it may live) were understood, we&#x27;d simplify things a lot. But they want that next button, they want ancient emails be searchable instead of having them archived, and they have no idea that their wish leads to new servers installed in a data center, new bugs introduced, and development time lost at for each new release.<p>There are also ways to design things better (or worse) with regards how they handle complexity. Reuse UI, patterns, workflows and languages. Keep things consistent, make things discoverable.<p>Point is, the slogan &quot;Complexity has to live somewhere&quot; could also be used as an excuse to do sloppy work. Then again, this keeps us all employed.
评论 #23046917 未加载
评论 #23048726 未加载
评论 #23053951 未加载
评论 #23045711 未加载
bertmuthalaly大约 5 年前
I think the conversation has shifted slightly this decade to avoiding <i>incidental</i> (accidental) complexity (I didn’t realize Fred Brooks popularized the term!), which I wish the author would address.<p>Otherwise this essay is spot on when it comes to essential conplexity.<p>Incidentally, the question of “where complexity lives” is one of the focal points of “A Philosophy of Software Design,” which comes highly recommended if you’re trying to come up with your strategy for managing complexity from first principles.
评论 #23042478 未加载
评论 #23044306 未加载
spacedcowboy大约 5 年前
Complexity is like energy, it cannot be created or destroyed, it is a fundamental property of any process or thing.<p>However, complexity can be managed. Humans do this using abstraction as a tool. We divide the complex problem up into a sequence of several simpler states, and we find it easier to understand the simpler problems <i>along with</i> the sequence within which they lie.<p>Good software uses this same approach to reduce complex issues to a manageable process. A good tool makes the simple things easy and the complex thing possible, the design of the tool reflects the effort and work that the designer out in to u the problem they’re trying to solve, and to produce something that helps guide others along that self-same path of understanding, without them having to put in the same level of effort; it establishes the golden path through the marshes and bogs of difficulties that the problem domain throws up.<p>“Embracing complexity” is a measure of last resort, IMHO. It means the tool developer could not analyze the problem and come up with a good solution; it means “here, you figure it out”; it means giving up on one of the fundamental reasons for the tools existence.<p><i>Sometimes</i>, embracing complexity and the ensuing struggle that this necessitates is simply what you have to do, but not often. Maybe, <i>maybe</i> this is one of those times, but I always start off with a critical eye when someone tells me that a complicated thing is “the only way it can be done”. Colour me sceptical.
评论 #23042891 未加载
评论 #23044082 未加载
评论 #23042851 未加载
评论 #23043351 未加载
评论 #23042584 未加载
评论 #23044387 未加载
deathanatos大约 5 年前
I wonder if the author has read <i>Out of the Tar Pit</i>[1]¹. See, in particular, section 6.<p>Essentially, the author is, I think, arguing about what the paper calls &quot;Essential complexity&quot;, complexity inherent to the problem one is trying to solve. And with that, I agree.<p>I think the author should acknowledge accidental complexity (or provide some argument as to why that must live somewhere), and I think a lot of comments here on HN are pointing out the fact that accidental complexity exists, and <i>doesn&#x27;t</i> have to live somewhere. But my guess is that that&#x27;s not what the author is saying, and that the author is only arguing about essential complexity.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;papers-we-love&#x2F;papers-we-love&#x2F;blob&#x2F;master&#x2F;design&#x2F;out-of-the-tar-pit.pdf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;papers-we-love&#x2F;papers-we-love&#x2F;blob&#x2F;master...</a><p>¹I personally found this paper somewhat mixed. The definitions of complexity are what make it worth reading. Its conclusion of &quot;functional programming languages will fix all the woes&quot; I think is not practical.
评论 #23045117 未加载
评论 #23044102 未加载
x3haloed大约 5 年前
“The trap is insidious in software architecture. When we adopt something like microservices, we try to make it so that each service is individually simple. But unless this simplicity is so constraining that your actual application inherits it and is forced into simplicity, it still has to go somewhere. If it&#x27;s not in the individual microservices, then where is it?”<p>The failing of this point is that much of what we call complexity is disorganization. Certainly, there is a fundamental level of logic in any desired system that can not be willed away with cute patterns, but to consider all complexity of an existing system to be necessary is a fallacy. Dividing systems into problem domains does not inherently reduce the total complexity of a system. It probably usually adds to it. But organizing systems this way can drastically reduce the scope of complexity into manageable pieces so that mere mortals can work on it with out having to hold the entire system in their mind at one time.<p>It’s like saying that you can’t make a garage full of junk any less complicated, because no matter how you arrange it, it will still contain all the same junk. In fact, organizing all the junk into manageable storage can make it much easier to understand, work with, sort through, clean, and identify items that may be unnecessary.
评论 #23047551 未加载
评论 #23054022 未加载
评论 #23047635 未加载
评论 #23047572 未加载
评论 #23054378 未加载
crazygringo大约 5 年前
This is a great essay.<p>Along the same lines, there&#x27;s a great quote from many years ago that I unfortunately can&#x27;t find the exact text of, but it goes like this (paraphrasing):<p>&quot;Most Microsoft Word users only use 5% of its features.&quot;<p>&quot;So why don&#x27;t we get rid of the other 95%, since it&#x27;s so bloated and complex?&quot;<p>&quot;Because each user uses a different 5%.&quot;
评论 #23042614 未加载
评论 #23043229 未加载
marcosdumay大约 5 年前
As every discussion about bullshit jobs or frontend frameworks, or hardware abstraction VMs (recently, WASM) will easily show, we are swimming in accidental complexity. And even when it&#x27;s not obvious, every general advance on science or technology is fundamentally the removal of some complexity that everybody just adapted to like if it was essential.<p>So, no, it doesn&#x27;t have to live somewhere. It can be created and destroyed, this happens every day. Probably some of it can not be destroyed, but nobody knows what part so any article about it will be useless.
slx26大约 5 年前
I don&#x27;t disagree with the message, but I&#x27;m kinda ambivalent about putting the focus on it like that.<p>&gt; We try to get rid of the complexity, control it, and seek simplicity.<p>Well, not really enough. Complexity is a beast that takes many years to understand, and that&#x27;s when you are really trying. Many devs don&#x27;t. And companies even less. So while it&#x27;s true some complexity is unavoidable, I think we still have a long way to go in being aware of it first. We write software once, and that&#x27;s not a proper strategy to manage complexity. Anyone who has looked into computers from top to bottom knows we have tons of problems with complexity that we really haven&#x27;t solved properly, and that bleed into day to day development in the ugliest ways.<p>My particular take when I don&#x27;t have the massive amount of time required to properly deal with complexity is write something like this: &quot;hey, this is very complex. please don&#x27;t touch it. if you have to, we have this much headroom. if you need to go beyond that, please rewrite this entirely &#x2F; find a better way. if the code doesn&#x27;t bite you immediately I will&quot;.
3pt14159大约 5 年前
I completely agree, and even commented the same essential idea a couple years ago here:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18774619" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18774619</a><p>One of my highest upvoted comments with 161 upvotes.<p>But I&#x27;ve come to another idea too. Part of all this complexity is dealing with change. We could simplify things if some aspects of our software hit a final point where only security updates were published after that. Imagine a programming language that was specified and actually <i>finished</i> without the constant roll of changing patterns and practices. Or a web framework. Or a database. Intentionally designed to be robust and secure from the first day then intentionally set to minimal patches for bugs and security fixes.<p>Part of the issue though is that things keep changing. New characters are added to unicode, new timezones emerge or existing ones change. It&#x27;s a hard problem to crack.
评论 #23042556 未加载
评论 #23043743 未加载
评论 #23044120 未加载
apta大约 5 年前
This is especially evident for those who used golang for non-trivial projects. Because the language has very poor support for abstractions and higher level constructs, you end up with much more verbose, brittle code that&#x27;s harder to modify and read. IMO, the language designers, by optimizing for a language that&#x27;s relatively easy to pick up* have pushed the complexity onto the programmer.<p>* Any language has its paradigms that need to be learned, and golang is no different. Just because you can learn the syntax in a couple of sittings does not mean you know how to use the language in an effective matter. Something I see many people not bring up.
评论 #23044405 未加载
评论 #23043114 未加载
评论 #23046966 未加载
ebiester大约 5 年前
This has been something living in my head for a long time, but the largest problem is that the complexity needs to live in different places for different sizes of problem. For example, for simple systems, the build tool that forces a limit to complexity might be the right one, because the exceptions will be small and well-understood. For a large system, you may have a team that is dedicated to the build tool itself, and as such the compromises are different.<p>If you are lucky, you have someone who is able to analyze the entire system, can identify all of the stakeholders, and can drive consensus when the change in abstractions is necessary, and has the budget to do it.<p>The danger is that people pick the solution for a large solution first because &quot;we will need this someday&quot; rather than waiting for the accidental complexity to build, knowing that the rework necessary to move to an intermediate system is less expensive than the cost of delay in getting the simple solution out first.<p>My dream is that we can build incremental complexity systems that could support simple solutions quickly and highly complex solutions eventually. The problem is that these are hard to build. :)
aazaa大约 5 年前
The author seems to be starting with the premise that complexity is <i>necessary</i>.<p>I&#x27;m not sure I&#x27;d agree. Some complexity exists because the effort to simplify was too great. Either cost or skill prevented the refactor. As the saying goes, &quot;sorry this letter is so long, I didn&#x27;t have time to make it shorter.&quot;<p>I&#x27;ve repeatedly found that the first iteration of a solution tends to be more complex. One culprit is that sufficient abstractions were either not recognized or not implemented. Put those abstractions in, and you simplify the system.<p>So that refactoring step after an initial solution is created is crucial and unfortunately often just not done.
评论 #23044125 未加载
评论 #23043895 未加载
JackRabbitSlim大约 5 年前
I know. Lets move it all that annoying complexity to yaml&#x2F;json&#x2F;XML config files!<p>Now look at this app I can write in 30 lines of code with this framework! Oh and 500 lines of yaml across 2 dozen files but look the &quot;code&quot; is so sleek and sexy.<p>Joking aside I think he could have at least mentioned the difference between required complexity and unneeded complexity. Ironically it seems to spawn from attempts to reduce the first type of required complexity in a lot of cases.
ken大约 5 年前
The title is catchy and it&#x27;s not <i>exactly</i> wrong. There&#x27;s an element of truth to it. And yet, 99% of the times I hear it, it&#x27;s as an excuse for crap, not some fundamental truth.<p>Dirt has to live somewhere, too. That&#x27;s a good motto for a garbage company, but if you hear a chef saying it in the kitchen while preparing your meal, you might be worried.
评论 #23044399 未加载
arendtio大约 5 年前
It is not about simplicity versus complexity. It is about creating simple abstractions that successfully hide the contained complexity.<p>When I want to search for a string within some data, I don&#x27;t want to have to think about the algorithm it uses (naive, Boyer–Moore [1], etc.). I just want to know that somebody cared about it and that it will work great.<p>Bad abstractions, on the other hand, make you think about the underlying details that you have to be aware of. For one layer that might not be too bad, but the more you build on top of such things, the more fragile the whole construct becomes.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Boyer%E2%80%93Moore_string-search_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Boyer%E2%80%93Moore_string-sea...</a>
评论 #23047208 未加载
peterwwillis大约 5 年前
It could be that your complexity is necessary, like a small widget that just has an enormous amount of variety that it has to constantly account for. Or it could be that you designed one giant widget made of 10 widgets, and a re-design could simplify how you think about and build it.<p>Simplicity is the art of taking complex things and stripping them down to their essential nature. Simple things can be complex, but no more complex than they have to be.<p>With that said, this piece talks a lot about frameworks and tools and patterns, and I really hope people don&#x27;t think that&#x27;s the right way to think about architecture. Abstractions do not make things simpler, they make them abstract.
zmmmmm大约 5 年前
While I agree with the message about essential complexity, I disagree that all complexity is essential. In fact, I think it let&#x27;s us off the hook far too easily to just claim all complexity is essential. It&#x27;s <i>easy</i> to invent complexity, in fact it&#x27;s the default. I&#x27;d go as far as to say that about 50% of the complexity in software is non-essential. And in terms of what to address, it&#x27;s a bit like paying off debt - just like you should always pay your credit card first, always start by eliminating the non-essential complexity.
Discombulator大约 5 年前
Paraphrasing the &quot;Fundamental theorem of software engineering&quot;, <i>Every problem can be solved with enough levels of indirection.</i> Every level of indirection adds complexity, so the question should be: is the additional level worth it?<p>I am fully on board with the overall sentiment of the article that there is some irreducible complexity that one cannot avoid. Often it comes straight from the business domain or entity the code is modelling, and then, sure, you cannot make it any easier, otherwise you are not solving the problem and users will be unhappy.<p>However, then the author goes too far: &gt; Accidental complexity is just essential complexity that shows its age.<p>You can absolutely add heaps of unnecessary complexity; in fact, this is almost surely what you will get by attempting to cover every possible future use case and evolution scenario, or to cater to every minor aesthetic concern (e.g., &quot;I need to be able to replace my cloud provider &#x2F; DB &#x2F; message queue &#x2F; user notification medium &#x2F; etc by changing just one line!&quot;).<p>It takes humility to admit that getting the balance &quot;right&quot; from the start is difficult, and often the only way to improve is to accept some badness now and revisit the decision later with more information.<p>The quote however seems to be saying that we (as software engineers) always get it right, just later things change and our choice does not appear right anymore. This mindset is counterproductive, as admitting flaws is the first step to improve.
darkerside大约 5 年前
Certainly you can make things more complex than they need to be (for your given use case). That is self-evident for most engineers.<p>Doesn&#x27;t that hold that the inverse must be true? In some cases, you must be able to remove complexity from the equation, without introducing it somewhere else.<p>I agree with the spirit of the post, but I think it&#x27;s eliding some of the complexity involved in identifying essential complexity.
BenoitEssiambre大约 5 年前
I find there are some concepts used to qualify complexity and data-model fit in information theory and machine learning that can also be used to think about product-market fit or software-domain fit.<p>I tried to describe them here. I&#x27;m not sure I did a good job:<p><a href="https:&#x2F;&#x2F;medium.com&#x2F;@b.essiambre&#x2F;product-market-crossfit-c09b019188f3?source=friends_link&amp;sk=5a57eddd18dd948ebb512afb40a21667" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@b.essiambre&#x2F;product-market-crossfit-c09b...</a><p>The gist:<p>Low resolution fit: The product vaguely and simply fits its market or domain.<p>High resolution fit: The product is complex and is tightly tailored to the market or domain.<p>Overfit: The product is so tightly tailored to some users that it only fits a small part of the market.<p>Underfit: The product is so generic that it’s missing important features and corner cases.<p>And then another qualifier &#x27;crossfit&#x27; which is a bit harder to grasp, inspired by cross-entropy, that has to do with whether the design language, which can be seen in some ways as &#x27;encoding&#x27; the problem, fits the domain or market well.
im3w1l大约 5 年前
Kolmogorov complexity is uncomputable. What that means in this case is that we may never be 100% sure if we have eliminated all unnecessary complexity in our programs; if we have expressed things in the simplest way. The complexity may have to live somewhere or... or there may be a simple underlying principle we have just not seen yet.
l0b0大约 5 年前
There is still a huge difference in the amount of complexity in a solution and the amount of complexity in the computer system implementing that solution. In extremely simple cases, such as implementing a mathematical formula, the solution (in the form of words or an equation) and the implementation (actual code) could be on the same size order - there is virtually no accidental complexity. For business solutions, like a shopping web site, the difference could be a factor of 10,000 or more. But that&#x27;s almost all accidental complexity, because of how organically the web and most programming languages have grown to handle cultural concepts like language, visual flow, authentication, encryption, cross-platform compatibility and so on.
rhacker大约 5 年前
I think that things only become less complex when it becomes old and reliable. Even if the internals of the thing are a fucking mess. For example, Linux, in its entirety is a complex fucking beast for its maintainers.<p>Yet for other people it&#x27;s a simple as fuck thing that accomplishes things for them and lets them move forward with getting shit done.<p>So really, it&#x27;s how you look at it.<p>The human body is so freaking complex, it is entirely possible we&#x27;ll never even understand how half of it works. Yet from another point of view we easily hire a bunch of humans to do tasks (programming, making food, yard work, etc..). And even though we don&#x27;t know how the body works, we have a simple understanding of how that body can accomplish those tasks, which is enough to move forward.
senderista大约 5 年前
I think “complexity has to live somewhere” is just the definition of essential complexity. “Accidental complexity is just essential complexity showing its age” makes no sense to me: accidental complexity is often the result of ignoring essential complexity (or using inadequate tools). One often finds that edge cases can be naturally handled by principled approaches that capture the essential complexity of a system (see: Paxos). The alternative is a naive, simplistic approach that ignores essential complexity and quickly accumulates accidental complexity in the form of workarounds for newly-discovered edge cases. In other words, most software systems.
mcqueenjordan大约 5 年前
I think I understand the point the author is trying to make, but I think they end up accidentally making too strong of a claim.<p><i>Sometimes</i> there is &#x2F;essential complexity&#x2F;, but it is far from always. I think the line of thinking espoused by the author leads to less simplification and encourages a &quot;well, the complexity has to live somewhere, so why bother?&quot; type of approach. However, reducing complexity is often possible, and it usually comes before the implementation stage. Reducing complexity sometimes means solving a different problem.
throwaway55554大约 5 年前
Of course it does. It lives in your frameworks and libraries. It lives in your container classes and threading routines. It lives in that bit of code at the core of your business rules that people are scared of.<p>If you write anything, even &quot;hello, world&quot;, complexity lives somewhere! Just the complexity of the print function path all the way to the hardware would baffle some.
hasahmed大约 5 年前
Very interesting. I&#x27;m happy I read it. I think that seeking simplicity in code for me is often trying to find the most simple and straightforward way to write the code so that I can understand it. This usually boils down to good naming, and good encapsulation of tackling specific problems into specific (ideally well named) places.
hzhou321大约 5 年前
It is nice that we recognize that there is certain amount of necessary complexity and the skill involved is complexity management. But it is a pity that we don&#x27;t recognize that 1. we can create extra complexity that often wraps around necessary complexity; 2. There is such thing that is called scope.
smitty1e大约 5 年前
If we think of model, view, controller, much of the complexity seems to be when these dimensions leak into each other.<p>Keeping them orthogonal seems the first step in the process of trading the problem for a smaller problem.<p>As TFA notes, there is a lower limit to how much complexity can be squeezed out of a system.
dasyatidprime大约 5 年前
The strategy recommended at the end with the “embrace it, give it the place it deserves” feels like the “eating your shadow” of design. It&#x27;s also what I&#x27;ve been trying to approximate most of the time, and I appreciate the representation of it here.
patkai大约 5 年前
This is one of the best titles I&#x27;ve seen this year. Reminds me of G.G.Márquez, who told how much he sweated over the first sentence. I haven&#x27;t read the post yet, but I feel the discussion has already started.
dana321大约 5 年前
C++ : Make the language complex, not the code.<p>Go : Make the language simple, make achieving a simple thing complex.<p>C : The machine is complex, be careful what you do if you overflow into the inner workings.
grensley大约 5 年前
Some complexity cannot be avoided, but that doesn&#x27;t mean that complexity is a constant and removing it in one place necessarily means that it has to go somewhere else.
sumnole大约 5 年前
The good thing is you can manage inevitable complexity with the proper balance of abstraction, tooling, and documentation.
philipswood大约 5 年前
I agree. Often good architecture amounts to finding the prettiest place to put the ugly.
crimsonalucard大约 5 年前
The fact that complexity has to exist is obvious.<p>The real question of design, especially the design and organization of computer programs, is <i>where</i> that complexity lives, and how do you organize that complexity so that it doesn&#x27;t introduce <i>extra</i> complexity.<p>Usually the way we handle this is through layers, with the initial layers being simple, the middle layers being complex and the top layers being simple again. There&#x27;s no theory about why this is better, it is just usually how it&#x27;s done and it seems to work when we can pull it off.<p>The bottom layers are your primitives and axioms. Simple building blocks. This is where designers want to create a most minimal and simple set of tools that can help facilitate unlimited complexity at the upper layers (Think a minimal set of language primitives that allow for Turing completeness)<p>The middle layers are your theorems. Different permutations and compositions of your axioms to implement things like business logic or whatever logic you want. This is where good designers should try to stuff as much complexity into as possible.<p>The Top and final layer is the interface. Something that is built to directly access the middle layer while providing an interface that is simple and more understandable from the perspective of a user. This is probably the least theoretical aspect of the stack as you have to factor in things like art and human psychology into how you build an interface.<p>A good example of this will be your phone. The primitives are assembly language instructions, RISC. The middle layer is all the code that facilitates programming and applications and the interface layer is the touch screen.<p>Note that you don&#x27;t have to look at it from a birds eye view from CPU instructions all the way to touch screen. You can zoom in and look at just a web stack: Java on the backend all the way up to react on the front end.<p>By zooming in you will see systems that violate the design principle I describe. Java as a primitive has become incredibly bloated and so has React and the javascript tool chain. There are several reasons for why this happens: Lack of planning, optimization requirements inevitably violate design principles, lack of knowledge, lack of central direction and more.<p>Either way, always remember that the ideal design that most people should strive for is complexity sandwiched by simplicity at the primitive layer and the interface layer. This goes for most things within computer programming and outside of it, like your car.
评论 #23042503 未加载
carapace大约 5 年前
One of the reasons to study category theory is that it holds out promise of a way, mathematically rigorous, to discover and describe the <i>essential</i> complexity of a task or problem.