Profile cover photo
Profile photo
Peter Mallett
149 followers -
Wark!
Wark!

149 followers
About
Peter's posts

Post has shared content
FORTRAN was not the first language to make the mistake of using the equal sign to mean assignment, but it was popular and influential. There were later languages that did not repeat that mistake, including ALGOL and BCPL. Unfortunately, C followed FORTRAN's example, compounding the mistake by making == the equality operator. JavaScript compounds C's mistake by making == unreliable. The fix, adding a === operator, does not seem much like a fix.

There is a very good argument that programming languages should not have any sort of assignment operator at all, but the mainstream of our profession is still not ready to hear that argument. But if there is an assignment operator, common sense should demand that it not be confused with the equality operator. Sadly, common sense rarely prevails in the design popular programming languages. That is why JSLint prohibits use of assignment in expression position, comparison in statement position, and == in any position. Those prohibitions allow you to easily avoid a class of nasty bugs. JSLint's prohibitions do not prevent the crafting of good programs. They actually make it easier.

But reasoning about programming style is surprisingly difficult. For example, someone recently wrote this in the G+ JSLint community:

    I have definitely found cases were using assignment
    expressions create beautifully compact code that I
    think is much easier to read than the alternative.

The appeal to beauty gives this the appearance of a powerful argument. But beauty is at best subjective. Certainly in the arena of computer programs, there is not a standard of beauty, so that leads to the conclusion that all representations are acceptable because everything must be attractive to somebody.

But programs have a requirement that they be completely free of error. This requirement is imposed by the computers, because they give themselves license to do terrible things when our programs are not perfect. Perfection, not beauty, must be our goal. I too used to make emotional arguments about programming, and I too had no awareness of how vacant my arguments were.

JSLint has been my mentor on programming style. I did not write JSLint to force my sense of beauty on others. I wrote it to find defects in programs, specifically in my programs. JSLint taught me that if I care about the correctness of my programs, and that should always be our first concern, then I needed to correct my idea of what a good program looks like. We should seek to increase the visual distance between a good program and a bad one. We should not be creating beautiful pockets in which bugs can hide when there are better alternatives.

Post has attachment

Post has attachment

Post has attachment
The great Christmas-tree-plague of 2014 hit my neighborhood pretty hard.
Photo

Post has attachment
This is probably my favorite example of the "progress quest" style game I've seen to date http://adarkroom.doublespeakgames.com/

Post has attachment
I might be misremembering, but didn't Cookie Crisp used to have a burglar as its mascot? Also, I really want to try "Koo-Kies!".
Photo

Post has attachment
Someone mostly fixed the most horrible parts of "Wrecking Ball" https://soundcloud.com/d-j-detweiler/miley-cyrus

Post has shared content

Post has shared content
Sounds like a good way to run a representative democracy.

Post has shared content
This gif is mesmerizing. 
Jupiter and the Sun are the two largest objects in our Solar System, and as they orbit around one another, they create regions where their gravity roughly cancels out. These are the Lagrangian points, created whenever two objects orbit one another: places where gravity is such that another small object can follow along in the orbit without being pulled in or out. And since things aren't getting pulled out of there, they get stuck in there as well: and so we have two large clumps of asteroids (and miscellaneous smaller space debris) in Jupiter's orbit. These are called the Trojan Asteroids; the group ahead of Jupiter is known as the Greek Camp, and the group behind it the Trojan Camp, with the asteroids in each camp being named after famous people in that war. Together, these two camps have as many asteroids as the Asteroid Belt.

Other stable patterns are possible, too: another one is what's called a 3:2 resonance pattern, asteroids whose motion gets confined to a basically triangular shape by the combined pull of Jupiter and the Sun. This group (for Jupiter) is called the Hilda Family, and their route forms a triangle with its three points at the two Lagrange points and at the point on Jupiter's orbit directly opposite it from the Sun. 

None of these orbits are perfectly stable, because each of these asteroids is subject to pulling from everything in the Solar System; as a result, an asteroid can shift from the Lagrange points to the Hilda family, and from the Hilda family to the Asteroid Belt (not shown), especially if it runs into something and changes its course. 

The reason that Pluto was demoted from planet to dwarf planet is that we realized that these things are not only numerous, but some of them are quite big. Some things we formerly called asteroids are actually bigger than Pluto, so the naming started to seem a little silly. So our Solar System has, in decreasing order of size, four gas giant planets (Jupiter, Saturn, Neptune and Uranus); four rocky planets (Earth, Venus, Mars, and Mercury); five officially recognized dwarf planets (Eris, Pluto, Haumea, Makemake, and Ceres); and a tremendous number of asteroids. (We suspect that there are actually about 100 dwarf planets, but the job of classifying what's an asteroid and what's actually a planet is still in progress -- see the "dwarf planet" link below if you want to know the details)

Ceres orbits in the Asteroid Belt, about halfway between Mars and Jupiter, just inside the triangle of the Hilda Family; Pluto and Haumea are both in the distant Kuiper Belt, outside the orbit of Neptune but shepherded by its orbit in much the same way that the Hildas are shepherded by Jupiter; Makemake is what's called a "cubewano," living in the Kuiper Belt but unshepherded, orbiting independently; and Eris is part of the Scattered Disc, the even more distant objects whose orbits don't sit nicely in the plane of the Solar System at all, having been kicked out of that plane by (we believe) scattering off large bodies like Jupiter.

But mostly, I wanted to share this to show you how things orbit. This picture comes from the amazing archive at http://sajri.astronomy.cz/asteroidgroups/groups.htm, which has many other such pictures, and comes to me via +Max Rubenacker

More information about all of these things:
http://en.wikipedia.org/wiki/Lagrangian_point
http://en.wikipedia.org/wiki/Trojan_(astronomy)
http://en.wikipedia.org/wiki/Hilda_family
http://en.wikipedia.org/wiki/Dwarf_planet
http://en.wikipedia.org/wiki/Kuiper_belt
http://en.wikipedia.org/wiki/Scattered_disc

#ScienceEveryDay
Animated Photo
Wait while more posts are being loaded