kensanata / oddmuse6

Oddmuse wiki engine based on Perl 6 and Cro
GNU Affero General Public License v3.0
3 stars 2 forks source link

Define coding style and file structure for oddmuse6 #14

Open AlexDaniel opened 5 years ago

AlexDaniel commented 5 years ago

In oddmuse5, everything was in a single file. Having everything in the same file has downsides, of course, but there are advantages also. For example, there was definitely no issue figuring out where to look for things :)

In oddmuse6 there are currently more than 15 files (!) and more than 1000 lines of code. If you want to hack on things, do you need Changes.pm6 or Change.pm6? Storage.pm6, Save.pm6 or Edit.pm6? Lock.pm6 or Store/File/Lock.pm6? Confusing.

Also I kinda liked the natural hesitation to add more to the file… it kinda guaranteed that the project will not suffer from featuritis.

Note that I'm not arguing that everything should be in the same file, but what about having a very limited number of core files, plus a set of standard (on by default) modules?

For the record, currently many files have just one class or just one subroutine… maybe having some of these files separately is not justified.

AlexDaniel commented 5 years ago

Also, is it possible that we decide that kept pages, recent changes, editing, markdown rendering, and passwords are all optional? That is, these can and should be implemented as modules. So we'll end up with just a small core, and maybe it'd make sense to have all of the core in the same file? It will end up being really small, I think…

kensanata commented 5 years ago

Sure. I simply don’t know how to do it. I started with one Cro Route being an action and each action going into a file because somebody might want to write a different implementation. The pluggable storage backend and rendering are simply the proof of concept I deemed necessary for my own satisfaction.