Archive for July 28, 2015

Tuesday, July 28, 2015

Why JSON Doesn’t Have Comments

Douglas Crockford (via Dave Dribin):

First, comments turned out to not be very useful.

Second, comments were the most difficult feature to support in JSON parsers. By removing comments, support for JSON in other languages became much easier.

Third, removing comments aligns JSON more closely with YAML, allowing YAML to become a JSON superset. Generally, standards tend to splinter. It is interesting to see these two merging.

Fourth, I saw examples of comments used to carry information, with an expectation that applications would have to have custom comment parsers and generators. That was not a pattern that I wanted to encourage.

Douglas Crockford (via Dave Dribin):

I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn’t.

Update (2015-08-01): Hacker News comments.

Flickr Pro Is Back


Today, we’re excited to unveil the new Flickr Pro for both existing and new members of our community, a subscription that offers improved stats, brings back our Pro badge, offers a discount on Adobe software and more.


Flickr members who don’t currently have Flickr Pro can purchase it today for $5.99/month or $49.99/year.

First, there was regular (free) and Pro ($25/year for no ads, unlimited storage, and extra features). Then there was Free, Ad Free ($50/year for no ads), and Doublr ($499/year for 2 TB instead of 1 TB). Now, Ad Free is called Pro again and adds the statistics features, free shipping, and a 20% discount on the Adobe Creative Cloud plan for Photoshop and Lightroom. The other difference is that the old Ad Free account only removed ads when you were logged in, whereas with the new Pro account:

Your photos, whether viewed by you or a fan, will never be shown next to an advertisement.

Which is a good thing because the ads seem to have gotten a lot more intrusive lately. And I often view my photostream when logged out to make sure that the privacy settings are correct.

Intel Compute Stick

David Pogue:

It’s called the Intel Compute Stick, and it’s really small (4 x 1.5 x 0.5 inches) — so small, you might mistake it for a USB flash drive. It’s the first Windows PC you might lose in your bag. If you were a movie character being chased by techno-terrorists, you could slip the whole thing into your sock.

Better yet: It’s not only the smallest Windows PC type in the world; it’s also the least expensive: just $150 (with 2GB of memory, 32GB of storage, and Windows 8.1).


That’s right. Instead of plugging a monitor into your PC, you now plug your PC into the monitor.

Checking If Mission Control Is Active

Tim Schröder:

Unfortunately, Apple has never provided a public API to programmatically check if Mission Control is active.


It turns out that there is nevertheless an easy way to check if Mission Control is active (code snippet below): We just ask which windows are present on the screen. If there is a specific window present owned by the dock process and with a vertical origin of -1.0, this will be a “Dock Window” as shown by Mission Control only […] Of course this is slightly hackish and might break in the future […]

Swift Whole Module Optimization

Keith Harrison:

For the None or Fast optimization levels the compiler is working with a single source file at a time. When the definition of the generic function is in the same source file as the calling code the compiler knows we are calling the function with integers and optimizes away unnecessary object handling code. This optimization known as Generic Specialization will only work when the compiler has visibility of the function definition meaning that the external definition runs more slowly.

It makes compilation slower, though.