Profile

Cover photo
Douglas Crockford
Works at PayPal
Lives in San Jose
19,588 followers|2,503,148 views
AboutPosts
People
Have him in circles
19,588 people
Jesús Pérez's profile photo
Renju Paul's profile photo
adelvis uba's profile photo
Alex Wingrove's profile photo
Jerry Peralta's profile photo
Andy Sowards's profile photo
Nicola Peluchetti's profile photo
Fredrik Blanco's profile photo
John Peberdy's profile photo
Communities
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
San Jose
Story
Tagline
_ __ ___ ____ _____ In the Twenty First Century!
Introduction
On the internet, nobody knows you're a Doug.
Bragging rights
I discovered the JSON Data Interchange Format. I also discovered that JavaScript has good parts. That was the first important discovery of the 21st Century.
Work
Occupation
The Boss of You
Employment
  • PayPal
    present
Basic Information
Gender
Male

Stream

Douglas Crockford

Shared publicly  - 
 
I will be headlining at Modern Web 2016.
 ·  Translate
Modern Web 2016將在8/24-25兩日,在台北文創舉行。今年Modern Web 2016邀請到JSON格式與《JavaScript:優良部份》作者 Douglas Crockford和Google、Nginx高手們進行主題演講,揭示Web發展動態。另外有中國Web/電子商務專家齊聚,完全解密他們在Web產業的實踐經驗,還有台灣業界高手不藏私分享。最精彩的Web技術分享與交流,就在Modern Web 2016
13

Douglas Crockford

Shared publicly  - 
 
I am certain that autonomous automobiles will kill many people, especially passengers and pedestrians. But they will kill far fewer than human controlled automobiles, which kill a 9/11 of humanity every month. We consider that level of accidental death to be acceptable. We will hold the machines to a much higher standard.
40
4

Douglas Crockford
owner

Discussion  - 
 
finally

Java has finally to mitigate its lack of functions. finally implements an implied function call. Implied functions are very powerful, perhaps too powerful, providing more weirdness and confusion than utility.

Should JSLint warn when a finally clause alters the control flow? Should JSLint warn about all finally clauses?
29 votes  -  votes visible to Public
Warn on *finally*
52%
Warn on *finally* with *return*, *break*
38%
Do not warn on *finally*
10%
1
Hector Rivas's profile photoDouglas Crockford's profile photoAlex Babis's profile photo
10 comments
 
My point was that you wouldn't want finally for async code, but that I wasn't sure for synchronous code. The problem I see, is that instead of try-catch-finally, you end up with a try-catch inside a try-catch, which I would have a harder time reading. I suppose the counter to that is that you should write your code in such a way that you always handle errors before running the "finally" code, making "finally" semantics unnecessary. Is that what's being argued?
Add a comment...

Douglas Crockford

Shared publicly  - 
 
• With a bullet

Some of the early programming languages used a period to indicate the end of a statement, mimicking the use of the period in prose. This had problems due to the overloading of the dot: It can also mean decimal point and member selection, so it was mostly abandoned. (But Erlang still uses it.)

Denoting of the end of a statement is not necessary if there is a perfect mapping of statements to lines. If each line contains exactly one statement, and if each statement is fully contained in a line, then line breaks are sufficient to determine the beginning and end of statements.

But that is not sufficient. Sometimes a statement cannot fit on a single line. So FORTRAN allowed for having continuation cards so that a statement could be continued on the next card. FORTRAN did this by putting a character in column 6, a column that must be blank for the first line of a statement. FORTRAN was extremely influential. There are nasty FORTRANisms that can be found in most of our modern languages. But fortunately, the nasty column 6 bit has died away. Other languages dealt with continuation in other ways, with signalling characters, or indentation, or incompleteness.

The C languages rely on ; and } to explicitly terminate statements. JavaScript attempts to make termination optional with a mechanism called Automatic Semicolon Insertion, but unfortunately it is not  competent.

I think a better approach would be to explicitly indicate the beginning of statements. A statement could continue as needed onto subsequent lines until the beginning of the next statement.

Every statement should start with a • character. We can then read a program like a bullet list or outline.
18
3
Douglas Crockford's profile photoGreg A. Woods's profile photoDor Kleiman (configurator)'s profile photo
4 comments
 
+Douglas Crockford not too stupid, too lazy. 

Douglas Crockford

Shared publicly  - 
 
you

How much do you make? Have you ever contemplated suicide? Are you now or have you ever been... ? Are you aware of the fact... ? I have here before me.... Electrical information devices for universal, tyrannical womb-to-tomb surveillance are causing a very serious dilemma between our claim to privacy and the community's need to know. The older, traditional ideas of private, isolated thoughts and actions--the patterns of mechanistic technologies--are very seriously threatened by new methods of instantaneous electric information retrieval, by the electrically computerized dossier bank--that one big gossip column that is unforgiving, unforgetful and from which there is no redemption, no erasure of early "mistakes." We have already reached a point where remedial control, born out of knowledge of media and their total effects on all of us, must be exerted. How shall the new environment be programmed now that we have become so involved with each other, now that all of us have become the unwitting work force for social change? What's that buzzzzzzzzzzzzzzzzzzing?

[Marshall McLuhan, The Medium Is The Massage, 1967]
23
1

Douglas Crockford

Shared publicly  - 
 
I will be headlining at Midwest JS in Minneapolis.
August 10th, 11th & 12th, 2016 in Minneapolis, Minnesota! Midwest JS is a premier technology conference focused on the JavaScript ecosystem. The conference has been a tremendous success the past two years and we hope to make it even better in 2016! The conference will be held in downtown ...
7
1

Douglas Crockford

Shared publicly  - 
11
2
Have him in circles
19,588 people
Jesús Pérez's profile photo
Renju Paul's profile photo
adelvis uba's profile photo
Alex Wingrove's profile photo
Jerry Peralta's profile photo
Andy Sowards's profile photo
Nicola Peluchetti's profile photo
Fredrik Blanco's profile photo
John Peberdy's profile photo

Communities

Douglas Crockford
owner

Discussion  - 
 
Should JSLint warn on nested try statements?
35 votes  -  votes visible to Public
Yes
71%
Yes, except for try in a catch
20%
No
9%
1
Douglas Crockford's profile photoAlex Babis's profile photoChris Nielsen's profile photo
8 comments
 
Perhaps not disallowed, but they should be viewed with suspicion and justified by the coder.

Any function should be as complex as necessary, but no more than that. A single function that contains multiple "try" statements is, by definition, doing more than one potentially exceptional operation. This is a code smell. Could such code really not be simplified further? Does it really not make more sense to break it apart into smaller steps?
Add a comment...

Douglas Crockford

Shared publicly  - 
 
That's Morse Code! They're Still Alive!

Unicode is (or should be) the single encoding for the transmission of all of the world's text. But Hollywood teaches us that when all else fails, our very survival may depend on our knowledge of Morse Code. Samuel Morse was a portrait painter with an interest in electricity. He designed his telegraph code so that the most frequent characters would require the least time to transmit, so it was not only a character encoding, it was also a data compression algorithm.

Morse code is a useful thing to know in case you are ever trapped in a submarine, or in a mine, or on a starship, and you need to communicate with your rescuers or the rebel fleet. Having to learn 26 things is hard, especially when motivated by such an unlikely contingency, so some mnemonic assistance is desired.

You should already know V (for Victory!) from the opening movement of Beethoven's Fifth.

  V is dot dot dot dash.

You know S and O from the SOS distress signal.

  S is dot dot dot.
  O is dash dash dash.

That knocks the number of things we have to learn down to 23.

There is the frequency clue. The most frequently used letters in English have short and simple Morse encodings, so

 E is dot.
 I is dot dot.
 T is dash.
 M is dash dash.

That knocks the number of things we have to learn down to 19, which is still a huge number. You could hope to save the day with 7 letters, but I think it is pretty unlikely.

So let's translate the remaining codes into words, where a dot becomes a vowel, and a dash becomes a consonant. We will form words that include the letter that the word represents.  

 A is AM dot dash
 B is BEAU  dash dot dot dot
 C is COCO  dash dot dash dot
 D is DIE  dash dot dot
 F is OOFY  dot dot dash dot (that's right, oofy)
 G is GNU  dash dash dot
 K is KIT  dash dot dash
 L is ALOE  dot dash dot dot
 N is NO  dash dot
 P is EXPO  dot dash dash dot
 R is ORE  dot dash dot
 U is OUT  dot dot dash
 W is OWL  dot dash dash
 Y is YUCK dash dot dash dash

 Think of the 4H club and their advisor, Mister 4H himself: Harry Herbert Hoover Heever.

H is dot dot dot dot.

That leaves the four lousy letters J, Q, X, and Z.

 J is IJJJ  dot dash dash dash
 Q is QQUQ  dash dash dot dash
 X is XOOX  dash dot dot dash
 Z is ZZOO  dash dash dot dot

Don't ever forget this. The fate of the galaxy may depend on it.
34
6

Douglas Crockford

Shared publicly  - 
 
Distrust & caution are the parents of security.

Be neither silly, nor cunning, but wise.

Three may keep a Secret, if two of them are dead.

To whom thy secret thou dost tell, to him thy freedom thou dost sell.

If you would keep your Secret from an enemy, tell it not to a friend.

[Benjamin Franklin, Poor Richard's Almanack]
17

Douglas Crockford
owner

Discussion  - 
 
Should JSLint warn on get and set?

We are transitioning way from use of mutation and side effects. Getters and setters, by enabling side effects on simple assignment, seem to be going in the wrong direction.
65 votes  -  votes visible to Public
Warn on get and set
80%
No warning
20%
1
Douglas Crockford's profile photoFelix E. Klee's profile photoJames Long's profile photoVishal Srivastava's profile photo
22 comments
 
+Евгений Орехов The practicality is there. There are a lot of beautiful pattern that gets enabled by using a functional approach.

For example, if things dont change after being created then the concept of memoization gets enabled which improves performance significantly.

Hope that helps :)
Add a comment...

Douglas Crockford

Shared publicly  - 
 
Small group sharing from Google
13
1