Earlier quoted context omitted.
depends on the likelihood of those "what if" questions. A bif chunk of good architecture is judgement: navigating the path between "building for the future" and YAGNI. It's much easier to end up at one end or the other, for example: * k8s and microservices and sharded, cached data storage and Angular and NX in case we get to internet scale.... on our internal web app with max 400 users * we're not gonna use a databas…
I was being a bit of a prick with my comment, I could've written it more clearly. Sorry for that. My point is this: what do you think is likely to happen if the requirement to write these documents is removed? a) In the absence of an impetus to justify architectural decisions, people cease creating overengineered architectures. b) People with an inclination to overengineer systems continue to do so, without documenti…
Architecture.md (2021)
51–54 of 54 posts
Re: Architecture.md (2021)
#52Earlier quoted context omitted.
What would that practically look like? How would circular dependencies be resolved, for example?
As far as I'm concerned, if you have circular dependencies between directories, you're doing something wrong (see also my top-level comment). If you're sane and have a DAG of directories, you can just toposort.
Potentially I could extract the TryFrom implementation into a 3rd file, breaking the circle, but tbh that feels like I'm doing that just for the sake for doing that, and it offers no real benefit.
In this case I see a benefit in keeping the struct and its implementation in a file, and another file with a static variable (which btw is around 600 lines, yeah it's a big array) in a separate file.
Don't follow rules blindly and try not to have absolute rules in your life, it'll make things simpler and more flexible.
Re: Architecture.md (2021)
#53Earlier quoted context omitted.
As far as I'm concerned, if you have circular dependencies between directories, you're doing something wrong (see also my top-level comment). If you're sane and have a DAG of directories, you can just toposort.
In rust I have a file that defines a struct and its implementations, then I have another file that has a static array of elements of that struct. But in the struct file, one of the implementations is a TryFrom , (which is ran when you have a variable of type usize and "cast" it into my struct) this TryFrom implementation returns the value of the nth element of the static array in the second file. I don't see anything…
Circular dependencies between directories are what's usually an indicator of something wrong.
Re: Architecture.md (2021)
#54Random thought: Every IDE I've used gives me the folder structure of the project on the left as a standard directory tree. Does any support navigating a project as a graph of dependencies?
I agree, the table of contents style is not well-suited. As part of my coding workflow, I recently started opening a terminal and running ranger inside it, and just tabbing over to that terminal to navigate the left-to-right directory structure. So have VSCode open, and open a split terminal window with the regular terminal at top, and Ranger running in the bottom pane. Midnight Commander would work as well - any TUI file explorer really.
I also have started including a “code map” in the architecture.md files of my projects. You can get a nice output by running `tree -L `, to load a markdown-embeddable tree diagram of the file structure, however many deep. I add the output to my markdown, and add a comment after each file/folder explaining what it’s for (in less than 10 words each)
Ranger - https://github.com/ranger/ranger
Midnight Commander - https://midnight-commander.org/