Domain: crockford.com
Stories and comments across the archive that link to crockford.com.
Comments · 144
-
Re:Perhaps in 1955...
oh really? My how times have changed since I studied for a B.A. in English, 1990....
http://www.crockford.com/wrrrld/style2.html#1 -
More suggestions
Good suggestion! I would supplement it with the following as well:
1. Episodic Learner Model/An online Lisp tutorial
2. Common Lisp: A Gentle Introduction to Symbolic Computation
3. How to Design Programs
4. Practical Common Lisp
5a. The book - Structure and Interpretation of Computer Programs
5b. The movies - Structure and Interpretation of Computer Programs
6. Loving Lisp - the Savvy Programmer's Secret Weapon
7. Common Lisp the Language, 2nd Edition
8. On Lisp
9. common lisp: a web application tutorial for beginners
10. JavaScript: The World's Most Misunderstood Programming Language
11. Free JavaScript Learning Center
12. JavaScript for Scared People
13. JavaScript Closures
14. Why's (Poignant) Guide to Ruby
= 9J = -
Crap Code Alert
This code is crap. Use of <a href="javascript:"> makes it same quality as <marquee><font color="#ggggg">OMG Web 2.0!</td></font>
Unlike TFA, here are some resources worth reading:
-
Re:XULRunner future.
It doesn't help that Javascript is the world's most misunderstood programming language.
-
Publishing Tags with JSON
The real power of delicious is that they allow you to get your tags back in a multitude of ways - HTML, RSS and JSON. This means you can integrate your tags into your content to create a better browsing experience. (JSON is also the preferred data interchange method for Yahoo.)
Delicious also allow you to tap into the "hive mind" by using a generic mode whereby you can see tags/URLs for all users, not just your own account. Somewhat perversely, Joshua announced that they have stopped supporting this mode with JSON - leaving only RSS. In fact, Joshua stated that the
/json/tag/* was just an "accident" in the first place!Anyone got any theories as to why that is? Why publish "socialised content" as (much heavier) RSS feeds but disallow lightweight JSON feeds? Is it to drive users to Yahoo? Or stop third party searches and other add-ons? Maybe it's the more prosaic "we forgot to put it in the specs, now we can't be arsed supporting it 'cause it's someone else's baby now."
-
Re:Lets clear this up NOWFrom the article you did not read:
Google Suggest and Google Maps are two examples of a new approach to web applications that we at Adaptive Path have been calling Ajax. The name is shorthand for Asynchronous JavaScript + XML, and it represents a fundamental shift in what's possible on the Web.
Defining AjaxAjax isn't a technology. It's really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:
- standards-based presentation using XHTML and CSS;
- dynamic display and interaction using the Document Object Model;
- data interchange and manipulation using XML and XSLT;
- asynchronous data retrieval using XMLHttpRequest;
- and JavaScript binding everything together.
As others have noted, a shorthand term comprised of the intials of a series of words, and is itself pronounable as a word, is an acronym. Revisionist hostory not withstanding.
The XML part is typically ignored in AJAX discussions, either because people find XML all scary and complex (and so use html/tag-soup), or because they do not understand the inplications for character encoding and internationalization.
-
Re:Ever notice . . .
JavaScript has some nice features that you won't find in any reference book or 'teach yourself' whatnot.
In fact, I'm surprised at how agile the classes and objects can be. Once you get a handle on arrays and start thinking along the lines of JSON for your asynchronous work, you'll be ahead of the game. (Not you personally, just 'you' generically.) -
Re:JavaScript
Not only it's object-oriented, it's actually a pretty flexible kind of OO. You can do prototype-based OO out of the box, or class-based with a bit of tweaking.
-
Re:Javascript namespacesInteresting info about approximating public/private in javascript:
-
Re:Javascript namespaces
The problem in Javascript is not namespaces - it is the fact that there's no way to mark a method/variable as protected/private. So you need to resort to old C-style crap like appending _ to private members if you want to enforce your contracts.
It turns out that Javascript really is a cool dynamic language with more features that most people think. protected/private are possible. see http://www.crockford.com/javascript/javascript.ht
--jeff++m l -
Re:A better web page scripting language?
Everybody wants JavaScript to grow into a robust object-oriented language, but we shouldn't forget that there are other paradigms out there. Although JS' syntax closely resembles Java it's actually a functional, list-based language with some prototype-based OO goodies thrown in. It more closely resembles Python or even LISP than Java.
Part of the reason that JS is underappreciated is that we're all taught primarily to work and think in OO - I know I was. After geting into the world of functional programming by learning Python and Haskell, I am much more attuned to JS' charms. If you solve problems in JavaScript with a function-oriented approach, you may find the same thing.
For more information: "JavaScript: The World's most Misunderstood Programming Language" is a good start.
-
Re:YEAHOh, don't quit: You said Javascript is not enough? Please explain -- and remember that we're not talking about js on web pages (where you cannot trust the js engine to behave)...
I'd like to hear what the language, or the SpiderMonkey implementation, is really missing? You might want to check out Douglas Crockford's article to see some common misunderstandings (the rest of the site has some pieces of js that really show the power of the language).
-
Re:A better web page scripting language?
These articles clear up a lot of common misconceptions around javascript and its OO capabilites.
Classical Inheritance in JavaScript
JavaScript: The World's Most Misunderstood Programming Language -
Re:A better web page scripting language?
These articles clear up a lot of common misconceptions around javascript and its OO capabilites.
Classical Inheritance in JavaScript
JavaScript: The World's Most Misunderstood Programming Language -
Re:Languages & Morfik
You can't be serious. The very worst thing about the AJAX phenomenon is that is has lended credibility to that godawful language.
Ah yes, the world's most misunderstood programming language.
You might find that most of your beef with Javascript lies with its common implementations in web browsers, an entirely different thing to the language itself, and something that people often get confused. -
Re:XML is bloated
If you don't like the XML in Ajax, try JSON (JavaScript Object Notation). With JSON you can implement Ajax without all the XML bloat. Ajax is more about the Asynchronous than it is about the XML. So Ajax without the XML and with JSON is... AJAJ?
-
JSON instead of XML
I've been doing a lot of experimentation with JSON (JavaScript Object Notation) instead of XML. You do everything youw ould do the AJAX way, but the data sent back to the browser is directly interpretable by JavaScript. Thta takes an ENORMOUS load off the client.
JSON-RPC is an extension for doing RPOC via JSON.
-
Re:All at once
Sure, but gzip'd JSON is 15-25% smaller than gzip'd XML. Take a look at the (contrived) examples and try gziping any of them. It's closer to a binary format itself and is really just as, if not more readable than XML.
-
Going right off topic here
Now, if someone came out with, say, a functional scripting language, I might hesitate.
You don't know Javascript? Or maybe you don't know that it has much in common with Lisp/Scheme, with C-like syntax? Look into it - as much as people denigrate it, it's one of the coolest languages out there.
Ruby has pretty much the same features - functional programming is very possible. If you master the concepts using these mostly familiar tools, it's much simpler to jump into the functional languages (or at least it was for me.) -
Re:JS book?
Crockford suggests a couple on this page:
http://www.crockford.com/javascript/javascript.htm l -
Re:The difference between the language and...
sorry, meant JSON (JavaScript Object Notation) not JML... my bad..
:) -
The world's most misunderstood language
"Lisp in C's clothing" http://www.crockford.com/javascript/javascript.ht
m l -
Even the publisher didn't want to do the comics.Interestingly, these comics were screwed from the get-go. In a 1998 interview, Jim Shooter talked about how Valiant Comics was supposed to receive a great deal of support from Nintendo - essentially benefiting the products of both Nintendo & Valiant - but instead, Nintendo never delivered.
This then was a huge stumbling block early on in Valiant's history, nearly crippling them before they had even begun.
(Of course, it's worth noting - as the main article does - that the actual Nintendo comics weren't all that great. Interestingly, this is entirely at odds with the early period of Valiant's subsequent superhero work, often regarded as unusually well-done - especially for the time. Considering Nintendo's infamous game standards, one has to wonder if the disparity in quality was due to the created comics going through a number of N-overseen committees and censors before pen was ever put to paper.)
-
Re:Javascript?
You're trolling, right? JavaScript is a great language, and far more powerful* than you might imagine. Have a look at Dave Crockford's javascript stuff. Alternatively you might be interested in knowing that Javascript also supports (for some values of) goal-directed logic programming as a paradigm, too: js prolog
* if you're about to say anything using the words "Universal" and "Turing": yeah, right, but that's not what I'm talking about and you damn well know it. -
Re:It's still a kludge
Lots of people say that modal dialogs are a mistake and that they shouldn't be used. I don't know who, but they are saying it.
As far as javascript goes, it is really fairly modern and quite complete. The lack of any sort of standard library is a problem, but there isn't really any reasonable mechanism for one anyway. Check out: http://www.crockford.com/ and specifically http://www.crockford.com/javascript/little.html. Also see http://www.squarefree.com/bookmarklets/. Both of these sights are examples of good use of javascript, and both go quite beyond the hackish crap that comes to mind when many people think of javascript. Ok, so maybe the stuff on crockford.com isn't super useful, but it does serve to demonstrate what js is capable of.
-
Re:It's still a kludge
Lots of people say that modal dialogs are a mistake and that they shouldn't be used. I don't know who, but they are saying it.
As far as javascript goes, it is really fairly modern and quite complete. The lack of any sort of standard library is a problem, but there isn't really any reasonable mechanism for one anyway. Check out: http://www.crockford.com/ and specifically http://www.crockford.com/javascript/little.html. Also see http://www.squarefree.com/bookmarklets/. Both of these sights are examples of good use of javascript, and both go quite beyond the hackish crap that comes to mind when many people think of javascript. Ok, so maybe the stuff on crockford.com isn't super useful, but it does serve to demonstrate what js is capable of.
-
this is good, and here's more material
For me, the crux of the usefulness and eventual adoption and finally complete embracing of AJAX lies in the article's paragraph:
Some of the buzz surrounding AJAX has been generated by Web designers as well as programmers. AJAX?s flexibility is invigorating for Web designers because JavaScript can control any aspect of any images or type on a page. Fonts can grow or shrink. Tables can add or lose lines. Colors can change. Although none of these capabilities are new to programmers accustomed to building client applications -- or, for that matter, Java applets -- they are novelties to Web designers who would otherwise be forced to rely on Macromedia (Profile, Products, Articles) Flash.
I've seen what Google has done with AJAX (e.g., Google suggest), and it's stuff I never imagined could be so repsonsive in a web context. For me it starts to make programming fun again, and web programming an acceptable form of application development.
When browsers and web first emerged I could see the writing on the wall, but I wasn't happy about it. Browser application writing from the programming perspective was probably the single most giant leap backwards in technology for me (not including technologies introduced by Microsoft)....: you mean, all the years I've spent honing skills writing applications no longer apply? You mean I no longer have "state" as a tool for maintaining sanity in my application???? Hwaahhh??? I have to do what to change the web page???
While there have been some technologies (ASP, JSP, etc) to help with these issues, none have addressed the responsiveness issue with the web page round trip message loop. AJAX comes close. Now all I have to do is learn it.
For a great example of the responsive nature of this (I've referenced this before), go to Google Personal Home, set up your own home page, and play... Configure your modules by dragging them around... open and close your g-mail previews. This all starts looking alot like programs actually running locally on your own machine. (I'm assuming all are familiar with and have played similarly with Google Maps.)
Additionally, here are some very good resources to learn more about AJAX:
- Very Dynamic Web Interfaces
- XMLHttpRequest Introduction
- An example
- Using the XML HTTP Request object
- Dynamic HTML and XML
- XMLHttpRequest API madness
- Sarissa
- JavaScript: The World's Most Misunderstood Programming Language
- What kind of language is XSLT?
That's it, I'm done.
-
Re:Purpose of Acid2
We have the same problem with javascript, only that is 10 times more disturbing because if javascript was actually the same all other the place web surfing could be enhanced so much. The only reason people don't like javascript is because the popups, and that's not everything in javascript.
I beg to disagree, popups is not the only reason why people hate JS (one could even say that they fear it).
General misuses and abuses of JS is, and in this general abuses are:- Popups, of course
- Stupid effects (shitty animated gifs following cursors anyone?)
- Messing with browsers (resizing, changing parts of the global UI, alert boxes)
- Code design so bad that browsers grind to a halt (oh, i so love seing my CPU usage skyrocket to 100% and stay there because i opened a bugged page)
- Slowing the browsing
- Disabling the browsing altogether because of non standard or stupid scripts (mmm, yummy Javascript links, I mean anchor tags are certainly not hip enough for a damn link are they?)
- Probably many other i can't think of right now
As Douglas Crockford put it, Javascript is the most misunderstood programming language, and I'd add that it's the one with the most extensive yet qualitatively (sp, more than likely) worst documentation ever.
And yet, finding good javascript tutorials and stunning Javascript reference websites is possible. People just don't bother looking for them... -
Re:sounds engrish
No, I'd say it is anguish
-
Re:Weblication?
I thought JSON was the new hotness?
-
Re:S-expressions
Right you are. See for example http://www.crockford.com/javascript/little.html. JavaScript has a lot in common with Scheme.
-
Re:XML-RPC did this *years* ago
with simple protcols like JSON (..) you hardly even need a library
- JSON in Java, an example set of Java classes that parse, generate, and manipulate JSON data strings.
- JSON in C.
- JSON in C#.
- JSON in JavaScript, a note on using JSON notation with JavaScript.
- JSON-RPC.
- JSON-RPC-JAVA ORB.
- JSON in Ruby.
- JSON in ML and Ruby.
- The Fat-free Alternative to XML.
- An example of JSON-encoded messages.
-
Re:XML-RPC did this *years* ago
with simple protcols like JSON (..) you hardly even need a library
- JSON in Java, an example set of Java classes that parse, generate, and manipulate JSON data strings.
- JSON in C.
- JSON in C#.
- JSON in JavaScript, a note on using JSON notation with JavaScript.
- JSON-RPC.
- JSON-RPC-JAVA ORB.
- JSON in Ruby.
- JSON in ML and Ruby.
- The Fat-free Alternative to XML.
- An example of JSON-encoded messages.
-
Re:XML-RPC did this *years* ago
with simple protcols like JSON (..) you hardly even need a library
- JSON in Java, an example set of Java classes that parse, generate, and manipulate JSON data strings.
- JSON in C.
- JSON in C#.
- JSON in JavaScript, a note on using JSON notation with JavaScript.
- JSON-RPC.
- JSON-RPC-JAVA ORB.
- JSON in Ruby.
- JSON in ML and Ruby.
- The Fat-free Alternative to XML.
- An example of JSON-encoded messages.
-
Re:XML-RPC did this *years* ago
with simple protcols like JSON (..) you hardly even need a library
- JSON in Java, an example set of Java classes that parse, generate, and manipulate JSON data strings.
- JSON in C.
- JSON in C#.
- JSON in JavaScript, a note on using JSON notation with JavaScript.
- JSON-RPC.
- JSON-RPC-JAVA ORB.
- JSON in Ruby.
- JSON in ML and Ruby.
- The Fat-free Alternative to XML.
- An example of JSON-encoded messages.
-
Re:XML-RPC did this *years* ago
with simple protcols like JSON (..) you hardly even need a library
- JSON in Java, an example set of Java classes that parse, generate, and manipulate JSON data strings.
- JSON in C.
- JSON in C#.
- JSON in JavaScript, a note on using JSON notation with JavaScript.
- JSON-RPC.
- JSON-RPC-JAVA ORB.
- JSON in Ruby.
- JSON in ML and Ruby.
- The Fat-free Alternative to XML.
- An example of JSON-encoded messages.
-
Re:Javascript is nice, but
Don't underestimate Javascript. In some ways, Javascript is actually a more elegant and well-thought-out language than PHP. See Crockford's rant.
Many *implementations* of Javascript are lacking, but Mozilla applications turn Javascript into a full-featured scripting language, including the ability to use sockets, read/write files, run other executables, and in general do just about everything you would need to do for a XUL "front end" application. For more serious back-end integration, just use sockets to talk to other processes, which can be written in PHP, C, Python, whatever. -
maniac mansion
There's an article that discusses Nintendo's censorship for Maniac Mansion on NES
-
Re:Great work on the story, "editors"Yeah, and so is HTML!
And where was Javascript on this survey, huh? Because only real programmers can handle javascript
:-/Either that, or someone with magical powers...
-
Best. Game. Ever.
The NES version of Maniac Mansion is to this day my favorite game ever. I discover new things about it still after all these years.
It was actually a very interesting ordeal for the development team to get the game approved by Nintendo, The Expurgation of Maniac Mansion for the NES gives some insight into how bland they required their games to be in those days.
The sequel, Day of the Tentacle, for PC was great as well. It's a shame that this game genre has died out.
-
Re:Javascript!
See Mr.Crockford's website at
http://www.crockford.com
for an excellent JavaScript extension library that you can use to add in functionality for string operations like trim() as well as many other functions ranging from 'nice to have' to 'my god this makes my life more better, thank you Mr.Crockford'. -
Re:most misunderstoof language in the world
From here: http://www.crockford.com/javascript/private.html
Private
Private members are made by the constructor. Ordinary vars and parameters of the constructor becomes the private members.
function Container(param) {
this.member = param;
var secret = 3;
var self = this;
}
This constructor makes three private instance variables: param, secret, and self. They are attached to the object, but they are not accessible to the outside, nor are they accessible to the object's own public methods. They are accessible to private methods. Private methods are inner functions of the constructor.
function Container(param) {
function dec() {
if (secret > 0) {
secret -= 1;
return true;
} else {
return false;
}
}
this.member = param;
var secret = 3;
var self = this;
}
The private method dec examines the secret instance variable. If it is greater than zero, it decrements secret and returns true. Otherwise it returns false. It can be used to make this object limited to three uses.
By convention, we make a private self parameter. This is used to make the object available to the private methods. This is a workaround for an error in the ECMAScript Language Specification which causes this to be set incorrectly for inner functions.
Private methods cannot be called by public methods. To make private methods useful, we need to introduce a privileged method. -
Re:Now available in P2P
Better would be to give their SHA1 and MD5 hashes in base32 format. Saerching by name is so inexact when you know precisely which file it is.
-
The Expurgation of Maniac Mansion for the Nintendo
Obligatory link to The Expurgation of Maniac Mansion for the Nintendo Entertainment System
Behold, evil!