3 ms·
What's the smallest unit of functionality to which your principle applies? For example, each comment on HN has a line on top that contains buttons like "parent
by kijin 6mo ago
What's the smallest unit of functionality to which your principle applies?
For example, each comment on HN has a line on top that contains buttons like "parent", "prev", "next", "flag", "favorite", etc. depending on context. Suppose I might one day want to remove the "flag" functionality. Should each button be its own file? What about the "comment header" template file that references each of those button files?
- sverhagen 6mo agoMaybe the buttons shouldn't be their own files, but the backend functionality certainly could be. I don't do this, but I like the idea.
- jpitz 6mo agoI think that if you continue along the logical progression of the parent poster, then maybe the smaller units of functionality would be represented by simple ranges of lines of text. Given that, deleting a single button would ideally mean a single contiguous deletion from a file, versus deleting many disparate lines.
- balamatom 6mo agoThe `comment_header` template would iterate over the files in `comment_header.d/*`, which would, admittedly, need forced sorted naming: 100_parent.template 150_context.template 200_prev_next.template 300_flag.template 350_favorite.template Looks odd with the numbering, no? But then you get the added benefit of being able to refer to them by numbers, just "100" or "300" without having to glue humanlang inflection, declension, punctuation onto identifiers that happen to be words... Some places where you can see this pattern: BASIC's explicit line numbering; non-systemd init systems.