4 ms·
JScript
- filoeleven 5y agoTo me, JScript has always been and will always be nothing more than “that thing that tries and fails to execute when I double-click a JS file on a new system.”
- cutler 5y agoR.I.P JScript.
- gillytech 5y ago> JScript supports conditional compilation, which allows a programmer to selectively execute code within block comments. I found this bit to be of particular interest. Why would anyone want to selectively execute code within a comment block? That seems to me to be a Bad Idea™
- zamadatix 5y agoEarly method of making the script run one way in IE and another way in a different browser, also had some predefined variables for handling versions and whatnot. You may remember the same feature but for HTML: <!--[if IE 6]> Obviously modern HTML tags with fallbacks, @supports in CSS, and proper feature detection instead of hardcoding are the better approach nowadays since everyone finally agreed to follow the standards reasonably closely and you don't need version specific hacks rather just checks that something is supported.
- gillytech 5y agoOkay that definitely makes more sense. I use those IE conditional comments to this day in email templates (for Outlook). You know you have a problem when you need to alter web standards in order to let programmers get around your alterations of web standards. As a new HTML coder back in the day these conditional comments were really odd to me. Thankfully we don't have to deal with that much anymore although IE 11 is still out there, lurking.
- anothernewdude 5y agoC supports conditional compilation, where it's great for supporting multiple architectures and operating systems.
- bryanrasmussen 5y agowell sometimes people want to selectively run code in a dev instead of a prod environment. I wouldn't say it's a bad idea, it is a possibility we sometimes need that it would be preferable that we did not need and we should try to get away from needing quickly if we find ourselves in that situation.
- TedDoesntTalk 5y agoOne cool thing we’ve lost in browsers today is the ability to switch between scripting languages. Old IE versions let you use JScript or VBScript by mentioning the language as an attribute in the script tag. And it actually worked: you could mix different languages on the same HTML page (not necessarily a good idea but great flexibility). Imagine if we could specify JavaScript or TypeScript in the script tag for today’s browsers?
- Cyberdog 5y agoTheoretically it could still be done, but by doing so you completely break compatibility with any browser which doesn't support it; I'm pretty sure no non-Trident-based browser ever supported VBScript. Unless some other scripting language gains wide acceptance somehow, I'll be sticking with plain ol' JavaScript for the foreseeable future.
- yjftsjthsd-h 5y agoIt's also a great way to fragment the ecosystem. Firefox supports micropython, Chrome supports TypeScript, Safari supports a subset of AppleScript, and suddenly a page working depends on browser and OS again. JS is a painful least common denominator that still varies too much, but at least it mostly is a common denominator. Edit: That said, maybe webassembly is a way forward.
- gillytech 5y agohttps://www.vugu.org/ https://www.vugu.org/ "Vugu: A modern UI library for Go+WebAssembly"
- tonyedgecombe 5y agoImagine a world where Brendan Eich had said "I can't do a good job in two weeks, just embed Python".
- laurencerowe 5y ago> Imagine if we could specify JavaScript or TypeScript in the script tag for today’s browsers? JavaScript really should follow Python’s lead here and allow but ignore type annotations. I believe TC39 already reserved the lexical space for it.
- listenallyall 5y agodon't forget J++
- tonyedgecombe 5y agoI still support this in one of my applications alongside its twin VBScript. It's becoming difficult now though as a lot of the Microsoft documentation on Active Scripting is disappearing.