• Jamal
    9.7k
    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.Bob Ross

    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)

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

    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
    2.1k
    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.Jamal

    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
    9.7k
    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.Outlander

    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
    15.6k
    Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.Jamal

    Code splitting is easy so this isn’t a problem.
  • Jamal
    9.7k
    :up: Yep, I was just describing an aspect of SPAs as commonly conceived. I said "often", probably going for "hitherto".
  • Outlander
    2.1k


    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
    9.7k


    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
    1.8k
    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?
    Outlander

    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
    9.7k



    Gmail slack Trello Netflix and grammarlyflannel jesus

    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
    1.8k
    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
    9.7k
    Thanks FJ, so far there is no project but it’s good to know there are people here to help :up:
  • Outlander
    2.1k


    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
    9.7k
    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.Outlander

    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
    15.6k
    You might prefer Svelte.
  • Jamal
    9.7k


    Maybe. Looks interesting...

    svelte-vs-react-1024x533.png
  • Jamal
    9.7k
    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
    1.8k
    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
    1.8k


    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
    2.1k
    Gmail settings will not load a new page.Jamal

    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
    15.6k
    Also remember you're describing AJAX deep down at the end of the dayOutlander

    SPAs don't require Ajax.
  • Jamal
    9.7k
    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.Bob Ross

    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.

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

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

    Otherwise :cool:
  • Jamal
    9.7k
    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?flannel jesus

    :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
    1.8k
    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
    9.7k
    I've got a bug related to sessions and it's so hard to find out what's going on there!flannel jesus

    I feel your pain.
  • Leontiskos
    3.1k
    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.Jamal

    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.

    (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).Jamal

    Yes, definitely.

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

    Yes, I understand.

    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.Jamal

    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.

    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

    Wow, this completely confirms my doubts.

    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.Jamal

    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
    2.1k
    Often, all the necessary HTML, JavaScript, and stuff are downloaded once, when you log in.Jamal
    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
    15.6k
    @Jamal

    Plush Content Ltd financial statement Feb 2023

    They have 1 employee and £1,745.42 in the bank.
  • Jamal
    9.7k
    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?Alkis Piskas

    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.
  • Alkis Piskas
    2.1k
    If you mean the ones that load everything up-front, rather than those that use code splitting, I’m not sure.Jamal
    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.).
bold
italic
underline
strike
code
quote
ulist
image
url
mention
reveal
youtube
tweet
Add a Comment

Welcome to The Philosophy Forum!

Get involved in philosophical discussions about knowledge, truth, language, consciousness, science, politics, religion, logic and mathematics, art, history, and lots more. No ads, no clutter, and very little agreement — just fascinating conversations.