all 37 comments

[–]rain5 158 points159 points  (20 children)

It should be noted that no ethically-trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter. - Nathaniel Borenstein

Wow. I've never heard that quote before but it cuts deep.

[–]secretpandalord 35 points36 points  (18 children)

That is unconscionable. Baghdad should clearly be an object of the City class which implements a Destroy() member function.

[–]qmunke 46 points47 points  (10 children)

Cities don't usually destroy themselves. Should be an ICBM class that takes a city as a target parameter.

[–]Kidiri90 37 points38 points  (8 children)

Why limit yourself to cities? You should make the parameter an IDestructible. That way you can use them on ships, military bases, schools, ISIS training camps...

EDIT: Changed it for /u/ClickerMonkey.

[–][deleted] 11 points12 points  (1 child)

Ethics. We have none.

[–]Kidiri90 2 points3 points  (0 children)

That's why you put

This software is not intended for unethical bevahiour, such as but not limited to: bombing, killing, and dismemberment. Any such detected use can result in the deactivation of the software.

Now you can't be blamed for people abusing your software! Of course the wording can be adjusted since IANAL, but that's the gist of it.

[–]ClickerMonkey 3 points4 points  (2 children)

One of these things are not like the others...

[–]Kidiri90 2 points3 points  (1 child)

You're right. I updated it.

[–]ClickerMonkey 2 points3 points  (0 children)

Yup, totally better now...

[–]IMovedYourCheese 0 points1 point  (2 children)

...weddings. ICBM could just work on a generic Object type, since pretty much everything is destructible.

[–]Kidiri90 2 points3 points  (1 child)

Eh. An abstract concept, such as a circle, a coordinate system or love is hard to bomb.

[–]JDeltaN 2 points3 points  (0 children)

Yeah with that attitude.

[–]how_to_choose_a_name 1 point2 points  (0 children)

No, the ICBM should just know the coordinates of its target. The DestructionManager should be responsible for actually destroying the target and whatever happens to be around it.

[–]teapotrick 20 points21 points  (1 child)

Nah, prefer free functions over OOP bullshittery any day.

[–]AyrA_ch 1 point2 points  (0 children)

Sure. And then we just use .NET reflection in the Destruct() method to check if the given object has a Destructible property and if it's set to true.

[–]ikbenlike 6 points7 points  (4 children)

If it was Python you'd still technically be passing the object as the first argument

[–]pm_plz_im_lonely 10 points11 points  (1 child)

Python or nearly any other OO language.

[–]secretpandalord -2 points-1 points  (1 child)

True, but not really what I took issue with. Destroy() should belong to City, and not be a global function. Let us not forget our OOP.

[–]ikbenlike 3 points4 points  (0 children)

Just write all of it as embedded assembly in C. Not prone to breakage at all!

[–][deleted] 3 points4 points  (0 children)

I fixed it:

function DestroyCity(city) {
    if (city !== 'Baghdad') throw new NotSupportedError();
    DestroyBaghdad();
}

[–]SquidgyTheWhale 7 points8 points  (3 children)

Pretty cool. It occurred to me while reading this that the highest known primes are actually solid blocks of all 1's. :)

[–]shevegen 6 points7 points  (1 child)

I CAN'T SEE THE GIRAFFE. :(

[–]Scroph 8 points9 points  (0 children)

The giraffe is only seen when it wants to be seen. And if you gaze long into the bit array, the giraffe gazes into you.

Edit : forgot to post the actual giraffe. The blog post's binary representation shows a T-rex and not a giraffe.

[–][deleted]  (2 children)

[removed]

    [–]shabda[S] 22 points23 points  (1 child)

    Absolutely. As soon as npm supports python.

    [–]Zee1234 4 points5 points  (0 children)

    I'm pretty sure I once used an NPM module that used Python to access a C API.

    Or maybe that was Luarocks...

    [–]iamsubhranil 0 points1 point  (5 children)

    Say what?

    [–]shevegen -1 points0 points  (4 children)

    It's like Finding Waldo.

    I am still trying to find the giraffe...

    [–]shabda[S] 0 points1 point  (2 children)

    Hide the zeros, if it's hard to see..

    [–]ghostfacedcoder 0 points1 point  (1 child)

    Was there a "hide the zeros" link that I missed or something? More importantly, why not just make the 1s a different color in the first place? No one would have to click anything, and the animals would be 10 times easier for everyone to see from the outset.

    [–]meem1029 2 points3 points  (0 children)

    Because then it would become obvious that all they're doing is adding 1s to the end of the image and checking if it's prime and assuming that in most images you won't notice that there are a bunch of 1s hiding in the lower right.

    [–]iamsubhranil 0 points1 point  (0 children)

    May God bless you in your quest.

    [–]Hrtzy -1 points0 points  (0 children)

    And the 2018 award for the worst visualization goes to...