Article View: comp.lang.c
Article #1520Re: Inversion-of-control and dependency-injection in C
From: fir
Date: Fri, 13 Nov 2026 16:10
Date: Fri, 13 Nov 2026 16:10
93 lines
5898 bytes
5898 bytes
Ross Finlayson pisze: > On 11/13/2026 05:49 AM, Richard Harnden wrote: >> On 13/11/2026 13:07, Ross Finlayson wrote: >>> On 11/13/2026 04:25 AM, Bonita Montero wrote: >>>> Am 12.11.2026 um 21:11 schrieb Lew Pitcher: >>>> >>>>> Pardon my impertinence, but this sounds like a homework problem to me. >>>> Mabye that's the joke ! ;-) >>>> >>> >>> Humor is appreciated since it's part of bonnehomie and good-will, >>> it's not a joke. (The "distance learning or distance learning" >>> was a joke, about "to learn something" vis-a-vis "to learn somebody", >>> yet that's just using humor instead of stronger insults or the >>> abject sumbission of the door-mat variety of throwing self under the >>> bus.) >>> >>> >>> So, say I'm writing a usual sort of server with an idea that >>> basically it's about "protocols", mostly, so, living in a world >>> of the 7-layer OSI model, which is a pretty great abstraction and >>> all the Internet protocols basically live in that world of definition, >>> while though sometimes the network/transport then the >>> application/presentation layers gets switched and crossed, >>> point being there are systems with various accounts of moving parts >>> and then is for testing in isolation the parts moving and also >>> the moving of the parts. >>> >>> >>> Then, lots of languages make great use of "reflection", which is >>> an account of determining from the constructs their structure, >>> which one may aver that that's what parser & compilers do already, >>> and so if a C programmer needs reflection then if they're a real >>> programmer or a real coder then they'd just make their own account >>> of reflection and model the world in a model of the world, and >>> C++ it's said is getting reflection added to the giant tower of >>> what's become of its language and libraries and idiom shoehorned >>> into the language instead of libraries, or made standard, that >>> since "run-time-type-identification" for example since something >>> quite useful like "the variant data-type", sort of an "any: typed", >>> that "reflection" and "introspection" are how most of the unit-testing >>> frameworks make for inference about types then for conventions of >>> signatures to make it easy the "test-fixtures", or otherwise the >>> accounts of modularity and inversion-of-control and >>> dependency-injection, then about something like C that it's "just invoke >>> functions with data and assert(expected == actual)", that for example of >>> "the many main()'s" just exec'ing those from the test process >>> whether the tests exit(0) or exit(1), or rather as they die when >>> assert evaluates false, for example as with regards when running >>> under a debugger naturally just stopping there live in the debugger. >>> >>> >>> So, among the goals of writing frameworks or tools or tests or >>> systems, is that it works nicely with all the tools, according >>> to usually enough just the totally common standards of the toolchain and >>> the usual object files in the usual object formats on the usual >>> runtimes. >>> >>> >>> >> >> The answer is 'yes'. Or maybe 'no'. I'm not sure. >> >> What was the question? >> > > > How to design and make conventions and opinions and idiom and discipline > the inversion-of-control and dependency-injection > for the modularity and composability, in C? How do? > > For example, "what is good style in C to be idiomatic and > direct in C toward zero-cost-abstraction, while yet directly > resulting clean modular composable object-orientation in > higher-level languages to wrap and interoperate, with > modular and composable, and re-usable, and reliable, > components in C?" > in c you use dlls its reusable, reliable, modular, as far as i know is to be wrapped in hl languages, its lean ad modulat and forunatly its not OOP shit, its also probably idiomatis its direct and its about zero cost objet orientation s trash - hovever you could do it by writing some things that return handles but imo if you use handles its probably bad design (i rarely used handles - though dont ask me how to ot use handles as i donr remember when i wrota a code it just usually dont need handles (or i use it minimal way, i mean if handle is assigned immedatelly to a global variable its less dangerous/confusing)
Technical Details
Message-ID:
<11d7cr3$179m8$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com> <11d56gl$3ud5q$1@dont-email.me> <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org> <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com> <11d74hq$scu5$1@dont-email.me> <kpacnazDn8oSgGr3nZ2dnZfqn_GdnZ2d@giganews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: Inversion-of-control and dependency-injection in C Date: Fri, 13 Nov 2026 17:10:43 +0100 Organization: A noiseless patient Spider Lines: 93 Message-ID: <11d7cr3$179m8$1@dont-email.me> References: <yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com> <11d56gl$3ud5q$1@dont-email.me> <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org> <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com> <11d74hq$scu5$1@dont-email.me> <kpacnazDn8oSgGr3nZ2dnZfqn_GdnZ2d@giganews.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 13 Nov 2026 16:11:15 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1287880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aG1VNsA9cvbZUiiicaxXiwzqBZ7wzBS4="; posting-host="da7859bec363c0557c2f8c5e9a05ecef" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:VYsV74nw/zfHWgtXku3KD3FWv/U= sha256:QhSLjefRt2ku57j3P1G1SFLT3p+emUK8rbXGS4ceDAE= sha1:cI4seS839OxVH/jt6Rj6fluwmfc= sha256:rxAiH9lAoJZ4Dws78MEBLzIe1rUShvi2jCStNL3M4mY= In-Reply-To: <kpacnazDn8oSgGr3nZ2dnZfqn_GdnZ2d@giganews.com>