News for hackers. Stuff that matters.
Re:Cyclic dependencies are evil (2013) by zaphar on Saturday January 30, 2021 @12:16PM (#25970839)
Sometimes I read conversations about software engineering concepts by career developers and I get this sense that there is this entire hidden world of other engineers that I have somehow managed never to encounter.

Every engineer I've ever met who has been doing it for more than a couple years universally decries circular dependencies. Every one of them has come to that opinion via hard won experience dealing with real world problems they encountered. And yet comments like yours reveal there are other engineers working in places where apparently the opposite is true. Whenever I see that I wonder how this sort of self sorting manages to occur.

Re:Cyclic dependencies are evil (2013) by TeMPOraL on Saturday January 30, 2021 @02:03PM (#25971883)
> Every engineer I've ever met who has been doing it for more than a couple years universally decries circular dependencies. Every one of them has come to that opinion via hard won experience dealing with real world problems they encountered.

They may not realize they have them - at runtime, in the object graph, possibly indirectly. There's little difference in principle between cycles in "static" code vs. runtime state, but we often can't express them in the former, because our languages don't specify the concept of dependency at enough granularity (and some rely on a linear compilation pass).

Re:Cyclic dependencies are evil (2013) by leoc on Saturday January 30, 2021 @07:45PM (#25974585)
The fact that computing is shot through with people who think that putting things in-band makes them go away, and that because special cases have nice properties therefore King Canute can abolish the general case with a wave of his hand, is a very large part of the problem with computing.
Re:Cyclic dependencies are evil (2013) by username90 on Saturday January 30, 2021 @04:19PM (#25973096)
I've worked with very high level engineers at Google that thought cyclic dependencies are fine. Sometimes they are just the simplest solution and trying to design abstractions to avoid it just creates a huge mess.

If you've working with Java at Google (Guice) makes you learn to hate hiding circular dependencies behind dependency injection, since your binary gets injected by some huge tree of thousands of dependencies all that can create errors or interfere with each other. And without static checking trying to reason and fix those issues becomes really hard.

I strongly prefer using the languages actual type system to create circular dependencies that you can inspect using well known tools over that any day, better have a problem you can see than hide the same problem to satisfy some tools requirement.

Re:Cyclic dependencies are evil (2013) by stingraycharles on Saturday January 30, 2021 @06:08PM (#25973960)
I have to say that in my whole career of doing Java / Clojure, Google’s SDK are one of the worst in terms of dependency hell. It’s incredibly unpleasant to work with, lots of breaking incompatibilities with libraries, etcetera.

I may sound very snarky, but it really feels like an over engineered mess and I suspect the reason they need all these dependency tricks is the fact that it’s over engineered, not necessarily that the problem they’re solving is so unique that they need circular dependencies.

Re:Cyclic dependencies are evil (2013) by username90 on Saturday January 30, 2021 @06:41PM (#25974209)
You never truly need circular dependencies, however many times letting functions at the same abstraction level call each other greatly simplifies code.
Re:Cyclic dependencies are evil (2013) by jonhohle on Saturday January 30, 2021 @04:55PM (#25973377)
I think something has been lost along the way with injection and IoC that makes using a fully functional programming language for object wiring a compelling alternative for most engineers.
Re:Cyclic dependencies are evil (2013) by hrktb on Saturday January 30, 2021 @03:57PM (#25972906)
To me, the parent is describing a functional circular dependency that we all have to live with, but when we’ll design the system it will be masqueraded in a many to many association in a third object/table and we’ll proudly say “we have no circular dependencies”.

To me both are technically true, reality is messy, and we hide the mess under imaginary constructs.

Re:Cyclic dependencies are evil (2013) by Smaug123 on Sunday January 31, 2021 @03:13AM (#25977075)
Ah, but in the functional version, the messiness is both totally explicit and trivially inspectable.
Re:Cyclic dependencies are evil (2013) by kayodelycaon on Saturday January 30, 2021 @12:35PM (#25971027)
Possible reason: selection bias. If everyone else is fine with circular dependencies or at least sees them as a necessary evil... are they going to extremely vocal about the current status quo when there they have no need to defend it?
Re:Cyclic dependencies are evil (2013) by Aeolun on Saturday January 30, 2021 @01:22PM (#25971460)
In my experience, it’s generally less experienced engineers that will happily make a clusterfuck of circular dependendies.

If a more experienced engineer does, it’s generally considered a necessary evil, but not a choice taken lightly.

Re:Cyclic dependencies are evil (2013) by ironmagma on Saturday January 30, 2021 @12:31PM (#25970985)
Some problem domains have unique characteristics. I think the closer a problem resembles nature, the more it breaks our structures we want to impose on it.
Re:Cyclic dependencies are evil (2013) by dataflow on Saturday January 30, 2021 @07:44PM (#25974580)
It's not clear the parent commenter actually needs a cyclic reference there, so I wouldn't draw any conclusions from it. Some of us don't believe it's necessary in that example.
Re:Cyclic dependencies are evil (2013) by dexwiz on Saturday January 30, 2021 @04:48PM (#25973323)
Manifolds? Locally we want everything to be a straight line, but when you zoom out far enough you see it was a circle all long.