Follow Slashdot stories on Twitter


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Monads! (Score 2) 536

by Matrix14 (#42226677) Attached to: The Scourge of Error Handling

Monads monads monads monads monads from Haskell.

Or "workflows" in F#. Related to, I think, "generators" in Scala?

Roughly (and I'm going to make up some C++/Java style syntax here), you write something like this:

workflow someExpressionMaybeAnObject
        int x = someassignment;
        some statement;

At the end of each line, you check the return value for errors, and use the handlers defined by the object up top, which could short-circuit the rest of evaluation.

These are actually a lot more general than error handling. For example, they generalize Python-style list comprehensions when used in a certain way.

In Haskell-land, there's a lot of interesting math about how they work, but you don't need it for error handling.

Moral: Learn a wider variety of languages!

Comment: Re:Imagine that... (Score 1) 282

by Matrix14 (#35127872) Attached to: US Has Secret Tools To Force Internet On Dictatorships

English isn't particularly more fault-tolerant than other languages. All languages are fault tolerant. It's why things like noun-verb agreement exist: they provide redundancy and error detection and correction.

English is so dominant on the Internet because England conquered the world and the US is enormously influential.

Comment: Re:Regardless (Score 2, Informative) 742

by Matrix14 (#34370622) Attached to: What To Load On a 4-Year-Old's Netbook?

When I was 10, I was making elaborate 3D models in a modeler called Form-Z, and, while I like to think I'm pretty smart, I don't think that it was that hard. Kids from like 8 to 12 have an incredible ability to hyperconcentrate on cool things like that.

When I was five, I was using a mouse to make drawings in KidPix. I don't think it is that unreasonable to expect a four year old to have a lot of fun with blender. And you are vastly underestimating them if you think they can't use a mouse.

Comment: Re:Only 20 light years??? (Score 1) 575

by Matrix14 (#33744112) Attached to: Earth-Like Planet That Could Sustain Life Found

Re: temperature, Wired article says "minus 24 degrees to 10 degrees above zero Fahrenheit" would be expected, except that it is almost certainly tidally locked, so one side is boiling with the other freezing. There would be a temperate zone in the middle.

Comment: Re:Only 20 light years??? (Score 1) 575

by Matrix14 (#33744094) Attached to: Earth-Like Planet That Could Sustain Life Found

Apparently this one was easier to find because the star was a red dwarf. This means that, because it is not as bright as the Sun, the habitable zone is much closer in and so the gravitational force between the star and the planet was larger. Moreover, the red dwarf is much less massive than the Sun. Together these two facts mean that the star wiggles a lot more do to gravitational effects than an Earthlike planet would cause a Sunlike star to, and so it was easier to find. Aliens on this planet trying to find planets around the Sun with the same techniques would be able find only Saturn and Jupiter.

So says my science writer friend.

"I may kid around about drugs, but really, I take them seriously." - Doctor Graper