by askonomm · 2y ago · 0 comments
Using globals everywhere and encouraging spaghetti code with its classic themes, and with its new themes it evidently learned nothing and is encouraging JSON inside HTML comments which obviously has no editor support, is very prone to errors, besides being just plain stupid (like seriously, some senior engineers I assume decided to have templating inside HTML comments as JSON?). If I had my tinfoil hat on, it's almost as if they actively try to kill the freelancer or digital agency market and push everything to its WYSIWYG site builder on WP.com.
Part of it is this implicit structure it defines, which file it loads adter ehich other file to make a whole page. It seems convenient at first, if only you know it, but it encourages people to not properly finish all their HTML elements on the same file, but split them up stupidly and end them in other files, never to be reused.
It all seems very beginner-mistake like. But I guess they are stuck with this now, because thousands of themes rely on this, instead of having a structure based on composition. Contrast this for example with how one uses Jinja2 templates rendering blocks and macros.
It makes them extremely friendly to non-technical users, which I think is the majority of their userbase.
However, it makes it impossible for them to change technical decisions made in the past.
E.g:
<!-- wp:latest-posts {"postsToShow":4,"displayPostDate":true} /-->
<div class="posts"></div>
I've lost any faith I had in their core development teams competence. I would understand if development choices made 20 years ago weren't all that great by todays standards, and never breaking backwards compatibility would be the reason it still is bad today, but their new themes can be used independently from their old themes as an entirely different implementation, so they had a chance to finally do what is industry standard, and they chose to again make it horrible to write theme markup code that is prone to errors, has no editor support (what editor supports JSON in HTML comments?) and enforces more spaghetti to be made.[1]: https://developer.wordpress.org/block-editor/getting-started...
They're annotations that indicate where a 'block' of content starts and ends.
The JSON data stores some values set by users for a block that can't easily be parsed from the HTML content.
The content is stored as HTML as most content a user creates is static HTML, so when displaying content much of the HTML is displayed verbatim (but without the HTML comments), and then there's only a little bit of progressive enhancement for dynamic content.
I think you're also conflating some terms, like 'themes' and 'blocks', these are two different things and launched years apart.
It exists for the broke and the cheap who are under the illusion that they need a simple website, which itself is a dead letter.
I said simple websites are a dead letter, because it's no longer the 1990s. There's no cachet in them. The web is littered with simple sites that don't rank and no one ever visits. Then the owners think 'maybe I should hire SEO' or 'add a blog' and the question is "wait you built me this site, why can't you just do that for $500"? And that's why I just refer clients like that to someone who does Wordpress now. I have no interest in learning the giant pile of PHP sludge that is WP for projects that barely pay. I hardly build websites at all anymore unless they're SPAs, and only if it's functionality that can't be done with off the shelf frameworks.
To the sibling who said I'm doing this to justify being a freelancer - quite the opposite. I'm telling potential clients of a cheaper way to get what they want, and turning away work that I know is a pointless headache.
And yes some websites truly are simple and can be managed with a few Markdown pages and a static site generator (even that can be a barrier to non-technical folk), but any kind of advertising or small business website - even if it's a single page - needs the ability to be updated or managed by a non-technical person and those parts are unknown/invisible at first.
Wordpress, for all it's problems, is one possible solution that can help those people have the website they imagine or want without the sticker shock that comes with the eventual realization that their website (as a whole) is not "simple".
It’s like a lightbulb. Of course, the manufacturing of lightbulbs is a highly technical topic. However, to the user, they present a simple interface (screw it in and flip the switch).
I feel like this is a point that devs often miss. Simplicity from the POV of a user and the POV of a dev are completely different things.
The dev finds a static site generator simple, and WordPress unnecessarily complex. The user finds WordPress simple, and an SSG unusable.
I would say the main gating factor is the number of agencies and developers who can handle bigger clients including governments.
I also have an opinion that using things like Timber in WP themes just adds to the inconsistency instead of helping it. Taking over website with Timber when you never heard of it is fun.
I don't want discourage, use what you like. Just my 2 cents.
Unfortunately that could negatively affect your "Our platform powers 43.4% of all websites" marketing pitch.
- Comments exist to define a block boundary.
- JSON inside a comment exists to load up user preferences for things that can't be easily parsed from the HTML.
- HTML has to be the final result and representations, and it has to be the source of truth.
- The outcome has to be portable to any other platform or system, you can't move the website tomorrow and get a bunch `[xyz_shortcode]`.
I encourage you to read this post by one of the senior engineers who worked on the project since its inception:
https://lamda.blog/2018/04/22/the-language-of-gutenberg/
The documentation is in itself very expansive and throughout, you should give it a read:
https://developer.wordpress.org/block-editor/explanations/ar...
Gutenberg in itself is a very versatile tool and isn't locked to WordPress btw, you can build your own editor if you want (all JS, no PHP):