Web development in 2023

Jamal October 28, 2023 at 19:15 11100 views 102 comments
There are more fertile forums for a discussion like this, but hey, I like it here. Plus I have a feeling there are a few developers in the TPF membership.

I've been getting back into coding, trying to update my professional skills after many years of mostly updating and fixing something that was launched in 2015 (Note: I'm not referring to TPF, which is running on someone else's software). Now I've begun to look round at the landscape again, I see things have changed.

There seems to be a split between two entirely different philosophies of application engineering. On one side we have the single page application (SPA) JavaScript frameworks like React (plus Nextjs) and Vue. These things really got going around 10 years ago, moving away from the traditional website model or MPA (multi-page application). With SPAs, different views are rendered (and actions completed) in the browser without loading a new page or refreshing, using JavaScript to invisibly communicate with the server. Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.

A whole ecosystem has developed around these frameworks (and Node), that makes using them much easier than it was back when I was building stuff. Examples of SPAs are Gmail, Netflix, Facebook, and Airbnb.

But the MPA model is still going strong. Where a server-side back-end written in Python, Ruby, PHP, or Golang is important (and this will continue to be the case for many or most complex projects), it's a lot of extra effort and maintenance headache to add another massive layer of complexity, not least because the front-end SPA that consumes the back-end's data has to be written in JavaScript/TypeScript. This is why Python, Ruby, and PHP frameworks remain popular. Examples of MPAs are Amazon and other eCommerce sites, Medium, TPF, and most websites.

And now we have things like HTMX—based on the Hypermedia Driven Application architecture (which, unlike SPAs, respects HTML)—and Hotwire/Turbo, so we can get MPAs (or at least, server-based applications) working fast and app-like from within a server-side framework without having to do lots of JavaScript.

Since things like HTMX now allow developers to build applications that feel like SPAs, I'm tempted to go down that route so I can stick primarily with Python, whose popularity is second only to JavaScript. However, JavaScript frameworks are very fashionable, and I've been trying them out. Great for small applications and sites, but a large system would be a whole other matter. That said, people have done it successfully.

Like @Michael, I've toyed with the idea of building forum software for TPF so I can bring the data and codebase under our control. I asked ChatGPT how long it would take and it gave me two answers: either 6 months to a year, or 18 months to 3 years. The latter estimate is more realistic for a full-featured (and extra-featured) forum platform. I can't dedicate that much time to it unfortunately.

(Talking of AI, I've yet to try GitHub Copilot ("Your AI pair programmer"). Looks like it could save a lot of time.)

Generally, everything is in flux. I get the impression some projects are getting into trouble because of their eager embrace of frameworks that are immature and changing in fundamental ways year after year. I've read stories from teams that built applications with React only to scrap them and start again with a server framework.

I want your thoughts. Primarily I want to know about the experiences of developers, but even if you have no idea what I've just been talking about, any thoughts about the state of web applications and websites today is welcome.

Comments (102)

Jamal October 28, 2023 at 19:25 #849170
And I don't know if it's me being old-fashioned, but there's something offensive about code like this:


export default function Blog({ posts }) {
return (


{settings.siteTitle}



    {posts.map((post, i) => (

    ))}



);
}


It's like doing classic ASP again.
baker October 28, 2023 at 20:05 #849176
Quoting Jamal
but even if you have no idea what I've just been talking about, any thoughts about the state of web applications and websites today is welcome.

I think that before doing any of the demanding technical stuff (programming and whatever else is needed), one first needs to work out a philosophy of using technology to begin with.

See Cal Newport's Digital Minimalism for more on this.
Jamal October 28, 2023 at 20:08 #849178
Quoting baker
See Cal Newport's Digital Minimalism for more on this.


What does Cal say, and why do you think it's important? Is it something like, stop scrolling through Instagram and go for a walk instead?
Leontiskos October 29, 2023 at 01:07 #849237
Quoting Jamal
Like Michael, I've toyed with the idea of building forum software for TPF so I can bring the data and codebase under our control


I used to write Ruby on Rails and Flash, among other things. This year I decided to try to brush up, so I did some things in Python and Django, with minor Javascript on the side. Then I thought it might be fun to chip away at a philosophy forum, so I grabbed Misago, which is written in Python (although the developer is going to move away from Python and towards a more Javascript-centric approach in the future). It was fine, but also underdeveloped. I looked at some other open source forum software, and eventually settled on NodeBB, which is written in NodeJS. I tinkered with that for awhile, got a working forum running with some nice bells and whistles, but had to leave it in limbo due to time constraints. After that I joined TPF.

Instead of building a forum software from scratch, why not leverage and customize an open source option? Vanilla/Plush seems decent for your purposes, but you could self-host for much cheaper if you are able to provide the technical labor. NodeBB, Vanilla, Misago, Flarum, and Discourse are some of the open source options I looked at. Using NodeBB with the Lavender theme seemed like the best option for a philosophy forum, although Misago is also very clean.

Quoting Jamal
I want your thoughts. Primarily I want to know about the experiences of developers, but even if you have no idea what I've just been talking about, any thoughts about the state of web applications and websites today is welcome.


I also noticed that the asynchronous Javascript approaches have made strong advances, where it used to be more common to have scripting languages like Ruby or Python serve the backend. Supposedly speed is king, and Ruby and Python aren't fast enough (even though the initial page load of an SPA can be quite slow).

I'm really not caught up on all of the details, but it seems like the older approach catered to a low barrier to entry, with languages like Ruby and Python being easy to learn. Now I see more emphasis on speed, scalability, and monetization. With Rails you could get a website up and running very fast, but one-off websites seem to now lean towards website builders, a CMS, or a corporate hosted solution. Robust backends are probably going to become less common, although a lot of that probably depends on what happens with phone and tablet software.

Quoting Jamal
Generally, everything is in flux.


Yes, and I think this is why static HTML/Javascript is making a small comeback. There is a greater cognizance of maintenance and updating costs. In general it seems that the magnanimity of the tech boom is behind us. Cost and monetization loom larger than they once did when we were dazzled by the novelty and the low-cost-relative-to-the-past.
Jamal October 29, 2023 at 05:00 #849247
Quoting Leontiskos
Instead of building a forum software from scratch, why not leverage and customize an open source option? Vanilla/Plush seems decent for your purposes, but you could self-host for much cheaper if you are able to provide the technical labor. NodeBB, Vanilla, Misago, Flarum, and Discourse are some of the open source options I looked at. Using NodeBB with the Lavender theme seemed like the best option for a philosophy forum, although Misago is also very clean.


Yes, it’s the best option. I was only toying with the idea of building my own from scratch because I was getting back into development and wanted a meaty project. NodeBB and Discourse are the two I like the look of most. Vanilla is good too, but I don’t want to get involved with anything PHP (I know everyone says it’s great these days but my experience was traumatic). I’d never heard of Misago. Looks great, and codewise I like it better than NodeBB and Discourse, mainly because I like the combination of Python and JavaScript. I shall try it. Thanks for the tip :up:

On the state of things now and the future, I think you're both right and wrong. It's true that the front-end frameworks are the most visible and fashionable area of web development now—even non-developers I know have heard of React—but (a) people are realizing that on big projects where there's a lot of data involved, frameworks like Rails and Django perform better and are easier to maintain, (b) many are saying that things are moving back to the server frameworks now that the speedy front-end user experience of SPAs can be achieved, and with much less hassle, and (c) most front-end applications depend on an API built with something like Django anyway, so even when React is being used, something like Django is being used too. Some would say that this is for legacy reasons, but I actually think it's because Python is so strong right now, and getting stronger. Even if Django falls out of favour, other Python frameworks like FastAPI and Flask will take over. It's a lively area, though less visible than the front-end stuff.

(In fact, you could say that the existence of the big front-end frameworks is a consequence of legacy as much or more than the continuing presence of Django and Rails: browsers only understand JavaScript and there's no way out of that right now. In software terms, browsers are old technology, in which backwards-compatibility is a big issue.)

Quoting Leontiskos
the older approach catered to a low barrier to entry, with languages like Ruby and Python being easy to learn


It's because they're good-quality languages, and because they're powerful. And if Rails and Django seem easy at first, it's because they're well-designed frameworks and have been around a long time. React, Next.js, and Ember can be confusing because their way of working is intrinsically messy. It's painfully obvious that they're immature—although things are much better than when I started using them in 2013. Serious business logic behind the API endpoints is more often implemented in Rails and Django than it is with React and Node.

And the more that asynchronous JavaScript becomes an integral part of Rails and Django development—but without using big front-end frameworks—the more I expect to see them thrive. So I don't agree that robust back-ends are on the way out except where they were never really needed.

What we see is at the level of small-to-medium websites, the server-side frameworks have lost out, and that's probably as it should be. At this level, we have (a) static site generators or primarily static sites and immediate interactivity with asynchronous CRUD to a backend API, and (b) as you mentioned, website builders like Squarespace and Wix.

Quoting Leontiskos
Yes, and I think this is why static HTML/Javascript is making a small comeback.


Yes, I started using static site generators about ten years ago, and these days they're the norm for developers' own websites. The challenge was always how to integrate them with content management, but this can be done now, and paid blogging platforms may go in that direction. If we could only get non-devs to start writing everything in Markdown instead of WYSIWYG, life would be better.

Quoting Leontiskos
There is a greater cognizance of maintenance and updating costs. In general it seems that the magnanimity of the tech boom is behind us. Cost and monetization loom larger than they once did when we were dazzled by the novelty and the low-cost-relative-to-the-past.


Indeed.
Jamal October 29, 2023 at 07:10 #849258
Some interesting charts.

User image
[sup]GitHub pull requests: https://madnight.github.io/githut/#/pull_requests/2023/2[/sup]

User image
[sup]TIOBE Index: https://www.tiobe.com/tiobe-index/[/sup]

User image
[sup]PYPL Index: https://pypl.github.io/PYPL.html[/sup]

User image
[sup]Stack Overflow survey: https://survey.stackoverflow.co/2022/#programming-scripting-and-markup-languages[/sup]

User image
[sup]Web frameworks: https://survey.stackoverflow.co/2022/#web-frameworks-and-technologies[/sup]

It's clear that JavaScript dominates in web development, as expected, but Python is so strong in general that it's obviously not going away (the rise of AI has given Python an extra boost too). And among the web frameworks Django is only just behind the front-enders and Microsoft.
Michael October 29, 2023 at 11:00 #849287
I've recently been using a Laravel backend with Inertia, React, and Tailwind for the frontend. Works really well.
Michael October 29, 2023 at 11:05 #849290
Reply to Jamal I used to think that. I always thought that HTML should just be done in HTML, not JavaScript. But then I actually tried React and Vue and quite like it. It certainly makes reactivity much easier.
Michael October 29, 2023 at 11:10 #849292
Quoting Jamal
Like Michael, I've toyed with the idea of building forum software for TPF so I can bring the data and codebase under our control. I asked ChatGPT how long it would take and it gave me two answers: either 6 months to a year, or 18 months to 3 years. The latter estimate is more realistic for a full-featured (and extra-featured) forum platform. I can't dedicate that much time to it unfortunately.


That strikes me as an overestimate. I've built business CRMs used by a FTSE 100 company in a few months.

Although I guess if you were just doing it in your spare time then it will take much longer.
Jamal October 29, 2023 at 11:19 #849293
Quoting Michael
I've recently been using Laravel with Inertia, React, and Tailwind for the frontend. Works really well.


Cool. I used to be dead against non-semantic CSS like Tailwind, but the arguments in its favour are persuasive. I think it depends what you're building. If it's content-focused, semantic makes sense, but if it's highly interactive, things like Tailwind look good.

I've been building a few things with NextJS for practice. I guess that fits in the stack roughly where Inertia does for you (I'd never heard of Intertia). Although--devil's advocate--don't you think the architecture is questionable when you're using not only two but three frameworks? (I'm not counting Tailwind since most projects use a CSS framework anyway)

Quoting Michael
I used to think that. I always thought that HTML should just be done in HTML, not JavaScript. But then I actually tried React and Vue and quite like it.


Yeh, I've been enjoying the JavaScript frameworks too, but I continue to question them.

Quoting Michael
That strikes me as an overestimate. I've built business CRMs used by a FTSE 100 company in a few months.


Not everyone can be as awesome as you. :wink:
Jamal October 29, 2023 at 11:23 #849297
Note that the question I asked ChatGPT was how long it would take to build a general purpose platform, not specifically for one group of users, so I think that's significant.
Michael October 29, 2023 at 11:30 #849299
Quoting Jamal
Cool. I used to be dead against non-semantic CSS like Tailwind, but the arguments in its favour are persuasive. I think it depends what you're building. If it's content-focused, semantic makes sense, but if it's highly interactive, things like Tailwind look good.


As someone who sucks at styling, Tailwind is a godsend. Perfect for component based frontends like React. I can see it being a pain in the ass if you just do raw HTML.

Also this is convincing.
Jamal October 29, 2023 at 11:52 #849303
Reply to Michael

Good article. As I say, I do find the arguments convincing now. But I don’t think it’s essentially about which technologies you’re using, but rather the nature of the thing you’re building. Anyway, it’s not a huge deal for me, although I don’t know if I’ll ever get over my disgust at looking at all those long strings of atomic classes.

This is a pretty balanced article.
Jamal October 29, 2023 at 12:02 #849306
Answers from ChatGPT 4 based on working on it full-time:

Building a forum with a feature set similar to Discourse from scratch, especially when learning React and Next.js concurrently, is a substantial endeavor. Here's a broad estimation of the time it might take based on various stages of development:

1. **Learning Basics (React and Next.js)**:
- **Duration**: 2-4 weeks.
- This phase includes understanding the fundamental concepts, building small projects, and becoming comfortable with the development environment.

2. **Design and Architecture Planning**:
- **Duration**: 1-3 weeks.
- Outline the features you want to implement. Decide on database structures, authentication mechanisms, state management strategies, and other foundational elements.

3. **Core Features (MVP - Minimum Viable Product)**:
- **Threads and Posts**: 2-3 weeks.
- **User Registration & Authentication**: 2 weeks.
- **User Profiles**: 1 week.
- **Basic Admin Tools (user management, basic moderation)**: 2-3 weeks.
- **Duration**: 7-9 weeks for a basic MVP.

4. **Advanced Features**:
- **Advanced Moderation Tools (post edits history, user warnings)**: 2 weeks.
- **Private Messaging**: 2-3 weeks.
- **Search Functionality**: 2 weeks.
- **Categories & Tags**: 2 weeks.
- **Notifications**: 2 weeks.
- **Duration**: 8-11 weeks.

5. **Additional Features (Common in Discourse and Similar Platforms)**:
- **Badges & User Levels**: 2 weeks.
- **Bookmarks**: 1 week.
- **Polls**: 1-2 weeks.
- **Attachments & Media Handling**: 2 weeks.
- **Duration**: 6-8 weeks.

6. **Testing, Bug Fixing, and Refinement**:
- **Duration**: 4-8 weeks.
- This is crucial. As you develop, you'll discover edge cases, usability issues, and bugs that need addressing.

7. **Data Migration and Integration**:
- **Duration**: 2-4 weeks.
- Migrating from an existing platform can present challenges, especially if the data structures differ.

8. **Deployment and Scaling**:
- **Duration**: 2-4 weeks.
- This phase includes setting up servers, handling security considerations, ensuring the platform scales with user growth, and other deployment-related tasks.

Given these broad estimations, you're looking at approximately **32-61 weeks (8-15 months)** to develop a full-fledged forum application with a feature set akin to Discourse. This time frame assumes you're working on it full-time. If it's a side project, the duration will extend accordingly.

It's crucial to note that these estimates are quite generic and can vary based on individual speed, unforeseen challenges, feature complexities, and other factors. Some developers might move faster, while others might need more time, especially when dealing with the intricacies of a forum application.


Then I said what about security:

Absolutely, security is paramount when developing any web application, especially something as user-focused as a discussion forum. Neglecting security can lead to data breaches, unauthorized access, and many other serious issues. Let's break down the key security considerations and their potential time implications:

1. **Authentication**:
- Implementing secure login mechanisms is essential. Consider using established libraries or services like OAuth or Auth0.
- **Duration**: 1-2 weeks (on top of basic user registration & authentication).

2. **Authorization**:
- Ensure that users can only perform actions they're permitted to do (e.g., only admins can delete any post).
- **Duration**: 1-2 weeks.

3. **Data Validation and Sanitization**:
- Protect against SQL injections, script injections, etc. by validating and sanitizing user input.
- **Duration**: 2-3 weeks.

4. **Secure Data Transmission**:
- Implement HTTPS across your forum to encrypt data in transit.
- **Duration**: Less than a week (but requires ongoing monitoring).

5. **Data Encryption**:
- Passwords and sensitive data should be encrypted before being stored.
- **Duration**: 1 week.

6. **Session Management**:
- Implement secure session handling to prevent session hijacking or fixation.
- **Duration**: 1-2 weeks.

7. **Rate Limiting**:
- Implement rate limiting to prevent abuse (e.g., rapid-fire login attempts or spammy post creation).
- **Duration**: 1 week.

8. **Content Security Policy (CSP)**:
- Define what resources can be loaded to protect against cross-site scripting (XSS) attacks.
- **Duration**: 1 week.

9. **Cross-Site Request Forgery (CSRF) Protection**:
- Protect your forum from CSRF attacks by implementing anti-CSRF tokens.
- **Duration**: 1 week.

10. **Regular Security Audits & Updates**:
- Tools like Dependabot can be used to stay updated with the latest security patches for your dependencies.
- **Duration**: Ongoing, but setting up monitoring and automated updates might take a day or two.

11. **Backup and Recovery**:
- Regularly back up the forum data and have a recovery plan in place for emergencies.
- **Duration**: 1-2 weeks.

Adding up these security-specific durations, you're looking at an additional **12-19 weeks** dedicated solely to security. These estimates are, again, very broad. Some tasks may take less time if you're using specific frameworks or libraries that handle them out-of-the-box. However, security is not a one-time task. It requires ongoing attention, regular updates, and occasional audits to ensure that the platform remains secure as threats evolve.

Incorporating these security considerations into the earlier timeline, you're looking at a more comprehensive project duration of approximately **44-80 weeks (11-20 months)** if undertaken full-time.


(Come on Plush, give us Markdown support please. EDIT: Plush just confirmed to me that they will only ever support BBCode, not Markdown :angry: )
Jamal October 29, 2023 at 12:10 #849309
I just realized it might be assuming I had no experience in web development, so I asked for a new estimate to take into account my experience:

Taking these adjustments into account, the comprehensive project duration might come down to roughly 25-50 weeks (6-12 months) if undertaken full-time.
Leontiskos October 29, 2023 at 16:30 #849370
Reply to Jamal - Wonderful data here, thank you. This is basically why I chose to focus on Python/Django with Javascript on the side, but I was using secondary sources and not survey data. The GitHut pull requests reflect the exact timeframe I was away from web development.

Quoting Jamal
Yes, it’s the best option. I was only toying with the idea of building my own from scratch because I was getting back into development and wanted a meaty project. NodeBB and Discourse are the two I like the look of most. Vanilla is good too, but I don’t want to get involved with anything PHP (I know everyone says it’s great these days but my experience was traumatic). I’d never heard of Misago. Looks great, and codewise I like it better than NodeBB and Discourse, mainly because I like the combination of Python and JavaScript. I shall try it. Thanks for the tip :up:


That would definitely be a meaty project, but rewarding if it could be done. Misago is the Python frontrunner, which is why it was my first choice. Unfortunately it is provided by a single developer who works on it in his spare time, but he is talented and I am sure he would appreciate help (see <this post> regarding the current plans for Misago). NodeBB and Discourse have multiple full-time developers along with the attached commercial interests, and therefore possess more stability. I agree regarding Vanilla and PHP.

A crucial factor in my considerations was long form vs short form discussion formats, as a philosophy forum requires a more long form format. A lot of the newer, asynchronous forum frameworks cater to short form discussion and phones/tablets (Discourse does not even support pagination). They are becoming a blend of forums and instant messaging, running away from phpBB in a way that strikes me as both good and bad. If the architecture is suitable one could restyle them for long form purposes, but I am not great with CSS so I wanted something compatible with long form discussion right out of the box. Plush is good on this score, and Misago looks and feels a lot like Plush.

NodeBB's architecture can support long form discussion, and there is also a prebuilt theme that matches such a use case (Lavender). I also like NodeBB because it is modular (utilizing themes and plugins) and there are lots of different people working on it and contributing. It allows a lot of customization without having to reinvent the wheel. In essence, I settled on NodeBB because it is open source, it is well-developed (commercially backed), it has a strong community, and it is compatible with long form discussion. (I am also on a budget, and I could run a small forum on Misago or NodeBB for $10 a month.)

Quoting Jamal
On the state of things now and the future, I think you're both right and wrong. It's true that the front-end frameworks are the most visible and fashionable area of web development now—even non-developers I know have heard of React—but (a) people are realizing that on big projects where there's a lot of data involved, frameworks like Rails and Django perform better and are easier to maintain, (b) many are saying that things are moving back to the server frameworks now that the speedy front-end user experience of SPAs can be achieved, and with much less hassle, and (c) most front-end applications depend on an API built with something like Django anyway, so even when React is being used, something like Django is being used too. Some would say that this is for legacy reasons, but I actually think it's because Python is so strong right now, and getting stronger. Even if Django falls out of favour, other Python frameworks like FastAPI and Flask will take over. It's a lively area, though less visible than the front-end stuff.

(In fact, you could say that the existence of the big front-end frameworks is a consequence of legacy as much or more than the continuing presence of Django and Rails: browsers only understand JavaScript and there's no way out of that right now. In software terms, browsers are old technology, in which backwards-compatibility is a big issue.)


Okay, interesting! That makes a lot of sense, and it is encouraging to me. I suppose I was extrapolating from the idea that frameworks like Next.js could create a uniform and apparently simple Javascript landscape (with the addition of Rust). I was assuming that the creation of a less complex and less layered web approach might take hold, and that even if architectural simplicity leads to certain difficulties (such as the fact that a language like Rust is unwieldy when compared with Python), these could be overcome by tools that abstract away some of the low-level idiosyncrasies for less advanced programmers, as AI is already beginning to do. But my thoughts here were largely conjectural, and I hope I am wrong. In any case, you are certainly right that a more robust backend will always be required for the most important and ambitious projects.

Quoting Jamal
And the more that asynchronous JavaScript becomes an integral part of Rails and Django development—but without using big front-end frameworks—the more I expect to see them thrive. So I don't agree that robust back-ends are on the way out except where they were never really needed.

What we see is at the level of small-to-medium websites, the server-side frameworks have lost out, and that's probably as it should be. At this level, we have (a) static site generators or primarily static sites and immediate interactivity with asynchronous CRUD to a backend API, and (b) as you mentioned, website builders like Squarespace and Wix.


Good points. You are correcting my premature thinking in helpful ways.

Thanks for your thoughts. I didn't know you were a developer. I don't think I could call myself a developer at this point, although I could get back into it fairly easily.
SophistiCat October 29, 2023 at 18:01 #849378
Not a web developer (or a pro developer) here, so don't have anything to contribute. I have a slightly off topic question though if you don't mind. I've been doing a bit of coding for study, work, or small personal projects for about as long as Python has been around, but I've always been prejudiced against it. Its use of indentation for syntax seems like a monumentally bad idea. What do you have to say for that? And are there advantages to Python beyond its use in server scripting? (I also dislike JavaScript, but in that at least I don't seem to be alone.)
Jamal October 29, 2023 at 18:08 #849380
Quoting Leontiskos
That would definitely be a meaty project, but rewarding if it could be done. Misago is the Python frontrunner, which is why it was my first choice. Unfortunately it is provided by a single developer who works on it in his spare time, but he is talented and I am sure he would appreciate help (see regarding the current plans for Misago). NodeBB and Discourse have multiple full-time developers along with the attached commercial interests, and therefore possess more stability. I agree regarding Vanilla and PHP.


It’s unfortunate that Misago isn’t more active. As things stand, I suppose it would have to be NodeBB or Discourse. I’ll install them both and try them out. I tried Discourse a while ago and quite liked it, but I didn’t pursue it. The big headache in either case will be migrating the data. My familiarity is with relational databases so I’d probably be more at home with Discourse, which uses PostgreSQL. What is certain is that neither has a big button that says “Migrate from PlushForums”.

Quoting Leontiskos
A crucial factor in my considerations was long form vs short form discussion formats, as a philosophy forum requires a more long form format. A lot of the newer, asynchronous forum frameworks cater to short form discussion and phones/tablets (Discourse does not even support pagination). They are becoming a blend of forums and instant messaging, running away from phpBB in a way that strikes me as both good and bad. If the architecture is suitable one could restyle them for long form purposes, but I am not great with CSS so I wanted something compatible with long form discussion right out of the box. Plush is good on this score, and Misago looks and feels a lot like Plush.


I’m curious: what is it about, say, Discourse, that steers things away from long-form discussion? From what I could tell when I tried it, navigating a discussion was easier than on other platforms, and it made composing long posts much more pleasurable than here (same with NodeBB: full-screen distraction-free editing, for example). Maybe I’m missing the obvious, but pagination isn’t a requirement for long-form is it? Although it occurs to me that pagination is better for SEO.

Quoting Leontiskos
Thanks for your thoughts. I didn't know you were a developer. I don't think I could call myself a developer at this point, although I could get back into it fairly easily.


I’m really just going by intuition and doing my usual contrarian thing. Sometimes it leads me in good directions. I haven’t really been a developer for years, since I was a bit stuck in maintenance with the last project I was involved with. But yeh, I’m getting back into it nicely.
Jamal October 29, 2023 at 18:37 #849383
Quoting SophistiCat
Its use of indentation for syntax seems like a monumentally bad idea. What do you have to say for that?


I think it’s great. Most code is indented anyway, even when what you actually need is curly braces. Python enforces it so it’s all you need, and readability is then assured—and improved, in my opinion. It’s never been an issue. I’ve hardly ever had problems with it when working with other people’s code, for example. Occasionally you get an ‘IndentationError’ but it’s no big deal.

Quoting SophistiCat
And are there advantages to Python beyond its use in server scripting?


I’ve only used it for web development, associated modules, and scripting, but it’s a true general purpose language and designed as such. It’s used to build many kinds of applications, for machine learning, data science, etc. Whether there are advantages beyond the obvious ease of use, flexibility, and readability, I don’t know. I don’t claim it could replace all the Java in the world. I like the way it looks and it’s a lot of fun to use.
Leontiskos October 29, 2023 at 20:01 #849395
Quoting Jamal
It’s unfortunate that Misago isn’t more active. As things stand, I suppose it would have to be NodeBB or Discourse. I’ll install them both and try them out. I tried Discourse a while ago and quite liked it, but I didn’t pursue it. The big headache in either case will be migrating the data. My familiarity is with relational databases so I’d probably be more at home with Discourse, which uses PostgreSQL. What is certain is that neither has a big button that says “Migrate from PlushForums”.


Haha - yes, I agree with all of that.

I have three instances of NodeBB running locally, one on Postgres. NodeBB was originally built with MongoDB, but it runs on Postgres just fine. That's what I deployed it on. I think that compatibility was added sometime in v2.

Quoting Jamal
I’m curious: what is it about, say, Discourse, that steers things away from long-form discussion? From what I could tell when I tried it, navigating a discussion was easier than on other platforms, and it made composing long posts much more pleasurable than here (same with NodeBB: full-screen distraction-free editing, for example). Maybe I’m missing the obvious, but pagination isn’t a requirement for long-form is it? Although it occurs to me that pagination is better for SEO.


The simple answer is that I wanted pagination, even prescinding from its SEO favorability. Infinite scroll on a long-form philosophy forum didn't seem right to me. NodeBB offers both, and individual users can even change the setting on the client side. So I'm not a great person to ask about Discourse, as I never installed it. I have it on good authority that it is a bit harder to install and consumes more resources, but those aren't deal breakers. Both platforms are robust, with more to offer than Plush. Granted, I have come to appreciate the simplicity and distraction-less nature of Plush.

I did get the vague sense that NodeBB was more open to accommodating long-form forums, perhaps because they claim to be the successor to phpBB and therefore cannot totally abandon that format. But this is a rather whimsical intuition. I also wanted the "discussion" pages to have a single-column, no frills UI that was deeply content focused, and the NodeBB Lavender theme fit that bill. I actually style my TPF client that way.

I had a lot of picky details that I wanted, and NodeBB was able to fulfill almost all of them. For example, I can set the number of upvotes a user is allowed daily, and, separately, downvotes. I can set this according to the user's post count or status if I want. I can ditch the reputation system. I can place limitations on users' ability to post (e.g. can't post twice within 10 minutes). I can have a sub-forum only visible to paying users, where the merits of internal features can be debated. Maybe Discourse can do all of that too. I am sure that larger features, such as moderation queues for new users and forward-links to replies, are available on both platforms. I will say that the NodeBB community is remarkably active and responsive (but this may also be true of the Discourse community).

Quoting Jamal
I’m really just going by intuition and doing my usual contrarian thing. Sometimes it leads me in good directions. I haven’t really been a developer for years, since I was a bit stuck in maintenance with the last project I was involved with. But yeh, I’m getting back into it nicely.


That's fair. This could be a cool way to get back into it. I do advise against starting from scratch. I had that idea until I installed Misago and started digging into the Github history. There are many more features than I had anticipated, especially when it comes to security, moderation, IP tracking, etc.—but I think ChatGPT has already given you a good sense of what is involved. Also, after I joined I realized more concretely that TPF has one thing no other philosophy forum has, and that no forum software can create: a healthy community of users. Without that, it's all just window dressing.

When I joined TPF I was thinking about these questions regarding forum software way too much, but now I'm wishing I had taken more notes. Granted, I was mostly comparing NodeBB, Misago, Plush, Xenforo, and phpBB. My knowledge of Discourse is scant.

Whatever you decide, I think a forum software would benefit from having a philosophical client. The things you guys have suggested and requested from Plush seem spot-on, and are much more thoughtful than the short-sighted requests I have seen from the business world.
Bob Ross October 29, 2023 at 20:33 #849403
Reply to Jamal

Firstly, there is no "the best" framework or languages for programming: it depends entirely on what the project is that one is developing.

Personally, for web development, I am not a big fan of using (what was traditionally) client-side languages as server-side (such as javascript with Express.js and Node.js for servers) nor newer languages (like Python with python flask) as they are slower and tend to have been been pentested much less than other, more traditional, server-side languages (like Java, PHP, etc.). The tradeoff is that they are easier to program in and they are the fad.

My philosophical approach to web projects is minimalism (viz., keep it simple stupid), compartmentalization (viz., always, always, always separate code so that it is modularized: cleaner, more scalable, easier to read, and takes up less storage), documentation (viz., always document what the heck this thing does, and pick languages and frameworks that are well-supported: easier to get people to work on the project, easier to teach them, and easier on you to develop with it), and secure (viz., don't pick the newest language, framework, or library on the block, it takes time for ethical hackers to find vulnerabilities); so I love minimalistic MVC (model-view-controller) frameworks with amazing documentation that utilize very well-known and well-established server-side languages, such as Laravel.

PHP is my favorite server-side language, as it has a long track record, great documentation, its dynamically typed but gives the option of statically typing (with type naming), and is fast.

With regards to libraries and frameworks like React and Angular, it is important to know that it all runs client-side, which adds runtime on the user's browser. Although it is beneficial to run some stuff on the client-side, to save server-side runtime, it is important not to over-bloat the client side; which I worry happens with those kinds of libraries and frameworks for a lot of projects who picked them just because they are in style right now. I would rather keep it simple, and use pre-compiled TypeScript for client-side operations, and keep it absolutely minimal to save client-side runtime.

If you are trying to revamp this website, then please do not hesitate to contact me if you need any help; as I would not mind helping out with a site like this that I enjoy using. What are you guys currently using for the client-side, server-side, query, and style-sheet languages?
Wayfarer October 29, 2023 at 22:30 #849423
Quoting Jamal
Plush just confirmed to me that they will only ever support BBCode, not Markdown


Would I be correct in saying that Plush only supports a sub-set of BBCode, i.e. not all the tags are implemented (e.g. tables)?
Jamal October 29, 2023 at 22:52 #849431
Quoting Bob Ross
Firstly, there is no "the best" framework or languages for programming: it depends entirely on what the project is that one is developing.


I agree. In my original post I was examining what I see as two competing paradigms of web development today, but it's no doubt true that solutions lie in between.

Quoting Bob Ross
newer languages (like Python with python flask)


Quoting Bob Ross
they are slower and tend to have been been pentested


Quoting Bob Ross
are the fad


Flask is older than Laravel, and Python is older than PHP. Python's most popular framework, Django, was released in 2003, before all the PHP frameworks that are still going (I think, pretty much). Django and Python have a very strong reputation for security; PHP does not (an unfortunate legacy of wilder times, no doubt, which the language has put behind it). Generally, your Python/Javascript vs. PHP/Java dualism doesn't reflect history or reality very well.

If you love PHP, cool, I have nothing against it (except bad experiences and personal taste). I'm not interested in cheerleading for anything or in anyone else's cheerleading–but let's get the facts straight.

Quoting Bob Ross
My philosophical approach to web projects is minimalism (viz., keep it simple stupid), compartmentalization (viz., always, always, always separate code so that it is modularized: cleaner, more scalable, easier to read, and takes up less storage), documentation (viz., always document what the heck this thing does, and pick languages and frameworks that are well-supported: easier to get people to work on the project, easier to teach them, and easier on you to develop with it), and secure (viz., don't pick the newest language, framework, or library on the block, it takes time for ethical hackers to find vulnerabilities); so I love minimalistic MVC (model-view-controller) frameworks with amazing documentation that utilize very well-known and well-established server-side languages, such as Laravel.


I won't argue with any of that.

Quoting Bob Ross
With regards to libraries and frameworks like React and Angular, it is important to know that it all runs client-side, which adds runtime on the user's browser. Although it is beneficial to run some stuff on the client-side, to save server-side runtime, it is important not to over-bloat the client side; which I worry happens with those kinds of libraries and frameworks for a lot of projects who picked them just because they are in style right now. I would rather keep it simple, and use pre-compiled TypeScript for client-side operations, and keep it absolutely minimal to save client-side runtime.


Yes, and from a development perspective the front end frameworks can be so bloated, it takes discipline and coordination to keep things under control. But when the aim is a speedy responsive user experience, and given that browsers are powerful enough for the job, SPAs can be a good choice. But I see where you're coming from and as I said in the OP, I believe it's becoming possible now to achieve the superior user experience from within server frameworks like Laravel and Django, but without adding a whole Javascript framework to the mix.

So despite your odd view of Python, we kind of agree.

Quoting Bob Ross
If you are trying to revamp this website, then please do not hesitate to contact me if you need any help; as I would not mind helping out with a site like this that I enjoy using.


Thanks Bob.

Quoting Bob Ross
What are you guys currently using for the client-side, server-side, query, and style-sheet languages?


As mentioned in the OP and the ensuing discussion, I'm not hosting TPF myself and I don't have any control of the code. It's hosted by PlushForums, built on Vanilla, which you'll be happy to know is written in PHP :grin:
Jamal October 29, 2023 at 22:58 #849434
Quoting Wayfarer
Would I be correct in saying that Plush only supports a sub-set of BBCode, i.e. not all the tags are implemented (e.g. tables)?


I don't know. Last I checked, Plush documentation was virtually non-existent. You must be right though.
Wayfarer October 29, 2023 at 23:00 #849435
Reply to Jamal I looked up the documentation on BBCode, it's pretty basic, but I think Plush only implements a minimal set of tags. No worries, I was just wondering if there might be anything I could add to the User Tips and Tricks in that regard, but probably not.
Jamal October 29, 2023 at 23:03 #849437
Reply to Wayfarer I know there are some things that don't have associated text box button icons, like [sup]sup[/sup] for superscript.
Jamal October 29, 2023 at 23:05 #849438
Reply to Leontiskos

:up:

Will respond tomorrow.
Leontiskos October 29, 2023 at 23:39 #849445
Quoting Wayfarer
Would I be correct in saying that Plush only supports a sub-set of BBCode, i.e. not all the tags are implemented (e.g. tables)?


Yes, but this is not so unusual. I have never used a BBCode editor that supports all possible BBCode tags.
Bob Ross October 30, 2023 at 00:33 #849457
Reply to Jamal

Hello Jamal,

Flask is older than Laravel, and Python is older than PHP.


Fair enough.

From my experience, I have seen python being used as a server-side language only relatively recently (but perhaps I just haven’t been around the right groups of people who love Python). Originally, people (as far as I know) used Java, C#, and PHP. If someone was running a website, it was most likely PHP or Java (and not Python). If python was used for web servers before PHP/Java (like Django) in a stable fashion, then I am simply unaware of it and will have to read up on that.

I still think Python isn’t the greatest language for a server-side language, but we can just agree to disagree on that.

Django and Python have a very strong reputation for security; PHP does not (an unfortunate legacy of wilder times, no doubt, which the language has put behind it)


I am not familiar with Django (unfortunately), but I see PHP progress as providing ample evidence of it being thoroughly abused and tested by the community. I doubt, although I haven’t looked yet, that Django doesn’t or hasn’t fallen prey to most (if not all) of what PHP has. If Django has been a stable web server framework since 2000s (with its fair share of CVEs and community testing), then I think it meets my criteria of having a good track record; although I wouldn’t use it since it runs Python as its server-side language (:

I will have to checkout Django sometime though. Is it minimalistic or bloated?


As mentioned in the OP and the ensuing discussion, I'm not hosting TPF myself and I don't have any control of the code. It's hosted by PlushForums, built on Vanilla, which you'll be happy to know is written in PHP :grin:


Interesting!
Jamal October 30, 2023 at 06:42 #849506
Quoting Leontiskos
NodeBB was originally built with MongoDB, but it runs on Postgres just fine. That's what I deployed it on. I think that compatibility was added sometime in v2.


Great, I didn't realize.

Quoting Leontiskos
The simple answer is that I wanted pagination, even prescinding from its SEO favorability. Infinite scroll on a long-form philosophy forum didn't seem right to me. NodeBB offers both, and individual users can even change the setting on the client side. So I'm not a great person to ask about Discourse, as I never installed it. I have it on good authority that it is a bit harder to install and consumes more resources, but those aren't deal breakers. Both platforms are robust, with more to offer than Plush. Granted, I have come to appreciate the simplicity and distraction-less nature of Plush.


Aside from wanting to control the data and code, I'd actually be perfectly satisfied with the way Plush works with just a few changes, like better tools for moderation, "zen mode" post composing, Markdown support, dark mode, and ignore lists. (I know that for dark mode I could just use Stylebot as you suggest, but this is about built-in functionality; as admin I need to see what most people see).

Quoting Leontiskos
I had that idea until I installed Misago and started digging into the Github history. There are many more features than I had anticipated, especially when it comes to security, moderation, IP tracking, etc.—but I think ChatGPT has already given you a good sense of what is involved.


I know what you mean. At first when you think of how to build a forum it seems easy, but there's a lot more to it.

Quoting Leontiskos
Also, after I joined I realized more concretely that TPF has one thing no other philosophy forum has, and that no forum software can create: a healthy community of users. Without that, it's all just window dressing.


This is what makes a decision to move to another platform a big and difficult one. Incidentally, it always sounds odd to me when I see people saying that discussion forums are dead (because Reddit, social media, and Discord). I guess my experience is not normal.

Quoting Leontiskos
Whatever you decide, I think a forum software would benefit from having a philosophical client. The things you guys have suggested and requested from Plush seem spot-on, and are much more thoughtful than the short-sighted requests I have seen from the business world.


:up:

Although the Plush folks assure me that PlushForums will be maintained for the foreseeable future, they don't seem very interested in adding new features, perhaps because they've been putting most of their efforts into their new platform https://insta.forum/ (totally moving away from long-form, so not suitable for us).
Jamal October 30, 2023 at 07:15 #849509
Quoting Bob Ross
From my experience, I have seen python being used as a server-side language only relatively recently (but perhaps I just haven’t been around the right groups of people who love Python). Originally, people (as far as I know) used Java, C#, and PHP. If someone was running a website, it was most likely PHP or Java (and not Python). If python was used for web servers before PHP/Java (like Django) in a stable fashion, then I am simply unaware of it and will have to read up on that.


Just to set the record straight...

There were three things you said or implied that I took objection to: (1) that Python is a new language or at least a new language for web development, (2) that Python and/or Python frameworks have not been properly tested and are unstable or insecure, and (3) that PHP belongs in the same language ballpark as Java.

What I did not claim is that Python was used in web development before PHP was; as far as I know the Django guys were the first to use it to build websites. But twenty years (since Django was released) is a decent length of time, and its record is very good. And yes, PHP has always been more popular as a way of building websites.

Regarding (3), you could just as easily classify things like this: Java and Python are general purpose languages that can do anything, and on the other side you have PHP and JavaScript, which are just scripting languages. (But I'm not making value judgements here, just illustrating different ways of looking at it)

Quoting Bob Ross
I will have to checkout Django sometime though. Is it minimalistic or bloated?


It's a difficult question to answer without knowing what you mean, but depending on which way you look at it, it's both. Flask, on the other hand, is certainly minimalist. But Django adheres strongly to conventions and paradigms, such as DRY, and the separation of concerns of MVC (although they use different nomenclature and slightly different structure, namely model-view-template), so it's a good coding experience. Things never got messy for me in Django, as they definitely did when I was building in JavaScript frameworks.

But since you don't like Python, there's little point in wasting your time on it. And PHP these days seems to be significantly faster than Python (that's what they say at least, though whether this results in faster websites and web applications is another matter). So I say, enjoy your PHP :cool:
Outlander October 30, 2023 at 07:17 #849511
Quoting Jamal
With SPAs, different views are rendered (and actions completed) in the browser without loading a new page or refreshing, using JavaScript to invisibly communicate with the server. Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.


I abhorred these things when they first came out. If your internet is not good or perhaps is throttled due to reaching an allotted usage level, nothing would ever load and worse never told you it didn't. They seemed to have improved it by forcing a manual redirect/better fail-safes in more robust frameworks but there was nothing like clicking a link or performing an action and the browser itself telling you "hey it failed" right when it did so you knew to refresh or try again later. Just my 2 cents.

Sure it was nice if say you had a website that served another function other than a forum and the user can dynamically load the latest forum posts if they wanted to without having to pull double queries from the site and the forum database for efficiency or a site like Twitter or stocks that benefit from instant updates or things that change from one second to the next.

edit: On an active forum makes sense, so any new posts/threads just pop up a few seconds after they're posted. But for a niche blog site, especially authored by just one or two people where the only new content is posted every other day or few days is really not needed imo. but people like knowing they have all the latest shiny bells and whistles, even if seldom used.
Jamal October 30, 2023 at 07:54 #849513
Quoting Outlander
I abhorred these things when they first came out. If your internet is not good or perhaps is throttled due to reaching an allotted usage level, nothing would ever load and worse never told you it didn't. They seemed to have improved it by forcing a manual redirect/better fail-safes in more robust frameworks but there was nothing like clicking a link or performing an action and the browser itself telling you "hey it failed" right when it did so you knew to refresh or try again later. Just my 2 cents.


Yep, although as you say, frameworks are dealing with that now, but I think it still partly depends on the willingness of developers to provide for it, as with accessibility more generally.
Michael October 30, 2023 at 08:55 #849518
Quoting Jamal
Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.


Code splitting is easy so this isn’t a problem.
Jamal October 30, 2023 at 09:03 #849521
Reply to Michael :up: Yep, I was just describing an aspect of SPAs as commonly conceived. I said "often", probably going for "hitherto".
Outlander October 30, 2023 at 09:51 #849529
Reply to Jamal

Which websites for example offer this truly "one page" browsing in entirety?

Where you visit example.com and every action or section never changes the URL regardless of the intricacy or specificity of the action?

Most all I've seen redirect to certain URLs (say example.com/billing or example.com/billing/pay) but load (presumably blank) templates for each URL section that are then filled with the specific information via JS or "SPA" if I understand the term correctly. At the very least a /terms or /about page. I can't recall a single website that operates as you describe, unless I'm misunderstanding the concept.
Jamal October 30, 2023 at 10:02 #849531
Reply to Outlander

https://mail.google.com/

SPAs still use changing URLs, which in this context are called routes, corresponding to route handlers in the JavaScript. The page itself is not loaded.
flannel jesus October 30, 2023 at 10:07 #849532
Quoting Outlander
Which websites for example offer this truly "one page" browsing in entirety?

Where you visit example.com and every action or section never changes the URL regardless of the intricacy or specificity of the action?


Actually, these SPAs have the ability to change the URL without actually loading a new page. One of the most common SPA Frameworks is REACT, and there's a package called React Router that allows the frontend code to both detect and change the current URL without actually loading a new web page.

Because if this, you've most likely visited websites which were SPAs but which you couldn't tell were.

According to one article I found, Gmail slack Trello Netflix and grammarly are all SPAs.

It should be noted that these websites don't actually operate with only one http route, but they do only need one route dedicated to serving the frontend resources. They still need many routes to serve data to the one single frontend.
Jamal October 30, 2023 at 10:28 #849535
Reply to Outlander

Quoting Jamal
https://mail.google.com/


Quoting flannel jesus
Gmail slack Trello Netflix and grammarly


I was just thinking about the sites and applications I use, and thought of some more: Rome2Rio, Google Maps, Airbnb (edit: just to be clear, I mean the browser applications/websites, not the phone apps).
flannel jesus October 30, 2023 at 10:59 #849536
Reply to Jamal I'm a software engineer. If you need any guidance or advice for this project, let me know. I haven't done any full fledged SPAs but I've done mini SPAs and I know what goes into designing a backend.
Jamal October 30, 2023 at 11:08 #849537
Reply to flannel jesus Thanks FJ, so far there is no project but it’s good to know there are people here to help :up:
Outlander October 30, 2023 at 11:10 #849539
Reply to Jamal

Well sure, but what is an email web client but a collection of notes, albeit most sent by others and to and fro. If you do anything but opening a note or adding to it (responding to an e-mail) say, changing account settings it does a full redirect to a different URL.

See, right now, my internet is throttled (or something) and I can't even access the Help (?) or Settings (gear icon) button no matter how many times I click the damn thing. You can't even right click it and get the actual URL to open in a new tab because it's too busy loading 50 different things I DON'T EVEN NEED AT THE MOMENT OF ACCESS. LOL. Come on. See my perspective.

Oh look now it just opened. And I STILL CAN'T CLICK A LINK UNDER THE SUB MENU. Nor can I right click it!!

I'm grateful you don't experience what I do. But for the many who do. It's a nightmare. And it's still happening. lol

oh look now i'm offline. see. it's frustrating. and this is the largest company in the world. very annoying. like i were an anti-humanist trying to piss technology users/computer people off. i could not think of a better way. just saying.
Jamal October 30, 2023 at 11:20 #849541
Quoting Outlander
Well sure, but what is an email web client but a collection of notes, albeit most sent by others and to and fro. If you do anything but opening a note or adding to it (responding to an e-mail) say, changing account settings it does a full redirect to a different URL.


Gmail settings will not load a new page. Google account settings will take you to an entirely different website. Otherwise, I'm not sure what you mean; there's a lot of functionality in Gmail. I suspect the kind of example you're looking for is a traditional website model, but rendered as an SPA. Something like https://nextjs.org/docs is a good example. Not sure how it works over bad internet though.
Michael October 30, 2023 at 11:53 #849546
Reply to Jamal You might prefer Svelte.
Jamal October 30, 2023 at 12:11 #849549
Reply to Michael

Maybe. Looks interesting...

User image
Jamal October 30, 2023 at 12:26 #849554
So, Svelte is obviously doing a lot more magic than React, and I guess is more opinionated. Opinionated magic in frameworks has its pros and cons.
flannel jesus October 30, 2023 at 12:51 #849562
Reply to Jamal I agree. I like magic most when there's a clear way to demystify what's actually happening underneath the hood. The biggest problem with magic that you can't demystify is that it's hard to predict what other kinds of things you can and can't do with it, you know?
Bob Ross October 30, 2023 at 13:00 #849567
Reply to Jamal

There were three things you said or implied that I took objection to: (1) that Python is a new language or at least a new language for web development


I do, in terms of what has been used historically by-at-large, think that python is relatively new to the web development game; but I stand corrected insofar as I was unaware of Django being so old.

(2) that Python and/or Python frameworks have not been properly tested and are unstable or insecure


I wasn’t saying that they haven’t been tested or are necessarily unstable, but like JS frameworks they haven’t been around nor used heavily enough for enough eyes to pentest it as rigorously as older ones; but I see that Django is pretty old so that may not be the case for that framework. For example, newer frameworks made out of newer server-side languages (like using JS for it in Node.js server) introduces new vulnerabilities that know one originally thought to test (e.g., prototype pollution). It’s not that they weren’t tested, but rather that it takes time to sort these kinds of things out; so I just error on the side of a more well known and used language.

(3) that PHP belongs in the same language ballpark as Java.


For web development, yes; as a language, all else being equal, no. PHP is a compiled and interpreted language that is dynamically typed; whereas Java is a compiled language that is statically typed. In my opinion, Java is bloated.

What I did not claim is that Python was used in web development before PHP was; as far as I know the Django guys were the first to use it to build websites. But twenty years (since Django was released) is a decent length of time, and its record is very good. And yes, PHP has always been more popular as a way of building websites.


That’s fair. I was not aware of Django, so I stand corrected on that part; but I do think, by-at-large, PHP has been used a lot more, and thusly has had a lot more eyes on it, than Django for web development purposes (but I could be wrong).

Java and Python are general purpose languages that can do anything, and on the other side you have PHP and JavaScript, which are just scripting languages


I get what you mean, but I wouldn’t classify them this way. Java and Python are very different languages (e.g., one is significantly slower than the other, one is tabular, one statically typed the other dynamically typed, etc.). I don’t consider Java a general purpose language, but I guess any language, when you think about it, could be technically used for anything (if one really wanted to).

Likewise, PHP and javascript are traditionally meant for very different purposes: I personally like to keep it that way. The former is a server-side language, the latter a client-side language. JS, as far as I know, is purely dynamically typed and PHP is a hybrid. I am not sure what you mean by a “scripting language”, but PHP is by-at-large only used for websites and that is because that is honestly only where it prevails.

I view python as a really good “recreational programming language”, meaning that I love using it for personal scripts that I create where I am being lazy and don’t care about optimizing runtimes or memory. However, I get people use it for more than that.

It's a difficult question to answer without knowing what you mean, but depending on which way you look at it, it's both. Flask, on the other hand, is certainly minimalist. But Django adheres strongly to conventions and paradigms, such as DRY, and the separation of concerns of MVC (although they use different nomenclature and slightly different structure, namely model-view-template), so it's a good coding experience. Things never got messy for me in Django, as they definitely did when I was building in JavaScript frameworks.


Cool. I will take a look.

But since you don't like Python, there's little point in wasting your time on it.


I like to think I am open minded (;, I will take a look and give it a shot. It is not that I don’t like Python, but, rather, I don’t think it is a good server-side language for web development: it is great for recreational use. Python is basically normal English in terms its syntax and diction.

So I say, enjoy your PHP :cool:


Oh, I will :wink:
Outlander October 30, 2023 at 13:02 #849569
Quoting Jamal
Gmail settings will not load a new page.


Right but if you had a good internet connection in the first place the literal only advantage/difference between not changing a page to going back to the main email listing in a click of an X button is vanity and perhaps a non detectable fraction of second. It's vanity. No utility. Sure if your internet fails and it lets you click an "X" to return back to an email listing if you happened to have the setting page for a prolonged period of time for some reason without a connection (which I doubt it does) perhaps an email title and the few words included in the preview might be useful. But other than that I fail to see any utility or useful difference between the two (direct page loading vs. single page AJAX loading. Also remember you're describing AJAX deep down at the end of the day, SPA is one version of a larger picture. AJAX vs. HTML page loading, that's what I'm referring to.)
Michael October 30, 2023 at 13:21 #849576
Quoting Outlander
Also remember you're describing AJAX deep down at the end of the day


SPAs don't require Ajax.
Jamal October 30, 2023 at 14:06 #849593
Java and Python are general purpose languages that can do anything, and on the other side you have PHP and JavaScript, which are just scripting languages


Quoting Bob Ross
I get what you mean, but I wouldn’t classify them this way.


Maybe I wasn't clear. If you look at the context of that quote, you'll see I did not wholly endorse that classification but offered it as an equally legitimate alternative to yours, in that it is one that is often used. Obviously I'm aware that Java and Python are fundamentally different.

Quoting Bob Ross
It is not that I don’t like Python, but, rather, I don’t think it is a good server-side language for web development


But that's what Django is, so like I say, there isn't much point.

Otherwise :cool:
Jamal October 30, 2023 at 14:21 #849602
Quoting flannel jesus
I like magic most when there's a clear way to demystify what's actually happening underneath the hood. The biggest problem with magic that you can't demystify is that it's hard to predict what other kinds of things you can and can't do with it, you know?


:up:

There comes a point sometimes when the magic just gets in the way. But all the tools we use have some level of hidden magic (unless, I don't know, you're doing assembly or machine code), so it's about finding the right level. In my world the framework that's famous for hidden magic is Rails, whose principle is "convention over configuration". On the other side, the Python folks say "explicit is better than implicit." The two are definitely in conflict.
flannel jesus October 30, 2023 at 14:27 #849605
Reply to Jamal Yeah. My first time trying to do an extensive backend was in node.js with Express, which has very very little magic by default - almost everything is configured manually apart from the basic internals.

I've moved into doing Laravel in PHP, and it has quite a lot more magic than vanilla Express, BUT I feel almost all of the magic is genuinely helpful, positive, and it's fairly easy to dig and find out exactly what most of the magic is actually doing - I don't think there's too many bits of it that have created a downside for me.

One magic thing that's a little annoying for me lately is actually how it handles user sign in sessions. I've got a bug related to sessions and it's so hard to find out what's going on there!
Jamal October 30, 2023 at 14:39 #849611
Quoting flannel jesus
I've got a bug related to sessions and it's so hard to find out what's going on there!


I feel your pain.
Leontiskos October 30, 2023 at 16:31 #849651
Quoting Jamal
Aside from wanting to control the data and code, I'd actually be perfectly satisfied with the way Plush works with just a few changes, like better tools for moderation, "zen mode" post composing, Markdown support, dark mode, and ignore lists.


Plush seems like it's working pretty well. I really like the feature where I can click on the title bar and return to the post I just quoted. My concern is that Plush seems near the end of its lifecycle. If you look at the second half of my post <here>, you can see a number of the things Plush hasn't managed, despite requests. Most of that stuff has been standard for years now, along with ignore lists and strong moderation tools. If Plush won't budge on those things, then I have to wonder if they are in maintenance mode, nearing their expiration date. NodeBB and Discourse don't show evidence of this lifecycle issue.

Quoting Jamal
(I know that for dark mode I could just use Stylebot as you suggest, but this is about built-in functionality; as admin I need to see what most people see).


Yes, definitely.

Quoting Jamal
This is what makes a decision to move to another platform a big and difficult one.


Yes, I understand.

Quoting Jamal
Incidentally, it always sounds odd to me when I see people saying that discussion forums are dead (because Reddit, social media, and Discord). I guess my experience is not normal.


I think your experience is not normal because your moderation is not normal. I think that's why your forum is so much better than the alternatives: you have superior moderation and your moderators have a good grasp of philosophy.

Quoting Jamal
Although the Plush folks assure me that PlushForums will be maintained for the foreseeable future, they don't seem very interested in adding new features, perhaps because they've been putting most of their efforts into their new platform https://insta.forum/ (totally moving away from long-form, so not suitable for us).


Wow, this completely confirms my doubts.

Quoting Jamal
In my world the framework that's famous for hidden magic is Rails, whose principle is "convention over configuration". On the other side, the Python folks say "explicit is better than implicit." The two are definitely in conflict.


My switch from Rails to Python/Django was somewhat painful, and that is another extraneous reason I avoided Discourse. I didn't want to work in Rails immediately after switching from Ruby/Rails to Python/Django.


P.S. One significant feature that NodeBB hasn't yet managed is composer keyboard shortcuts. For example, Ctrl-i won't give you italics.
Alkis Piskas October 30, 2023 at 16:47 #849657
Quoting Jamal
Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.

Is this maybe the reason why some sites are quite slow in loading? I guess they must be the ones with a huge content. Do you know any of them --that use this method-- so I can check if this is true?

I Just read about SPAs and they say that they can also load resources dynamically, according to the interaction with the user. This makes much more sense, doesn't it? I do that in my programs in Python. I don't import everything at start but according to if and when a certain module or group of modules are needed. Why loading everyhting at start if some of them are not to be used, esp. the time-consuming ones? I consider that inefficient programming.

But because of the high speeds, large amounts of RAM and the huge storage spaces available, a lot of the once respected rules of effective and efficient programming are being violated since a few decades ago.

You might have understood that I am an old-timer ... Right. My passion for programming has started even before PCs were born! And I like to still respect those rules. I feel very lucky that I started so early. I had the opportunity to develop a strong ability in problem solving. Not only in programming, but in other areas too. Because what else is programming than problem solving? :smile:
Michael October 30, 2023 at 16:50 #849658
@Jamal

Plush Content Ltd financial statement Feb 2023

They have 1 employee and £1,745.42 in the bank.
Jamal October 30, 2023 at 16:57 #849664
Quoting Alkis Piskas
Is this maybe the reason why some sites are quite slow in loading? I guess they must be the ones with a huge content. Do you know any of them --that use this method-- so I can check if this is true?


If you mean SPAs in general: Gmail, Airbnb, Rome2Rio, Netflix.

If you mean the ones that load everything up-front, rather than those that use code splitting, I’m not sure. It can be hard to tell. I think it was the normal way around 5-10 years ago.
Jamal October 30, 2023 at 16:58 #849665
Alkis Piskas October 30, 2023 at 17:14 #849672
Quoting Jamal
If you mean the ones that load everything up-front, rather than those that use code splitting, I’m not sure.

Yes, I meant that. Of course it might difficult to tell. But each now and then I see huge "home" pages --where the word "home" has lost its meaning-- or some huge single-page sections of the site. And I'm wondering why? Why should one have to scroll for hours in order to find an information? Even if you try to use "Search in page", it doesn't help because the single page grows dynamically as you scroll down. (But at least this is done dynamically.) Quora has a lot of such sections and one has to bear that awful system. The more logical and also "human" way is to split pages abd have an\ numbered index of links for jumping to a certain page no. Exactly how it is done in TPF (topics, comments, mentions, etc.).
Jamal October 30, 2023 at 17:31 #849684
@Michael @Leontiskos

As of today I’ve got Discourse running now on a host that does managed Discourse hosting. Some people on meta.discourse.org say they’re very reliable. I think this is the way to go. I don’t want to deal with hosting. These folks take care of backups, software updates, and all the rest, while I have the power and control of the Discourse admin (e.g.,

Can I download my data?
Yes. You own your own data. A copy of your files (including uploads and avatars) and databases (full dumps) can be downloaded from the Backups menu of the Discourse admin panel at any time.


) and members get most of the features they've been asking for for years.

I actually set one up there a few years ago and didn’t pursue it just because I wasn’t in the mood or I didn’t want to face the data issue. This time I hope to see it through, some time in the next weeks or months. In the meanwhile I’ll invite testers once I’ve fine-tuned it (this week probably but I don’t know when I’ll get around to it).

Quoting Leontiskos
Plush seems like it's working pretty well. I really like the feature where I can click on the title bar and return to the post I just quoted. My concern is that Plush seems near the end of its lifecycle. If you look at the second half of my post , you can see a number of the things Plush hasn't managed, despite requests. Most of that stuff has been standard for years now, along with ignore lists and strong moderation tools. If Plush won't budge on those things, then I have to wonder if they are in maintenance mode, nearing their expiration date. NodeBB and Discourse don't show evidence of this lifecycle issue.


Yep, and Discourse would take care of most of the feature requests, I’m guessing?

Quoting Leontiskos
I think your experience is not normal because your moderation is not normal. I think that's why your forum is so much better than the alternatives: you have superior moderation and your moderators have a good grasp of philosophy.


Glad you think so :smile:

Quoting Leontiskos
P.S. One significant feature that NodeBB hasn't yet managed is composer keyboard shortcuts. For example, Ctrl-i won't give you italics.


It's kind of a small thing, but I use that all the time, including here. Of course, when using Markdown you don't need it so much because it's so easy to just type the markup.
Michael October 30, 2023 at 17:32 #849685
Reply to Alkis Piskas I think you misunderstand what an SPA is.

Think of a website as a book. In traditional MPAs (multi-page apps), you ask the website to give you a page. You read it and then ask for another page. In SPAs (single-page apps), you ask the website to give you a book. There are still pages but you don't have to ask for the website to give you them each individually.

So in a way the "P" in "SPA" and "MPA" is a bit of a misnomer.

Although even this analogy is a little off as with code-splitting you do get given each page individually, but it only gives you the new stuff, e.g. the particular block of the website that is about to change. You don't have to be sent all the surrounding stuff as well. This makes it faster.
Alkis Piskas October 30, 2023 at 17:35 #849687
Reply to Michael
What I undestood is what https://www.techtarget.com/whatis/definition/single-page-application-SPA says, which is not what you are saying.
Anyway, thanks.
Leontiskos October 30, 2023 at 17:44 #849689
Quoting Jamal
As of today I’ve got Discourse running now on a host that does managed Discourse hosting. Some people on meta.discourse.org say they’re very reliable. I think this is the way to go. I don’t want to deal with hosting. These folks take care of backups, software updates, and all the rest, while I have the power and control of the Discourse admin (e.g.,


Sweet. :up:

So on NodeBB a lot of the customization comes through themes and plugins, which can be substituted, created, shared, etc. But the access to this customization is somewhat host-dependent (and this is especially true when it comes to hosts that do not allow command line SSH server access). If a similar thing holds with Discourse, then I would suggest double-checking that the hosting company allows that deeper level of customization (and ideally command line access). You could easily leverage the deeper level of customization if you have need in the future, given the many developers among your users.

Quoting Jamal
Yep, and Discourse would take care of most of the feature requests, I’m guessing?


Yes, I certainly think so.

Quoting Jamal
It's kind of a small thing, but I use that all the time, including here.


Oh, I use it all the time as well. Small things like that can make a difference when two competitors are so close.

Quoting Jamal
I actually set one up there a few years ago and didn’t pursue it just because I wasn’t in the mood or I didn’t want to face the data issue. This time I hope to see it through, some time in the next weeks or months. In the meanwhile I’ll invite testers once I’ve fine-tuned it (this week probably but I don’t know when I’ll get around to it).


This sounds great. I am of course willing to help as I am able, although I should say that this is precisely the time of the year that gets busy for me.
Jamal October 30, 2023 at 18:01 #849695
Quoting Leontiskos
So on NodeBB a lot of the customization comes through themes and plugins, which can be substituted, created, shared, etc. But the access to this customization is somewhat host-dependent (and this is especially true when it comes to hosts that do not allow command line SSH server access). If a similar thing holds with Discourse, then I would suggest double-checking that the hosting company allows that level of deeper customization (and ideally command line access). You could easily leverage the deeper level of customization if you have need in the future, given the many developers among your users.


I actually don't think we'll need SSH access, and I don't want to need it. I'd prefer to separate off my coding and sysadmin type work away from TPF as much as possible (even though I was briefly toying with the idea of building my own). The host says they'll install any plugin we want, including any we write specifically for TPF. And there's an active community of Discourse coders making new plugins.

Quoting Leontiskos
This sounds great. I am of course willing to help as I am able, although I should say that this is precisely the time of the year that gets busy for me.


Thanks, your guidance will be valuable since you have all this forum configuration experience, but I won't burden you too much. :smile:
Leontiskos October 30, 2023 at 18:09 #849697
Quoting Jamal
The host says they'll install any plugin we want, including any we write specifically for TPF.


Cool. I think that's all you need.

Quoting Jamal
Thanks, your guidance will be valuable since you have all this forum configuration experience, but I won't burden you too much.


Sounds good. :up:
Leontiskos October 30, 2023 at 19:42 #849727
Quoting Jamal
Yep, and Discourse would take care of most of the feature requests, I’m guessing?


I was thinking of hitches that could be preempted, and one thing did come to mind. It seems that your users aren't fond of the reputation system. For example, they enjoy the ability to 'like' posts, but they won't accept it at the cost of replacing the user's visible post count with their reputation. I agree, and I had already found a plugin to sideline reputation in NodeBB even before I joined TPF.

From what I know of Discourse, they tout their "trust system" (reputation) and their "gamification." Jeff Atwood was a CEO and founder of Discourse, and he was also one of the founders of Stack Exchange. He is big on gamification. My guess is that the reputation system is a cornerstone of Discourse, and is no more avoidable than infinite scroll. It may be worth checking into this and seeing to what extent it can be circumvented. It is one thing that would bear on your users' desires.
Jamal October 30, 2023 at 20:20 #849739
Reply to Leontiskos

Good point. I just had a look. Likes are quite heavily integrated but it is just about possible to remove them, it seems. I mean, it’s easy to hide them with CSS or remove the icon from the post menu, but then it takes some faffing around to remove the various references to likes elsewhere.

Anyway, I think you have to go to the user’s profile to see how many they’ve accrued, so it’s not like the number appears under their name in discussions. There are badges, which are connected with likes (at least by default), that do show in the user popup in threads, but they can be turned off.

I’ll have to read the discussions that were had here about it to remind myself of how it works on Plush and what people didn’t like about it.
Leontiskos October 30, 2023 at 20:34 #849743
Reply to Jamal

Okay, that sounds pretty similar to NodeBB. I can neutralize the logic of reputation so that it does not trigger any events or rewards, and I can remove the visible number that would appear under their name in discussions (last I checked), but it remains visible in the user's profile.

Quoting Jamal
I’ll have to read the discussions that were had here about it to remind myself of how it works on Plush and what people didn’t like about it.


Sure. Just from my fallible memory, there was a minority of users who "voted" against both likes and visible reputation, a smaller minority of users who "voted" for both likes and visible reputation, and a plurality of users who "voted" for likes but against visible reputation. Plush supports both minority positions but not the plurality position. That is, on Plush if you turn on likes, then a user's reputation is automatically displayed on every post (instead of their post count).
Outlander October 30, 2023 at 20:51 #849746
Quoting Michael
SPAs don't require Ajax.


If it's an obituary for a cat or memoirs of the owner of said cat, sure. At that point it might as well be a single page website with a floating sidebar of whatever section you wish to scroll to or at least a fixed menu of the sort. I suppose it does save browser memory- the content not being rendered by the browser and stored in the JavaScript as text, especially images or videos not rendered and when changed they are thus freeing up the memory from any images or video previous rendered when you change to the new "page".

But for anything useful like a public forum or guestbook, or say billing or payment application where an action could have been made from another avenue ie. by phone and needs to be updated, it really ought to communicate with the server, wouldn't you say? Am I wrong? if so, how and why. with examples.

I get the concept (I think?). For a small or medium sized business. You load every single item (thousands), image link, and description (often lengthy) when someone visits your homepage? That doesn't seem efficient to me. I suppose it simply loads the blank "default item" page and clicking the item individually loads its information? That would still require every single item in inventory's ID, picture, title, and usually price to be loaded from the first homepage visit. That seems a bit much.

Sure for many places, a restaurant or small business it seems fine that just links to an image of a menu or something. Not sure what greater benefit an SPA would offer as opposed to HTML-based page browsing from the user's end? (assuming they have a good connection)
Michael October 31, 2023 at 09:25 #849887
Quoting Outlander
You load every single item (thousands), image link, and description (often lengthy) when someone visits your homepage? That doesn't seem efficient to me. I suppose it simply loads the blank "default item" page and clicking the item individually loads its information? That would still require every single item in inventory's ID, picture, title, and usually price to be loaded from the first homepage visit. That seems a bit much.


Not if you use code-splitting. On the initial page load it just pulls down something like "index.js" and then runs the code in that. When you click the "/about" link it pulls down "about.js" and then runs the code in that. If you go back to the home page it re-uses the "index.js" that has already been downloaded. And the same if you return to "/about". This can make for a faster user experience and reduce the load on the server.

Quoting Outlander
But for anything useful like a public forum or guestbook, or say billing or payment application where an action could have been made from another avenue ie. by phone and needs to be updated, it really ought to communicate with the server, wouldn't you say?


Yes. Many SPAs will use Ajax. I was just pointing out the technical point that SPAs and Ajax are independent technologies.

As for "AJAX vs. HTML page loading" as you say, again it's a matter of allowing for a faster user experience and reducing server load. With an SPA when navigating to the second page of a discussion it only needs to return a JSON object of the second page's post data and then rebuild the section of the page that displays the post, whereas with an MPA it has to return all the HTML for the entire page as well as run any additional processes/queries to generate any of the surrounding data (e.g. using TPF as an example, the list of categories and the logged-in user's mention, comment, and discussion count).
Outlander October 31, 2023 at 11:12 #849896
Reply to Michael

No I get it. The constants of the site are loaded (header/footer ie. core HTML structure, images, universal JS/CSS, etc) and any content can be a simple albeit long string along with functions needed only for the specific page vs. requesting the aforementioned over again. Although I was under the impression all browsers "cache" the aforementioned and minus the 1-1 handshake that the server is still reachable, which would have to be done anyway to request "about.js" or whatever new content medium in the first place, doesn't seem to differentiate the two methodologies by very much? Perhaps I misunderstand. Fair enough. However..

[hide="Reveal"]

var me = document.getElementById('Outlander');

me.onclick = function()
{
alert( 'But what about someone who does not have Javascript functionality either inherently or disabled for security reasons?' );

// just for fun
for ( var i = 0; i < 2; i++ )
{
i--; alert( 'Ye cannot escape! Mwahaha!' );
// or if you really want to get twisted
// window.open( 'http://www.adultwebsite.com', _blank );
}

}
[/hide]
Bob Ross October 31, 2023 at 11:56 #849906
baker October 31, 2023 at 19:46 #850027
Quoting Jamal
What does Cal say, and why do you think it's important? Is it something like, stop scrolling through Instagram and go for a walk instead?


Cal Newport is Professor of Computer Science at Georgetown University.

Digital minimalism is a philosophy that helps you question what digital communication tools (and behaviors surrounding these tools) add the most value to your life. It is motivated by the belief that intentionally and aggressively clearing away low-value digital noise, and optimizing your use of the tools that really matter, can significantly improve your life.
/.../
The bottom line of this general thinking is that a simple, carefully curated, minimalist digital life is not a rejection of technology or a reactionary act of skepticism; it is, by contrast, an embrace of the immense value these new tools can offer…if we’re willing to do the hard work of figuring out how to best leverage them on behalf of the things we truly care about.

https://calnewport.com/on-digital-minimalism/


And he wrote a book about it. (Which I actually bought last week, and I rarely buy books. This one's a keeper.)
Jamal October 31, 2023 at 19:54 #850032
Reply to baker

Very good, though on the face of it it just seems like common sense. I suppose a systematic approach would be good though, so I’ll give it a tentative :up:

I’d be interested to see the details. Interested to a degree somewhere between mildly and rather.
baker October 31, 2023 at 20:32 #850046
Reply to Jamal Just read it.

Or else, I selected three reviews/summaries:

https://blog.rescuetime.com/digital-minimalism/
https://www.techtarget.com/whatis/feature/Digital-minimalism-explained-Everything-you-need-to-know
https://www.samuelthomasdavies.com/book-summaries/business/digital-minimalism/
Jamal October 31, 2023 at 20:40 #850049
Reply to baker

When you're attempting to contribute to a discussion it's better to go into more detail than "just read this book". If you're actually interested in this discussion, maybe you'll tell us about it when you've finished.

Thanks for alerting us all to its existence though.
baker October 31, 2023 at 20:52 #850055
Reply to Jamal Oh. I have the book in translation in my native language, so that's awkward to backtranslate the terminology. So I looked up some reviews in English that I think are fitting.
Besides, I seem to be the only one here in this thread following this theme. You did say any thoughts on the state of web applications and websites are welcome. Perhaps a separate thread is in order.
Jamal October 31, 2023 at 20:54 #850056
Quoting baker
You did say any thoughts on the state of web applications and websites are welcome.


Yes, it's cool, I just wanted a bit more detail, that's all. No worries :up:

Quoting baker
Perhaps a separate thread is in order.


Could be interesting.
Michael December 03, 2023 at 16:12 #858272
@Jamal

I was bored so spent the last day and a half building an experimental JSON-powered JavaScript framework. The idea came to me whilst getting my hair cut.

https://github.com/on-js/on-js
Jamal December 03, 2023 at 17:45 #858288
Reply to Michael

Very cool. That use of attributes reminds me of HTMX.
Michael December 03, 2023 at 18:24 #858305
Reply to Jamal htmx and hyperscript are what inspired it
Jamal December 03, 2023 at 18:26 #858306
Reply to Michael That explains it then! :grin:

Yeah I like the approach a lot.
Jamal December 03, 2023 at 18:53 #858313
When I started getting back into this stuff a month or so ago, I was intending on learning React and brushing up on Django, but I somehow got distracted into doing things with Crystal, Elm, Elixir, and other things more or less obscure. There are many choices now, and Python is so slow.

Reply to Michael I see you're using Typescript. I've stayed away from it so far, but I'm appreciating the static typing in the server-side languages like Crystal, so I really see the benefit. Plus it's doubtful I'll be able to stay away from JavaScript frameworks as much as I want to, so I guess I'd better start using it.

By the way, amongst the front-end frameworks, I've found Svelte to be the most enjoyable to work with.
Michael December 03, 2023 at 18:59 #858316
Quoting Jamal
I see you're using Typescript.


My first time trying it. It takes some getting used to. I'm finding it more complicated that PHP's static typing.

Quoting Jamal
By the way, amongst the front-end frameworks, I've found Svelte to be the most enjoyable to work with.


I've been using Preact at work. I like how small and fast it is. Briefly tried Vue and had a glance at Svelte, but my colleague is suggesting htmx for future projects so that's what I've been doing recently and what inspired me to make this.

There's just so much to learn. :shade:

I'm also in the process of building a PHP framework, inspired by Laravel but much smaller and faster. I just keep getting distracted by other things. :lol:

It's a work in progress so not yet open source but parts of it are public anyway so check it out if you're interested: https://github.com/wtframework

I'm particularly proud of the SQL statement builder (https://github.com/wtframework/sql). My intention is to allow for the full spec. Just need to finish off some CREATE and ALTER stuff (mostly to do with partitions).
Jamal December 03, 2023 at 19:24 #858328
Quoting Michael
I'm also in the process of building a PHP framework, inspired by Laravel but much smaller and faster.


Hey, everyone is building a framework these days. :grin:

Quoting Michael
my colleague is suggesting htmx for future projects so that's what I've been doing recently and what inspired me to make this.


I'm on board. I'd attempt to go down that route exclusively if I could choose all my tech myself (and use a compiled language on the server).

Funny to see how the frameworks come and go. Below is a chart plotting interest in frameworks over time.

User image
Jamal December 03, 2023 at 19:39 #858333
Quoting Michael
It's a work in progress so not yet open source but parts of it are public anyway so check it out if you're interested: https://github.com/wtframework

I'm particularly proud of the SQL statement builder (https://github.com/wtframework/sql). My intention is to allow for the full spec. Just need to finish off some CREATE and ALTER stuff (mostly to do with partitions).


I just saw this bit. Great stuff, but the SQL stuff is a bit yikes to me.

Cool name.
Michael December 03, 2023 at 19:43 #858336
Quoting Jamal
the SQL stuff is a bit yikes to me.


You might also say "what the fuck?" ;)

Hence the name.
Outlander December 03, 2023 at 20:16 #858351
Reply to Michael

Exactly what I was worrying about, how greatly PHP has changed, or "advanced" allegedly.

I'm a solid "OOP'er" as that is, in my eyes, the peak "pinnacle" point of PHP advancement. The last and only paradigm shift as far as I judge.

$framework = new MyFramework; $framework->function( $some, $variables, $here );


Anything beyond that has always been a hard pass for me. Simply for reasons of not being needed.

The furthest I go into modern PHP (post 2007) is the use of the double scope (::) operator and even that is for convenience/compatibility purposes.

As example, this is the only use case of the newly introduced scope operator in my framework:

function __construct() { $this->appName = strtolower( parent::class ); $this->sectionName = strtolower( static::class ); }


And that's of course out of necessity. I view myself as fairly adept in PHP, at least in the period of time I was most active in it. Hopefully things haven't changed too much...
Michael December 03, 2023 at 20:21 #858354
Quoting Outlander
Hopefully things haven't changed too much...


How about

[code=php]
class Person
{
public function __construct(
public readonly string $name,
public readonly int $age
) {}
}
[/code]
Outlander December 03, 2023 at 20:40 #858364
Reply to Michael

I had to Google the "readonly" stipulation. What realistic (or even atypical) case scenarios can you provide that warrants its explicit use?

Never did "cast" variables ie. string, int, boolean, etc. Didn't see the need to do so if everything it interacts with can handle errors/unexpected inputs, be they common or rare, properly.

Edit: with the exception of certain required internal functions, however in this manner:
function FormHandler( $prefill = array() ) { /* */ }


I'd much rather a default function-level based "error handling" (ie. not integer detected therefore, perform this) than a top level PHP error that breaks whatever the user is doing (and often the site or at least the specific action page in the process).
Michael December 03, 2023 at 20:59 #858375
Quoting Outlander
I had to Google the "readonly" stipulation. What realistic (or even atypical) case scenarios can you provide that warrants its explicit use?


You might want to get the name after creating the object.

New way:

class Person
{
public function __construct(public readonly string $name) {}
}

$person = new Person('Michael');

echo $person->name;


Old way:

class Person
{
protected $name;
public function __construct($name)
{
$this-name = $name;
}
public function getName()
{
return $this->name;
}
}

$person = new Person('Michael');

echo $person->getName();


I'd much rather a default function-level based "error handling" (ie. not integer detected therefore, perform this) than a top level PHP error that breaks whatever the user is doing (and often the site or at least the specific action page in the process).


They're optional. But it's to enforce good coding. If you're expecting an integer then you should write your code such that you only ever give it an integer. If at some point a string is being passed then you've coded it wrong. Strict typing ensures that these mistakes are picked up in development.
Jamal December 03, 2023 at 21:25 #858383
Quoting Michael
Strict typing ensures that these mistakes are picked up in development.


I've only recently started back with statically typed languages after a couple of decades of freedom, and it's been good. It does encourage good coding and it does allow you to fix stuff more easily.
Outlander December 03, 2023 at 22:01 #858394
Quoting Michael

class Person
{
protected $name;
public function __construct($name)
{
$this-name = $name;
}
public function getName()
{
return $this->name;
}
}

$person = new Person('Michael');

echo $person->getName()
;


No different than


class Person
{
function __construct( $name ) { $this->name = $name; }
}

$person = new Person( 'Michael' );

echo $person->name;


Is it? Not on my end at least.
Michael December 03, 2023 at 23:15 #858418
Reply to Outlander

That allows for public reassignment.

$person->name = 'Mike';


Often times you don't want that which is why such properties are usually protected or private.

Perhaps a better example would be:

class Person
{
public readonly string $initials;
public function __construct(
public readonly string $first_name,
public readonly string $surname,
)
{
$this->initials = substr($first_name, 0, 1) . substr($surname, 0, 1);
}
}

$person = new Person('John Smith');

echo $person->initials;
Outlander December 04, 2023 at 08:02 #858497
Quoting Michael
Often times you don't want that which is why such properties are usually protected or private.


Doesn't one generally not "publicly" reassign variables from a helper/framework class?

Say I'm incorporating your framework into whatever PHP project I'm working on. I'd have $myclass and $yourclass, respectively. What reasons would someone who is clearly not "public", as in a full on admin level code editor, edit a property of another class? It can't be for some "security exploit" since they have the full code and could just edit it from the parent class.

If they choose to break the code, even unintentionally, perhaps they shouldn't even be coding in the first place.

What I mean is for example, I use Twilio, a well-known telecommunications framework.

So I could have a thousand different variables going on that range from different classes and functions ($appOne, $appTwo, $functionOne, etc) and there will still be only one "helper" or "external" class. Say in this case $twilio.

So there's no reason to randomly change an independent variable that corresponds to a new class or object just to do so.

Say there is an important object I want to re-use I could just use one line of code to "store" it, statically or dynamically with a "&="

$importantInfo = $twilio->importantInfo;


There would be no reason for me to manually code/reassign at the top level (meaning I literally can access anything) the following

$twilio->importantInfo = 'something that breaks the script';


That would be asinine and utterly intentional. If I can access the parent code I can easily change anything about it anyhow.

Am I making sense? I swear I know what I'm talking about, I'm not trying to be difficult or whatever.
Michael December 04, 2023 at 09:51 #858507
Reply to Outlander

That's the entire purpose of things like public, protected, private, readonly, final, typing, interfaces, abstract, etc; to ensure that developers do things properly.

Quoting Outlander
If they choose to break the code, even unintentionally, perhaps they shouldn't even be coding in the first place.


In reality things aren't this simple. People are fallible, we forget things and get tired. And especially with open source software, not every contributor is going to immediately know everything about every function and class and whatever. Being able to see at a glance 'protected "name"' immediately tells them that they're not supposed to do '$class->name = 'foo'''.

Think of it as inline documentation with automatic error checking.
Outlander December 04, 2023 at 11:23 #858520
Quoting Michael
That's the entire purpose of things like public, protected, private, readonly, final, typing, interfaces, abstract, etc; to ensure that developers do things properly.


Yeah, sure. Again just trying to better understand not to argue purely for the sake of doing so, but- actually no I get it, especially the latter comment. I'm not an "open source" guy so I'm sure you understand my "that's a solution in search of a problem" mindset. Myself, and many others have gone through painstaking measures in attempt to facilitate HTML based interfaces can perform any reasonable, common-use coding in and of itself, perhaps replacing the need to code altogether.

Quoting Michael
Being able to see at a glance 'protected "name"' immediately tells them that they're not supposed to do '$class->name = 'foo'''.


I get that completely. But just to ponder. As a hypothetical. Couldn't all that be resolved by using a simple prefix to the variable? Example (and I do this in mine, sometimes, as do others) ... let's use your WTFramework.

Any common variable a person would use $name, $id, $session, $user, etc.... whatever it is...

Instead use a prefix so it would be

$_name or $wtf_name

literally


$class->_reservedVariable;
$class->wtf_variable;


So no person would ever overwrite a variable in virtually 100% of use cases whatsoever.

I do get the point you want people in an open source framework to access and adjust variables and in a modern PHP dev environment the inline warnings are very useful.

Anyway, nice meeting a fellow coder on here.

Seriously I think TPF or even the two of us should have an old fashioned "code off".

Say a simple guestbook. A page of static content anonymous users can post comments on, sans db, stored as text files. I think that would be interesting. If you have the time.
Michael December 04, 2023 at 11:26 #858523
Quoting Outlander
Instead use a prefix so it would be

$_name


That used to be how things were done, but then PHP introduced "protected" and "private" visibility precisely so that we didn't have to do this.
Outlander December 04, 2023 at 22:53 #858648
Quoting Michael
That used to be how things were done, but then PHP introduced "protected" and "private" visibility precisely so that we didn't have to do this.


But, and correct me if I'm wrong, doesn't that simply put/shift the onus onto the lower developer to use quirky/prefixed variables now?

Example, in running your code, I just got a fatal runtime error "unable to access protected property Person::$name ".

So it's not like it actually frees up the use of the literal verbose name of the variable itself. It just makes it so "Ok now I have to use use '$name2' or '$variable2' instead of what comes firsthand in mind." as far as secondhand development/utilization of a framework goes.
Michael December 04, 2023 at 23:34 #858657
Quoting Outlander
So it's not like it actually frees up the use of the literal verbose name of the variable itself. It just makes it so "Ok now I have to use use '$name2' or '$variable2' instead of what comes firsthand in mind." as far as secondhand development/utilization of a framework goes.


No, it means you're not allowed to change the name.
Outlander December 05, 2023 at 01:46 #858678
Quoting Michael
No, it means you're not allowed to change the name.


So you would agree it is more of a safety net for inexperienced coders versus an actual, functional progression in and of PHP itself. If I want to intentionally change the name, variable, or anything for that matter, of an open source framework I dang will do so from the source code seeing as it's free and open for me to do so if desired.