by brundolf · 5y ago · 0 comments
> With JavaScript, an HTML page might contain an intelligent form that performs loan payment or currency exchange calculations right on the client in response to user input. A multimedia weather forecast applet written in Java can be scripted by JavaScript to display appropriate images and sounds based on the current weather readings in a region. A server-side JavaScript script might pull data out of a relational database and format it in HTML on the fly. A page might contain JavaScript scripts that run on both the client and the server.
We tend to think of JS as having started out as just a way to dynamically show/hide elements, maybe add an animation or two, on top of fundamentally HTML-based web pages. But I see here described what we now think of as "web apps", and even web servers (!) written in JS. They even talk about code-sharing on the front and back ends, a la React in hybrid-mode. I had no idea those things were in people's minds at its inception.
Edit: Apparently they already ran JS on the server! I had no idea
> Netscape LiveWire enables JavaScript programs to be installed, run and managed on Netscape servers
The things being done with JavaScript today are not new, nor is the idea that a server and client would coordinate to run interactive apps. That fundamental concept has been reimplemented in many different ways until we've landed on the current rube goldbergian monstrosity that are web apps.
It shows that the desire to have users interact with a service in particular ways will not go away. The technology used to do that is mostly irrelevant.
It's just a matter of understanding the langauge. That said, it's been my favorite language since well before the "good parts" book.
But I don't think it's controversial to say that the following were objectively bad decisions (in hindsight, of course, but still):
- Automatic casting behavior between the core types (you're the only person I've ever heard suggest that this might be a good thing)
- Automatic semicolon insertion
- A core Date object that lacks basic control over time-zones and reasoning about time-zones
- Assigning to an undeclared variable silently creates a global
- Allowing duplicate function parameter names where later ones just hide the earlier ones
- Distinction between undefined and null (this one might have a few defenders)
Some of these are now prevented by "strict mode". Others have been patched-over, for example by the addition of === which prevents casting behavior for comparisons at least. Others can be bridged by libraries (Moment.js) or by best-practices (use foo == null to smooth over the null/undefined distinction, never use a value's implicit falsiness in a conditional, etc).
But the point is that JavaScript has this giant asterisk that will never go away, of things you need to do/avoid/utilize in order to get the most basic behaviors right.
Specifically the inclusion of a prototype OO system is confusing if you aren't aware what that is and have only been exposed to Java-like OO programming. But in fact it's very powerful and not so hard to learn once you realize you have to.
As with other web technologies, it's simple at first glance but the learning curve gets steeper at some point.
So say we all!
Indeed, your absolutely correct in saying it was obvious where webapps had to go, and that HTML and CSS just wasn't going to get us there.
If you're simply referring to code that could run on both client and server, your point is clearer to me.
Let's face facts...AJAX is the real secret sauce with JS and what makes it truly useful.
Or NeWS[2], also based on PostScript.
https://philip.greenspun.com/wtr/livewire.html
You can see that the current JavaScript tooling complains are nothing new under the sun:
So what used to be a few keystrokes in Emacs or Netscape
Gold now requires three steps:
edit the .html file
recompile the .web file
restart the LiveWire app from the appmgr"This approach has several disadvantages, the first of which is speed. You are gratuitously transporting potentially many kilobytes of data back and forth across the network."
But loading pages was really slow, mainly because browsers were slow. No parallel loading of images, no progressive rendering. Those were the first optimizations.
<HTML>
<HEAD> <TITLE> Hello World </TITLE> </HEAD>
<H1> Hello World </H1>
<P>Your IP address is <SERVER>write(request.ip)</SERVER>
But client side JS had to write() too (there was no DOM), and so we have 'foo'.link('http://example.com')
// "<a href="http://example.com">foo</a>"
'bar'.bold()
// "<b>bar</b>"
http://web.archive.org/web/19961115040956/http://developer.n...[1] https://developer.valvesoftware.com/wiki/Latency_Compensatin...
His browser had many features, including:
- Stylesheets, similar to CSS
- Scripting support, using a scripting language (like JavaScript).
- The equivalent of Iframes
Pei-Yuan Wei is the man.
Hmm, I started work as a web developer back in 2000, and I don't remember ever coming across such a notion. The first time I heard of JavaScript being used server-side was NodeJS many years later.
Edit: introduced in IE3 (1996) apparently. https://en.m.wikipedia.org/wiki/Internet_Explorer_3
Isomorphic app?