3 ms·
There have been many bad templating languages, but I think JSX is ok. There were many bad markup languages before Markdown, and many bad config file formats bef
by skybrian 3y ago
There have been many bad templating languages, but I think JSX is ok. There were many bad markup languages before Markdown, and many bad config file formats before JSON.
None of those are perfect, but they're good enough for many purposes.
Similarly, maybe it's not this one, but I suspect that someone will eventually get this right. I do think it does need to be properly standardized, as CommonMark did for Markdown.
- tipiirai 3y agoJSON is a terrible configuration file format. Property names must be quoted, tons of brackets and commas, a mistake comma breaks it, no comments allowed, etc..
- andyfleming 3y agoJSON5 is a more reasonable format for config files, in my opinion.
- tipiirai 3y agoI prefer YAML on my Markdown front matter. It's more readable because of no brackets, quotes, or commas.
- andyfleming 3y ago> I prefer YAML on my Markdown front matter. It's more readable because of no brackets, quotes, or commas. YAML is full of pitfalls. I think the brackets/braces and quotes are worth giving up a small amount readability to eliminate the ambiguity.
- jerbear4328 3y agoSeconding the sibling, YAML may look nice but it's absolutely full of awful confusing behavior. If you don't like JSON for human-written stuff, see TOML or the like. I think JSON is great for serialization, it's so simple, but I agree we need something more readable like TOML for human-written data. https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr...
- tipiirai 3y agoDo you convert your Markdown front matter to TOML? Also for your clients?
- skybrian 3y agoThat makes it mediocre, not terrible. There are workarounds. For terrible, see sendmail.
- zer00eyz 3y ago>>> There have been many bad templating languages, but I think JSX is ok. A bad templating language would be worlds better than JSX.... "JSX may remind you of a template language, but it comes with the full power of JavaScript". JSX is javascript. This is the very sin that PHP spent its early years getting thrown under the bus for. IF you build a rich react app, and then figure out later that you need a bunch of static, partial static late hydration pages your going to be running node/bun in production to generate those because its not like you can hand JSX to another, performant, language. And yes im aware of things like packed. The problem is JSX templates, to a large degree, are not compatible. Code in templates was bad when PHP did it, when Perl did it, it's bad now.