Dais: If for some reason, a user doesn’t have JS enabled, when they make a request to your site, the server which doesn’t know if JS works or not sends a single HTML page as a response. If you have a static webserver e.g. lighttpd, then it just sends them as they are on the filesystem. But if you have a dynamic web server e.g. using Express on Node.js, it can send different web pages based on server controlled cookies or other metadata from the
Dais: Request. But otherwise, once it’s sent, if there’s no JS on the client, there’s no further code ran.
Dais: So whether you have code running on the web server is immaterial to whether the client can run JS.
Mckeel: Let say that im using a dynamic server
Erice: I have whatever I want on that server,
Toplistky: And I want to support users that have disabled js for any reason
Zelasco: So with running js stuff on the server side, it wouldn’t be a problem, right?
Moussette: I don’t know why I always tried to stay away from js
Dais: If you have JS on the server, it will still run even if the client has JS disabled.
Dais: Same with any other server side code.
Seier: And it doesn’t affect page load speed too, right?
Baque: It can affect how fast data gets sent to you
Yeeloy: Because it might be faster than php
Hormell: Javascript is pretty freaking fast
Swingler: In some implementations
Lurvey: Also known as most popular implementations
Panrell: There should be some downside with js as server side scripting language, then why php is so popular?
Salvio: Btw I don’t know about php too
Pipe: Php is easy to use if you don’t know anything about anything
Iribarren: But it seems that many tasks can be done with both of them
Hinojos: It’s popular because it’s popular, that’s why
Dais: Atralheaven_: X is popular in tech because X is popular. It almost never has to do with technical excellence.
Stenson: Atralheaven_: most “cool”/innovative languages are not popular
Chabez: Rust, haskell, idris, purescript, etc
Dais: Atralheaven_: Yep, most server side languages are interchangeable.
Dais: Xnil: Rust is too new right now. It’ll be popular in the future. ;
Wilford: I’m really hoping for it
Dais: Haskell reinvents itself too often, as it’s focused on research, not production.
Hambleton: I think purescript is a nicer haskell
Cambronne: How about the language itself? how well is it designed? as someone who knows about several languages, may you tell me about some pros and cons of js?
Gaubert: Atralheaven_: php is absolute crap.
Devries: Compared to it alternatives
Blare: Js is usable, at least
Helminiak: I like to mask it with some other language, like pure/livescript
Bessel: I wont have time to learn them all and try them and get this answer myself 😀 my studying field is not related to computer at all!
Sawka: It honestly takes just a few days to learn a decent amount of each if you really focus
Rapisura: Btw I like to use open tools, I mean, I dont like to learn or ues any tool/language from microsoft etc
Bowerize: Microsoft has open-source tools
Spanton: Php is not open-source i believe
Overshown: Javascript has many implementations, a lot of which are open-sounce
Woldridge: Should I use closures i.e. function {}; or objects var app = {}; to create a namespace kind of thing?
Uran: In other words: I have some variables that I need to be able to access from a couple of different functions. If I were working in Python, I would just make a cl*** and make them into member variables and the functions into methods. But since there are no cl***es at least in the traditional sense in JS, what’s the best way to emulate that behavior?