>>915934
I spent a few weeks looking at LynxChan code for a project I've been working on for another small chan. It's absolutely disgusting.
The engine is completely spaghetti with everything calling everything else, with seemingly no pattern. This makes it really hard to refactor or fix anything.
The kernel boots if you require() (import) any part of the code. Literally any part, because any random file will probably require() a few deps which in turn will require('./kernel') somewhere, and the kernel.js file contains module-level code for starting the engine, so any time you import a piece of come (like some completely unrelated part, say engine/templateHandler), the node console explodes.
He created a language framework in LynxChan (engine/langOps) which works fine for translating strings, but then he completely threw it away when it comes to using it in templates, which makes no sense. Instead he will tell you to create a new frontend for every language you want to support.
Lynx' variable and function naming is absolute fucking trash. What is domManipulator.staticPages.page? Board index generator function. What is lang(language).startPiecePlural? "Omitted x posts". There are more than 10 instances where the variable or function name is completely unrelated to what it is. This confuses the hell out of you.
The template system is a while another world of pain. First of all it has no inheritance/extending, so you'll have to copy and paste the base template like a pajeet every single time you create a template. What do you do if you want to change something within the base template? Sergio's response is, and I quote, "just use sed" and "do it by hand".
The templates work by tokenizing certain elements on the pages on boot. These are defined in doc/, which is fine, but at least in PenumbraLynx (afaik) he uses the same casing and same naming style for special tags (with tokens) which will makes you look at that documentation piece 30 times a minute.
The templating system uses JSDOM to extract these tokens and then "validate the HTML" (lol). This prolongs boot time because "let document = new JSDOM(...);" is essentially loading a webpage in a browser, and he does this for all of the ~50 templates his engine requires.
His templating engine does not use a generic rendering function, and domManipulator is absolutely littered with "document = document.replace("some_token", someValue)":
m712@ion ~/LynxChan/src/be (git)-[master] % grep -Rn '\.replace(' engine/domManipulator | wc -l
477
I didn't take a look at the other parts of the codebase, but his domManipulator code is plagued with function chains, as in a function, that does more than one small thing will be split into 2 functions and the second function will be thrown somewhere random in the file. You'll be grepping more than you'll be editing.
And also, not only does his template system make the base template (and possibly templates extending that) duplicate for every single template, it also breaks any consistency you could think of. Go to any LynxChan instance and browse some pages while looking at the header. (This is kinda remedied by lynx adding header and footer elements now, but you still can't define document root.)
The addon system is just a monkeypatching system where you wrap functions in the engine directly. Not only will it break almost every update, it lacks any sort of API promise so what you might be doing today might break tomorrow with a commit. At least he only does a release every 6 months (lazy fuck) so you won't be fixing the code as often.
Lynx will not budge a single inch on these issues even when it's been brought up multiple times, and explained why it's bad, and with alternatives. He will always evade with "well you can do x", "my god why would you want that" and "you're complaining about trivial shit". He only ever fixed the most trivial shit I reported to him, and sometimes not even that. In fact, he thinks his codebase is "exemplar" and should be held as a good example of imageboard software, which is absolutely ironic considering Infinity Next (which I also worked on) had comparatively better code than LynxChan. I think the "not budging" thing comes from: 1. his ego and 2. his unwillingness to touch the codebase, because he secretly knows his codebase is, in fact, shit.
There's probably a whole host of other problems but these are the things I found by just looking at the templating code (I'm currently rewriting lynx' template engine to use explicit tokens like {{ token }}, and have conditionals/include/extend to use for the imageboard I talked about, I will release the code once it's done).