6 ms·
I just wish WordPress actually adhered to development standards, not actively tried to break them. Using globals everywhere and encouraging spaghetti code with
by askonomm 2y ago
I just wish WordPress actually adhered to development standards, not actively tried to break them.
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.
- benatkin 2y agoI agree that WordPress has often failed to live up to development standards, but those aren't them, those are ones that can legitimately vary between platforms.
- zelphirkalt 2y agoThey encourage lots and lots of bad practices. I mean, just look at themes and how they are built by default. Comments in a CSS file describe the theme metadata. Using concattenation instead of composition everywhere, so that parts of HTML are not reusable. CSS, inside JS inside HTML inside PHP ... 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.
- Tijdreiziger 2y agoTheir mantra of ‘never break backwards compatibility’ is a double-edged sword. 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.
- askonomm 2y agoThat would be fine, imo. But seeing as their new development efforts (Block/Gutenberg themes) are also making horrible decisions when they no longer have to (such as putting templating markup inside of HTML comments as JSON)[1] 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/fundamentals/markup-representation-block/ https://developer.wordpress.org/block-editor/getting-started...
- photomatt 2y agoYou've got some pretty compelling arguments for why WordPress shouldn't work, it's I think even more interesting to figure out why it has. Especially on a site like HN, which has "terrible" UI and code, it even still uses single-pixel spacers! :)
- zelphirkalt 2y agoI have not looked at the code of HN. Is it public? And what parts of it are terrible? I think single pixel spacers and such things are of a different quality than the design (code) flaws brought up about WP though. Their impact is different. One merely influnces the layout of things while the other for example influence how whole themes are structured and how many pitfalls WP developers set up for themselves by writing unmaintainable code.
- talldan 2y agoI think there's some confusion in your comments. The HTML comments aren't a templating language, there's no (or little) post processing when displaying this content. 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.
- noduerme 2y agoKill the freelancer? I'm a freelancer and my favorite thing to tell cheap potential clients for the past 15 years is do their site with Wordpress and to go find a Wordpress "expert". 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.
- tomthe 2y agoWhy do you think they might be wrong when they want a simple website?
- DaSHacka 2y agoBecause then he couldn't justify why these companies should continue hiring freelancers
- sbarre 2y agoBecause most non-technical people greatly underestimate all the moving parts in a website, even a simple one. 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".
- Tijdreiziger 2y agoWordPress is simple for the user. 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.
- easyThrowaway 2y agoIf you adhere to development standards your users aren't locked in to your platform. They could move to better working, more manageable CMSes instead of begrudgingly having to pay someone or, better yet, move to your hosted solution to keep the platform from tripping on its own feet. Unfortunately that could negatively affect your "Our platform powers 43.4% of all websites" marketing pitch.
- askonomm 2y agoActually market effects these days make it so that clients themselves demand WordPress, and are unwilling to try any alternative platforms at all. So either I decline the client and make no money or have to use WP.
- deleted 2y ago[deleted]
- deerfeeder 2y agoIf I have to work with WP I always use the timber framework instead of the block/classic version https://timber.github.io/docs/v2/ https://timber.github.io/docs/v2/
- blain 2y agoI have worked with themes that used Timber and it has its own set of quirks. 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.
- n3storm 2y agoOur choice for Timber is not about consistency, is about sanity and survival.
- donatj 2y agoI am by no means a Wordpress expert, but I have had to deal with moving clients sites from time to time and I have vivid memories of hardcoded absolute file system paths in the database embedded in serialized PHP that broke when trying to move their installation to a new server with mildly different pathing.
- senadir 2y agoThe use of comments alongside the HTML was the result of a very long (and honestly very public) discussion, ultimately, it boils down to those reasons: - 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/ 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/architecture/key-concepts/ 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): https://wordpress.org/gutenberg-framework/ https://wordpress.org/gutenberg-framework/