Friday, August 5, 2016

Frequent Password Changes Are a Bad Idea ↦

Cranor eventually approached the chief information officer and the chief information security officer for the FTC and told them what a growing number of security experts have come to believe. Frequent password changes do little to improve security and very possibly make security worse by encouraging the use of passwords that are more susceptible to cracking.

[…]

Over the past few years, organizations including the National Institute of Standards and Technology in the US and UK government agency CESG have also concluded that mandated password changes are often ineffective or counterproductive.

Bingo.


Thursday, July 28, 2016

“When the Strong Outbreed the Weak” ↦

An experiment in selective breeding for a desirable trait shows that the simple approach does not produce the expected outcome:

The purpose of the experiment was to increase the egg-laying productivity of hens. The hens were housed in cages with nine hens per cage. Very simply, the most productive hen from each cage was selected to breed the next generation of hens.

If egg-laying productivity is a heritable trait, then the experiment should produce a strain of better egg layers, but that’s not what happened. Instead, the experiment produced a strain of hyper-aggressive hens[…]. There are only three hens [left in the final cage] because the other six were murdered and the survivors have plucked each other in their incessant attacks. Egg productivity plummeted, even though the best egg-layers had been selected each and every generation.

The reason for this perverse outcome is easy to understand, at least in retrospect. The most productive hen in each cage was the biggest bully, who achieved her productivity by suppressing the productivity of the other hens. Bullying behavior is a heritable trait, and several generations were sufficient to produce a strain of psychopaths.

There are many, many interesting things to learn here. Most directly, this is a lesson in just how complex biology is. But there may also be lessons here for human society:

In a parallel experiment, Muir monitored the productivity of the cages and selected all of the hens from the best cages to breed the next generation of hens. […] Egg productivity increased 160% in only a few generations, an almost unheard of response to artificial selection in animal breeding experiments.

It’s easy to credit the director with the success of a great movie. But have have you ever watched the entire list of credits at the end of your favorite movie? Modern movies do not spring, fully formed, out of the mind of the director, as Athena from Zeus. Nor are they simple collaborations among the director and actors. They are the products of small armies of people, working collectively to produce something far greater than any one of them could achieve on his or her own. The same is true of any great achievement.


Tuesday, July 12, 2016

Mash Up: Archer and Star Trek: The Animated Series ↦

Someone decided to mash-up Archer and Star Trek: The Animated Series. Brilliant.


Tuesday, June 14, 2016

“Space Yourself” ↦

There’s a lot more to spaces than that big key on your keyboard:

Spaces are [in the Unicode table], too. There’s the one with an agent good enough to have gotten it the biggest key on everyone’s keyboard, but there are many more: the very narrow hair and thin spaces, the super-wide en and em spaces, and a few others in between:

  • Hair space
  • Six-per-em space
  • Thin space
  • Normal space
  • Four-per-em space
  • Mathematical space
  • Punctuation space
  • Three-per-em space
  • En space
  • Ideographic space
  • Em space

Tuesday, June 14, 2016

SyntaxError: Not a Chance ↦

Guido van Rossum, creator of the Python programming language, mentioned on Twitter what his favorite error message in Python is:

My favorite Python error message:

>>> from __future__ import braces
File "<stdin>", line 1
SyntaxError: not a chance

Bingo.


Tuesday, June 14, 2016

Comparing Google and Apple Maps ↦

Justin O’Beirne has written the first part of what will no doubt become the definitive comparison between Google and Apple Maps:

We looked at 54 pairs of maps across three cities (New York, San Francisco, and London) and found several significant differences:

  • Apple Maps, on average, labels more cities than Google at every zoom.
  • Google Maps, on average, labels more roads than Apple on nearly every zoom.
  • For two-thirds of zooms, both maps generally show the same number of roads. For the remaining third, Apple almost always shows more roads.
  • Both maps, on average, label a similar number of POIs—but have only 15% of their POIs in common on an average zoom.
  • Both maps also prioritize different kinds of POIs: Google Maps heavily prioritizes transit, while Apple prioritizes landmarks. Apple also generally shows a greater number of POI categories on a given zoom—and shows twice as many restaurants and shops as Google.

Be sure to click through to see the side-by-side images.


Wednesday, May 18, 2016

A Brief History of the C Programming Language

Note: This is the first of what will likely become a small series of posts about the C programming language.

It turns out that two of the most influential software projects in the history of computing1—the C programming language and the UNIX operating system—are deeply intertwined and share a common history.2

Unix and C

That history begins with an ambitious project to create a new time sharing operating system for mainframe computers. MIT, General Electric, and Bell Labs began cooperating on this project—called Multics—in 1964. But development on the project was relatively slow so in 1969, Bell Labs decided to withdraw from the project. Still wanting a new operating system, one of the Bell Labs researchers, Ken Thompson, took the lead in developing what became UNIX3. The first version of UNIX was written for the DEC PDP-7 That version of UNIX was written entirely in assembly code, or in other words, instructions fed directly to the CPU. Desiring a higher-level programming language for applications on the new operating system, Ken Thompson also started work on a language called B, which was loosely based on the existing language BCPL but heavily modified to work on the resource-constrained PDP-7

In 1970, the still-nascent UNIX project was given a DEC PDP-11. Because the PDP-11 could not run assembly code written for the PDP-7, UNIX had to be rewritten from the ground up. B, too, was ported to the new machine but several deficiencies in the language became apparent as it began to see wider usage within Bell Labs. In 1971, another Bell Labs researcher, Dennis Ritchie, began making several changes to B, both to adapt it to the new hardware and to resolve some of the issues in the language. While he initially called his project NB (short for New B), by 1973 it was clear that a new language had emerged which was given the name C. When C was mature enough to work with, the UNIX kernel itself was rewritten (a third time) in C, so that the code could be more easily updated. As a side benefit, having UNIX written in C meant that it would be easier to port to other computer architectures in the future.

Beyond Bell Labs

With UNIX up and running on the PDP-11 series of computers and with most of the UNIX code written in the highly portable C language, Bell Labs had something that should have been a great software product. But there was a problem. Bell Labs was, of course, owned by AT&T and at the time, AT&T remained a highly regulated monopoly. In particular, a 1956 consent decree entered into with the US Department of Justice restricted AT&T’s ability to enter new markets. While prohibiting the sale of UNIX, then, AT&T’s lawyers did at least allow Bell Labs to distribute the source code to universities and research institutions as long as they only charged for the cost of the media and shipping. That decision made UNIX effectively free.

Several institutions requested and received copies of UNIX. Many of these same institutions had also been participating in the ARPANET project, the predecessor to the Internet. In 1975, RFC 681 was published, advocating the use of UNIX on ARPANET hosts. By 1978, UNIX had been ported to the IBM System/360 and the Interdata 8/32. UNIX’s low cost, high portability, and connection to the growing ARPANET combined to fuel considerable growth in its use, especially at universities. By the early 1980s, it was the de facto standard operating system for university computer science departments in many parts of the world.

And, of course, wherever UNIX went, C went too. UNIX itself was written in C and therefore so were the extensions to UNIX that the universities were writing and distributing. But the fact that a C compiler was included with UNIX meant that most applications for UNIX were also written in C. UNIX and C became so pervasive in universities throughout the world that an entire generation of computer science majors were taught to program using C. C was also ported to other platforms and today compilers for C can be found on every major platform (and most minor ones, as well).

Standardization and Diversification

In 1978 Brian Kernighan and Denis Ritchie published The C Programming Language: a book detailing what the C language was. As the use of C spread, and especially as new compilers for C were written for new platforms, that book—often known simply and affectionately in the C community as K&R—effectively became the standard definition of what C was. By the early 1980s, however, it was clear that something more was needed. C had continued to evolve after the book was published and many of the new idioms and types available in most C compilers weren’t even mentioned in the book.

In 1983, the American National Standards Institute (ANSI) accepted the task of producing an official standard for the C programming language. The ANSI group working on C took a conservative, deliberate approach so the first standard wasn’t published until 1989. ANSI continues to maintain and occasionally update the standard with two major revisions so far: C99 and C11, published in 1999 and 2011 respectively.

Before C had even been standardized, however, new variants—C-like languages—had started to appear. As early as 1979, Bjarne Stroustrup began work on what initially was a series of object-oriented extensions to C (based on concepts from the Simula programming language) but eventually became its own language. Originally called “C with Classes”, it was renamed to C++ in 1983 and went on to have its own standardization process.

Another effort to bring object-oriented programming to C, called Objective-C, began in 1983. Objective-C was heavily influenced by the SmallTalk programming language and borrowed its concept of passing messages to objects as well as a square bracket syntax for message passing4. Objective-C was adopted by NeXT as its preferred programming language and as such went on to become the primary programming language of the NeXTSTEP operating system and its descendants, macOS and iOS.

C++ and Objective-C represent the vanguard of what became a Cambrian explosion of C-based languages. Dozens of languages, including Java, PHP, JavaScript (aka ECMAscript), C#, D, Scala, Rust, Go, and Swift, all share a C-style syntax, along with several other key concepts borrowed from C.

Fugit inreparabile tempus

According to the TIOBE index for April 2016, C is the second most popular programming language in use today. What’s curious is that if you look at the top 20 most popular programming languages,5 C is the oldest by about a decade. In fact, the next two oldest languages on that list—C++ and Objective-C—are C’s direct descendants mentioned above. Most of the rest of languages on that list date from the 1990s or later.

It’s difficult to overstate just how much computers have changed since C was developed in the early ’70s. As outlined above, initial work on the B and C languages took place on the PDP-7 and PDP-11, machines that are extremely limited by modern standards. The PDP-7 had only 8 kilowords of memory.6 Although cutting-edge when it was delivered and more advanced than the PDP-7 that it replaced, the PDP-11 still only had 24 kilobytes of memory. The limitations of these machines had a significant impact on the designs of both B and C as programming languages.

One example of this impact is C’s type system. The initial release of the PDP-11 did not support performing floating-point arithmetic in hardware. Its manufacturer, however, promised that hardware support for floating-point arithmetic would come in a soon-to-be-released add-on module. To make it easier to support the PDP-11 both with and without the hardware floating-point unit, Ritchie decided to add a type system to C. C’s model for variable types, therefore, was driven by practical concerns about the specific hardware on which C was developed. Or, as Ritchie himself puts it (emphasis added), “…it seemed that a typing scheme was necessary to cope with characters and byte addressing, and to prepare for the coming floating-point hardware. Other issues, particularly type safety and interface checking, did not seem as important then as they became later.

The C programming language was a remarkable achievement for its time. As is always the case, however, it is very much a product of its time. And that time was the early 1970s. The computing landscape has changed dramatically in the 45 years or so since C was being developed. As I’ll explore in a future post, C itself and the C-style syntax that so many other languages use feel very much like anachronisms to me; relics from an earlier time whose continued use is all the more puzzling given the technology industry’s relentless drive forward.


  1. The influence of the C programming language will become quite evident throughout the rest of this article. The influence of the UNIX operating system is too large a tangent to explore fully in this post so I will simply say this: if you are reading this article on an iPhone, iPad, Mac, Android Phone, Android Tablet, or Chrome Book, you are using an operating system derived, ultimately, from UNIX

  2. Most of the information about the early days of C in this post comes from Dennis Ritchie’s recollections of the origins of C, first published in 1993. 

  3. The initial spelling, Unics, was suggested as a pun about Multics. It seems no one remembers exactly how the final spelling of UNIX came to be. 

  4. This choice of syntax has long baffled myself and other programmers. The square brackets comport very nicely with SmallTalk’s style of syntax but clashed noticeably with C’s syntax style. 

  5. The index also includes “Assembly Language”. TIOBE has certain criteria for deciding what is and what is not a programming language and by those criteria assembly language is included. Its inclusion, however, is problematic in a number of ways, not least of which is the fact that there is no one assembly language; every processor architecture has a different assembly language. Pinning down an age for “assembly language” is therefore quite difficult. It seems reasonable to assume that the most commonly used assembly language would be the language for the most commonly used processor architecture, which at the moment is x86. The x86 architecture was introduced in 1978, which means that C is still older. Given the difficulties of establishing exactly what “assembly language” is, the discussion above about popular programming languages and their ages ignores it. 

  6. The PDP-7 came before the computer industry had settled on bytes as the fundamental unit of memory. A bit is a single binary value, either 0 or 1. A byte is a group of 8 bits, or eight values of 0 or 1 grouped together. The memory in the PDP-7, however, was grouped into 18-bit words instead of 8-bit bytes. In his recollections of the origins of C, Ritchie stated that it had “8K 18-bit words of memory”. To calculate the raw memory capacity, you can convert the PDP-7’s words into bytes: 8,000 units × 18 bits/unit = 144,000 bits; 144,000 bits ÷ 8 bits/byte = 18,000 bytes or 18 kilobytes. It’s important to remember, however, that the memory was addressed in 18-bit words and therefore no value in memory could be less than 18-bits. So even though the raw memory capacity was equivalent to 18 kilobytes, the maximum number of values that could be stored and accessed by the memory system was only 8,000 and not 18,000. 


Tuesday, May 17, 2016

Open Offices Are Terrible ↦

I briefly mentioned open office plans before, but Tom Morris found some scientific studies to back up the conclusion that open offices are terrible:

So, open plan makes you feel like you are being preyed upon by someone trying to kill you, and it makes you less motivated to work on hard problems, and it makes you less likely to adjust your work station posture, meaning you are more likely to get a nasty physical problem like RSI. That sounds great. Just the sort of place you can relax and focus on solving hard problems, as knowledge workers are asked to do every day.

He also mentions something that I hadn’t considered before but makes sense: as awful as open offices are in general, they are even worse for those with hearing loss.


Tuesday, May 17, 2016

Windows 95 on the Apple Watch ↦

The computer you can wear on your wrist is as powerful as the computers we used to have on our desks. This is a testament to miniaturization:


Thursday, April 28, 2016

Barbara Boxer on Carly Fiorina ↦

Barbara Boxer, Carly Fiorina’s more successful rival in the 2010 race for U.S. Senator from California, had what is possibly the most perfect response to the announcement that Fiorina is Ted Cruz’s choice for Vice President:

I predict that the latest @CarlyFiorina merger will be as successful as her last one.