Readit News logoReadit News
Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
0x696C6961 · a month ago
If this is all so easy and obvious, why do all of the tools/metrics that measure software complexity suck?
Warwolt · 25 days ago
Ease of definition doesn't equate ease of measurement..
Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
sfpotter · a month ago
The author is describing less a theory and more a framework or system of heuristics bases on extensive practicap experience. There's no need for rigor if it's practical and useful. I think your desire for grounding in something "scientific" or "mathematical" is maybe missing the forest for the trees a bit. Saying this as someone with loads of practical software development experience and loads of math experience. I just don't find that rigor does much to help describe or guide the art of software. I do think Ousterhout's book is invaluable.
Warwolt · a month ago
My issues stems from me feeling like a lot of terminology introduced by the author ending up being used in different ways in different paragraphs.

It didn't feel like a thought through whole, and I felt somewhat punished for trying to read along attentively.

I also found there to be a frequent conflation of e.g. the notion of modules and a classic OOP-class, to me it seemed like the author thought of them interchangeably.

To me there's enough theoretical computer science that can be used to help ground the terminology, even if it's just introduced cursory and with a reference for further reading. But at least then there'd be more consistency.

I'm not sure I think the book is invaluable, but I think it's a good contribution to the subject.

Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
legorobot · a month ago
I think my issue with this generalization is assuming the code itself is where complexity is measured and applied.

For example, the Quake Fast Inverse Square Root[1] takes into account nuances in how floating point numbers can be manipulated. The individual operations/actions the code takes (type casts, bit shifts, etc.) are simple enough, but understanding how it all comes together is where the complexity lies, vs just looking at the graph of operations that makes up the code.

Tools like Rubocop for Ruby take an approach like you mention, measuring cyclomatic and branch complexity in your code to determine a mathematical measurement of the complexity of that code. Determining how useful this is, is another conversation I think. I usually find enforcing rules around that code complexity measurement against your code to be subjective.

Going back to the article, the visualization of with vs without abstractions can cover aggregating the mathematical representation of the code and how to tackle complexity. Abstractions lets you take a group of nodes and consider them as a single node, allowing you to build super-graphs covering the underlying structure of each part of the program.

> both syntactically and semantically

I do want to cover semantic program complexity at some point as a deeper discussion. I find that side to me to be quite interesting. How to measure it too.

[1]: https://en.wikipedia.org/wiki/Fast_inverse_square_root

Warwolt · a month ago
While the tools you talk about sound interesting, to me this was more about an in-principle possible measurement rather than something we'd actually carry out.

I think stating that "more stuff" in the program code and in the spec leads to more stuff to keep track of, and so we want to minimize complexity to maintain tractability?

Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
bccdee · a month ago
> related to mathematical theories like model theory, which give precise accounts of what it means to describe something

Perhaps too precise? APoSD is about the practical challenges of large groups of people creating and maintaining extensive written descriptions of logic. Mathematical formalisms may be able to capture some aspects of that, but I'm not sure they do so in a way that would lend real insight.

"How can I express a piece of complicated logic in an intuitive and easy-to-understand way" is fundamentally closer to writer's craft than mathematics. I don't think a book like this would ever be mathematically grounded, any more than a book about technical writing would be. Model theory would struggle to explain how to write a clear, legible paragraph.

Warwolt · a month ago
I think model theory is a really good source of theory to ground the notion of modules.

The relation between an interface and an implementation to me is very much the same as between a formal theory and a model of that theory.

I agree that in practice you'd want to use heuristics for this, but I think the benefits would be similar to learning a little bit of formal verification like TLA+, it's easier to shoot from your hip if you've studied how to translate some simpler requirements into something precise.

For a book like this you'd probably not need more than first order logic and set theory to get a sense of how to express certain things precisely, but I think making _reference to_ existing mathematics as what grounds our heuristics would've been beneficial.

Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
legorobot · a month ago
> Just taking the notion of "complexity". Reducing that to _just_ cognitive load seems to be a very poor analysis, when simple/complex ought to deal with the "size" of a structure, not how easy it is to understand.

Preface: I'm likely nitpicking here; the use of "_just_" is enough for me to mostly agree with your take.

Isn't the idea that the bulk of complexity IS in the understanding of how a system works, both how it should work and how it does work? We could take the Quake Fast Inverse Square Root code, which is simple in "size" but quite complex on how it actually achieves its outcome. I'd argue it requires comments, tests, and/or clarifications to make sense of what its actually doing.

How do we measure that complexity? No idea :) But I like to believe that's why the book takes a philosophical approach to the discussion.

I agree the arguments in the book largely "make sense" to me but I found myself finding it a little hand-wavey on it actually proving its points without concrete examples. I don't recall there being any metrics or measurements on improvement either, making it a philosophical discussion to me and not a scientific exercise.

Warwolt · a month ago
I mean, we can definitively talk about simplicity/complexity in a fairly easy way when it comes to mathematical structures or data structures in my opinion.

For instance, a binary tree that contains just a root node is clearly simpler than a binary tree with three nodes, if we take "simple" to mean "with less parts" and complex to mean "with more parts". Similarly, a "molecule" is more complex than an "atom".

This is a useful definition, I think, because when we write computer programs they always written in some programming language, with a syntax that yields some kind of abstract tree, so ultimately we'll always have _some_ kind of graph-like nature to the computer program, both syntactically and semantically, and surely graphs also permit the same kind of complexity metrics.

I'm not saying measuring the number of nodes is _the_ way of getting at complexity, I'm just pointing out that there's no real difficulty in defining it.

Complexity means more stuff, and we simply take it as a premise that we can only fit so much stuff in our head at the same time.

Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
commandlinefan · a month ago
I haven't read it myself but I probably will because I have a lot of hope for this topic (there must be a better way to do this!)

I worry that it doesn't much matter if it's perfect or mediocre, though, because there's a huge contingent of project managers who mock _any_ efforts to improve code and refuse to even acknowledge that there's any point to doing so - and they're still the ones running the asylum.

Warwolt · a month ago
I should've noted that, although I found it frustrating, I think it's a good read for most programmers. There are many excellent ideas in the book.
Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
andai · a month ago
That's very interesting. Can you recommended any resources for learning more about this?

Also, have you considered writing on this subject yourself? I get the feeling that your perspective here would be valuable to others.

Warwolt · a month ago
I'm very mathematically inclined, so I would probably want a "proper" treatment of this subject to include both formal logic, set theory, type theory and model theory, but they're also subjects I'm still familiarizing myself with.

My basic pitch is that, to a large degree writing sensible computer programs is about modeling some real life activity that the computer program will be part of, and describing things accurately has been done in other fields than programming for many hundreds if not thousands of years, so there's a deep well to draw from.

Despite my appetite for a dry and mathematical treatment of writing computer programs, I still think the book is good for what it is. I think I would go easier on the book if it were not for the title, because philosophy is precisely one of those subjects that tend to favor being very precise about things, something I distinctly think the book lacks. What the book is, however, is an excellent _sketch_ on what we'd want out of program design. I definitely agree about the author's notion of "deep modules" being desirable.

Warwolt commented on Designing Software in the Large   dafoster.net/articles/202... · Posted by u/davidfstr
Warwolt · a month ago
I found "A philosophy of software design" to be a well intended but somewhat frustrating book to read.

It seemingly develops a theory of software architecture that is getting at some reasonable stuff, but does so without any reference _at all_ to the already rich theories for describing and modeling things.

I find software design highly related to scientific theory development and modeling, and related to mathematical theories like model theory, which give precise accounts of what it means to describe something.

Just taking the notion of "complexity". Reducing that to _just_ cognitive load seems to be a very poor analysis, when simple/complex ought to deal with the "size" of a structure, not how easy it is to understand.

The result of this poor theoretical grounding is that what the author of A Philosophy of Software Design presents feels very ad-hoc to me, and I feel like the summary presented in this article similarly feels ad-hoc.

Warwolt commented on Show HN: Bolt – A super-fast, statically-typed scripting language written in C   github.com/Beariish/bolt... · Posted by u/beariish
Warwolt · a month ago
Looks nice! Is there any plans on a language server and formatting tooling?

Usually I feel like that's bare minimum before I'd like to try and play around with a language

Warwolt commented on Use Your Type System   dzombak.com/blog/2025/07/... · Posted by u/ingve
rhubarbtree · a month ago
Depends which is quicker. If I catch a trivial bug on the first run, I just saved myself writing the type system to find it ahead of time.
Warwolt · a month ago
When a bug like this can cause real world harm, we can't just bumper car program our way out of things. As engineers we should be able to provide real guarantees.

u/Warwolt

KarmaCake day95March 12, 2019View Original