

JavaScript: The World's Most Misunderstood Programming Language (2001) - mark_l_watson
http://www.crockford.com/javascript/javascript.html

======
ryanelkins
Not a bad little article, although the fact that it is 8 years old should make
anyone who would find it useful question how much of this is still completely
accurate.

On an somewhat related note, I really hate it when programming articles don't
have a date on them. You start reading just to find out it was written so long
ago that the version of code it was written for no longer exists and
everything is deprecated.

~~~
city41
I hate it when any page on the web doesn't have a date. I wish having created
on and modified on dates was a standard somehow.

~~~
jacquesm
It is a standard, somehow. After all, most if not all webservers will include
that information in the headers.

Browsers could easily display it if their designers wanted to implement that.
It would be a fairly simple addition to put that in to the statusbar on the
right.

I'm not sure if greasemonkey scripts have access to header information but if
they do that might be one way to solve this for you.

~~~
city41
Yeah but that might not be good enough. Like if the user switches web servers,
they restore from a back up, the data is dynamically served, etc, the dates
might not be accurate. What I've always dreamed of is truly accurate dates on
when the article was written, and when it was consciously updated.

~~~
jacquesm
I'm fairly sure that that is exactly how those dates are meant to be used.

If people misbehave then that is not really the fault of the standard.

Just for a little check I just looked at a page by a well-known news service,
today it is the 13th, here is the last-modified header from one of their
articles:

Last-Modified: Fri, 11 Dec 2009 11:14:26 GMT

So it looks like those headers are actually being used the way they are
intended.

Restoring from a backup should definitely preserve the file dates, dynamic
serving could still serve up the right last modified date (such as in the
example above).

Dates not being accurate is more likely to happen when people can enter them
manually!

The only thing remaining then would be a header that registers when the
document was first created, but for that we have the META name='date' tag.

~~~
mcav
Last-Modified isn't intended to preserve the date of the _content_. It
represents the modification time of the _HTML document_ , which is used for
caching. It may or may not -- probably not -- represent the date the article
was modified. To try to do so would conflate the purpose of the Last-Modified
header.

~~~
jacquesm
From <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html>:

"14.29 Last-Modified

The Last-Modified entity-header field indicates the date and time at which the
origin server believes the variant

was last modified.

    
    
           Last-Modified  = "Last-Modified" ":" HTTP-date
    

An example of its use is

    
    
           Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
    

The exact meaning of this header field depends on the implementation of the
origin server and the nature of the original resource. For files, it may be
just the file system last-modified time. For entities with dynamically
included parts, it may be the most recent of the set of last-modify times for
its component parts. For database gateways, it may be the last-update time
stamp of the record. For virtual objects, it may be the last time the internal
state changed.

An origin server MUST NOT send a Last-Modified date which is later than the
server's time of message origination. In such cases, where the resource's last
modification would indicate some time in the future, the server MUST replace
that date with the message origination date.

An origin server SHOULD obtain the Last-Modified value of the entity as close
as possible to the time that it generates the Date value of its response. This
allows a recipient to make an accurate assessment of the entity's modification
time, especially if the entity changes near the time that the response is
generated. "

The word 'caching' is not mentioned in there at all, those are completely
different headers, see the 'cache control' headers in that same document.

~~~
mcav
> "For entities with dynamically included parts, it may be the most recent of
> the set of last-modify times for its component parts."

The content is often considered a subcomponent of the whole page; other
aspects of the HTML may change despite the content remaining the same.

~~~
jacquesm
That's a good point, but the 'essence' of the page is the text, the rest of it
is just a container.

Caching headers could easily take care of all the stuff surrounding the
essential part. If the essential part has multiple components then it would
make sense to use the latest one for that.

If a link to an auxiliary page changes in the navigation that's a job for the
cache control headers.

Either way the page would get reloaded, but at least you'd have a good idea
when the critical component of the page (it's reason for existing in the first
place) was updated.

------
telemachos
This may be out of place, and I have no doubt that Douglas Crockford is a
genius and an all-around excellent human being. Also, I am pretty firmly in
the substance over style camp of web design.

Having said that, I find it pretty hard to accept webpages (in 2009!) that
have _this_ for design:

    
    
        <body bgcolor=linen> 
        <h1 align=center><font size="+4">JavaScript:</font><br>
    

Thank god for Readability...

 _Updates_ : Yes, by Readability I mean
<http://lab.arc90.com/experiments/readability/> It's an outstanding little
mini-app. If you don't know it, try it.

Second, I want to clarify that what I quoted is literall the entire style for
the whole page. I find that mind-boggling. (And, yes, I thought of PG's site.)

Finally, the page was written in 2001, so my crack about 2009 isn't quite
fair. Still, many people do update their sites.

~~~
hyperbovine
_Copyright 2001 Douglas Crockford._

~~~
telemachos
This is a fair point, but people do update their websites. Some people, some
of the time. Still, I'll update my post to note that.

------
mark_l_watson
Thanks to whoever added the 2001 date to my submission - I'll remember to do
that next time.

The history of Javascript is a history of accidents :-)

Javascript is one language that I wish I new better. I can code in Javascript,
but I need references handy to help me remember how to do things. I tend to
just remember the basics required to write CouchDB view functions and simple
web related tasks. However, nice tools like Rails AJAX helpers, couch-potato
(generates CouchDB views from Ruby) and other tools pretty much make it
possible to not spend too much time dealing with Javascript.

Regardess of technical merit, Javascript is used on a wide scale and its use
will I think keep increasing.

------
michaelcampbell
I'll freely admit to being one who didn't "get it" with Javascript back then
(and more recently than I'd like to admit).

Not sure I even get it now, but I'm at least aware enough to admit my lack of
awareness about some (ok, most) things.

------
ThinkWriteMute
I think the Modula series is the most misunderstood programming language.
Perhaps not misunderstood, but the most potential with least use.

(Note: This opinion is probably naive or uneducated)

~~~
jacquesm
There are lots of candidates for that list:

\- occam

\- smalltalk

\- lisp

\- oberon

And that's just the tip of the iceberg of languages that seem to somehow have
missed the adoption that they definitely deserved. And, conversely there are
plenty of languages that did not 'deserve' the recognition they got.

It's almost like fashion, some stuff makes perfect sense but will never make
it, other stuff is pointless and a smash hit.

~~~
BerislavLopac
"Undervalued" is quite different from "misunderstood". Most of the languages
you both listed are not quite known even emong programmers; on the other hand,
anyone who's evenr dabbled with Web production (and many that just browse)
have at least heard of Javascript. Douglas' point is that many people think
that they know what Javascript is all about, but they're wrong.

------
tyrmored
I really disliked working with JavaScript until Douglas Crockford told me it
was Scheme with C syntax, and then, suddenly, everything made sense and I
actually began to enjoy it.

