Last Build Date: Sun, 25 Sep 2016 02:32:43 GMT
Fri, 23 Sep 2016 10:00:00 GMT
"In life, there are good surprises and bad surprises, but Microsoft fails to differentiate," writes Rob
"Now I know how people from New Foundland feel," writes Chris B.
Austin S. writes, "Who knew that doing squats was the secret to bypassing *nix security?"
Paweł wrote, "I think WolframAlpha should fix its own problems before generating new ones."
"£0? I'll take one. Hell, I'll take ten!" writes Will K.
Rick R. wrote, "What happened with Detroit? Did they run around the bases in the wrong direction?"
Alex F. wrote, "Sometimes I guess string casting is like throwing spaghetti and hoping that it sticks."
Thu, 22 Sep 2016 10:30:00 GMT
For example, you might use the ternary operator to validate the inputs of a function or handle a flag.
Adam Spofford found this creative use of the ternary operator in a game he’s developing for:
this.worldUuid = builder.worldId == null ? null : builder.worldId; this.position = builder.position == null ? null : builder.position; this.rotation = builder.rotation == null ? null : builder.rotation; this.scale = builder.scale == null ? null : builder.scale; this.worldUuid = builder.worldId; this.position = builder.position; this.rotation = builder.rotation; this.scale = builder.scale;
Curious about how this specific block came to be, Adam poked through the Git history. For starters, the previous version of the code was the last four lines- the sane lines. According to
git blame, the project lead added the four ternary lines, with a git comment that simply read: “Constructing world details”. That explains everything.