7 ms·
Why use Javascript?
by 1vuio0pswjnm7 4y ago
Why use Javascript?
- revskill 4y agoIt's fast.
- tcfhgj 4y agoNot really
- sgtnoodle 4y agoReminds me of an interview I conducted years ago. I asked the candidate what they would do to make their code run faster. They suggested using the V8 JavaScript engine so that it would be JIT compiled. We were talking about code written in C++, intended to be run on an embedded microcontroller... Also reminds me of many years ago in college, when somebody gave a presentation claiming that java was unquestionably more efficient than C++. I had a lot of questions...
- lynx23 4y agoOnly tangentially related, but this reminds me of a MCSE training I once attended in the 90s, where the trainer claimed Microsoft Passwords are so secure that they can not be cracked in a reasonable amount of time. I couldn't hide my amusment. Since this got him fired up, he went as far as saying "If you believe otherwise, find my password!" to which I replied "No need for that, already done." Thanks l0phtCrack, you made my day.
- 1vuio0pswjnm7 4y agoI met many Microsoft lawyers over the years who behaved the same way. The enthusiasm is effective perhaps, even when it's grounded in ignorance. MS is like a cult.
- samwillis 4y ago> more efficient I was going to make a quip about efficiency being more than execution, with development efficiency also being important. But then with it being a comment about C++ vs Java I decide not to...
- kindawinda 4y agoWhy ask a question that will spawn a comment thread about language superiority without testing or acknowledge what the author provided? Setup stress testing and worked flawlessly. Impressive work author.
- croes 4y agoCritique or honest question? For the former, because the developer wanted to use Javascript.
- Sosh101 4y agoWhy use anything?
- vidarh 4y agoOn the server? As an example of equivalent (to the k and q versions) code. On the client? Because endlessly refreshing the page to refresh chat messages is an awful design that we had enough of already in the 90's.
- HotGarbage 4y agoCould be done with long polling or a never-closing HTTP response. POST to an iframe to keep the page from reloading on send.
- deleted 4y ago[deleted]
- vidarh 4y agoThat's true, and those options are also awful options we used in the 90's and promptly abandoned once better options became available, though they wouldn't make that much difference here. The alternatives are all brittle and limited in different ways.
- IshKebab 4y agoWell sort of. Server Sent Events is basically "official long polling" and it works very well. Way simpler than websockets in many cases. Websockets is obviously better here though.
- vidarh 4y agoThe point isn't that the way the data is sent from the server matters much, but that using javascript to handle the retrieval is beneficial. The first Javascript enabled chats still relied on the same methods of retrieval for a long time, but still significantly improved usability.
- holoduke 4y agoBecause its the most convenient language on the client there is.
- 1vuio0pswjnm7 4y agoThis submission would not have made the front page unless I jump started some discussion. Mine was the first comment. It worked. Front page. Years ago I had used k-based chat, with GUI, on Windows. Without Javascript. (Many years ago, k used to have a built-in GUI.) "Why use Javascript" was a genuine question.