5
ZioCain
4y

I literally won't ever understand:
Everyone hates JavaScript and despises using it.
Everyone also hates PHP.
So to get rid of PHP smh we decided to use js in the backend, too? And that shit is working and a lot of people enjoy this? Everything is fucked up

Comments
  • 1
    I like both.
  • 6
    Yin and Yang
    Php usually performs better than js.
    Js source tends to be less shit than php

    That said, if it doesn't multithread, I don't use it on a server.
  • 2
    Just use typescript or something like that and you won't hate it.
  • 8
    Meh.
    Both are terrible for vastly different reasons. They also have their place. JS’s place is making webpages a little nicer. PHP’s place is 1995. 😉
  • 0
    @SortOfTested php usually performs better than nodejs? You being wrong is a rare thing, I know, but now you’re wrong unfortunately
  • 4
    Why care about other people’s opinions though? I arbitrarily assign weights to people. Opinion of George Hotz or Hakon Wium Lee has the weight of like 10 points to me, opinion of some rando that knows nothing but php 5.4 and it’s all his fucking world and it’s his religion because “damn that stupid frontend faggots”... his opinion has a negative weight. If he says “X sucks” I take a look at X and chances are it’s decent
  • 1
    @uyouthe I do something similar and it works quite well. 🙂
  • 0
    JS is fine in backend for scripting, util and other small tasks you would usually do with a dynamic language. You can even use Deno these days.
  • 4
    The everyone hates JS/PHP would is a dumb generalisation IMO.
    They both have their places, pros and cons.
    I'm personally more on the JS side (including Node.js) but if I need a backend that needs to handle loads of request and be efficient I'll learn Go/Rust (depending on the use case and team) and use that instead.

    Just like in other communities, some people have the "I hate X" as their personality or something as silly as that, so there will always be a few people who hate a language (the most common ones being PHP, JS, Java and Python).

    In any case, that shouldn't deter you from using what suits your needs (regardless of it being in our out of your comfort zone).
  • 2
    I honsetly admire JS over php. I think its better than php.But lets face it

    THERE ALL SHIT
  • 0
    @uyouthe
    The only thing node is exceptional at is regex. Even that advantage has dwindled of late.
  • 0
    @SortOfTested you’re talking about newest php? If so, you are maybe right because I haven’t tried them personally. I have hopes for deno though
  • 0
    @uyouthe
    It's a snail race, honestly. It doesn't excite me.

    I linked heni some trivial .net code the other day that was able to spin up, reflect properties on an object's RTTI, process all cmdline arguments from -,--,--k=v, grab the appropriate properties and serialize the typed object structure in 207ns avg over 3000 serializations, aggregate 0.6ms for a 2 point structure with ignorable data in args. They're also launching a scripting story with top level async/await for the runtime that is looking with 10ms startup overhead in dotnet 5 preview 5, which means the java ecosystem will follow suit soon after.

    Node or php compared to that is a looking more and more like a bugatti vs a monkey on a tricycle.
  • 0
    @SortOfTested could you extend on less shit than PHP?
  • 0
    @SortOfTested also could you extend on if it isn't muktithreaded, you don't use it on a server?

    Both are honest questions
  • 1
    @wicho
    - less shit
    Better typing support, you'll rarely see a 3000 line js source file.

    - multithreading
    The scale model of spinning up multiple processes of the same application to accommodate n-core hardware configurations is broken. You pay bootstrapping, runtime, cache costs n-times, and it forces you to the slowest IPC models and inevitably bottlenecks. Multi-threaded applications share the same memory and require no IPC to saturate a given hardware configuration.
  • 0
    @SortOfTested Gotcha! Thanks,

    But a 3000 lines source files doesn't talk shit about a language, it talks about the developer.

    I've seen 3000k lines on Python and C#. Not in JS still cause I haven't touched it on a backend side.

    Is JS implicitly multithreaded? Python is not, but I love Python's implementation of it
  • 3
    @wicho Nope, it does have Event Loop in order to execute async, but there is no concurrency. Not really sure what "implicit multithread" means though.
  • 0
    @theuser Thanks, what I'm trying to say is that you don't have to explicitly code in a multithreaded way. It will take whatever it can run in MT mode and run it without you actually coding it that way.
  • 1
    @wicho
    There's this concept that exceptions don't make the rule. You can hand waggle all you want, it doesn't make it less true 😋

    Neither php, or js are multi-threaded
  • 0
    @SortOfTested I thought you said js was multithreaded. for that I'm sorry

    I'm not defending any languages, I've seen shit in all of them.
  • 0
    @SortOfTested rust is better blah blah blah. I’m happy that I only have to know one language to write everything I want and it’s fast enough
  • 0
    @uyouthe
    It's whatever you want to do. For me it's the difference between losing my ownership stake to VCs due to overcapitalization and dictating the terms of my cash out. I can't afford be flippant about my resource overhead.
  • 0
    @SortOfTested please elaborate. How exactly is that abstract performance difference in some cases is related to business stuff?
  • 0
    @uyouthe
    We've run the same workloads on node, and dotnetcore (APIs) and micronaut (graphql). I needed 5-10x the hardware to run the same work on node at reasonable load.

    I can't justify node for workloads when I can save 3 senior FTEs worth of cloud resources using other runtimes. Conversely, I also wouldn't consider user some shit like Blazor for the front end. Boils down to No golden hammers.
  • 0
    @SortOfTested ah, this. Now I understand. My projects are just child’s play compared to yours
  • 0
    @uyouthe
    That's not true, they have different requirements 😋

    I have annoying customers pounding the crap out of the servers. Don't get into this business.
  • 0
    @SortOfTested my peak was when my static html page I made in two hours got product of the day award
  • 1
    @uyouthe
    What about the crusty towel, not a crusty towel app?
  • 1
    @SortOfTested why use bitwarden when you can have the C R U S T Y T O W E L A P P

    thanks for the idea
  • 0
    Bottom line is PHP is dope..🤙
  • 0
    I love PHP D:

    Don't get rid of it pl0x
  • 0
    I like JS, but I dislike PHP.
    I can JS in the backend, but I prefer to C#
  • 0
    @DjSall or use a framework like react
Add Comment