Live data from Hacker News

Please do not attempt to simplify this code

github.com

1–10 of 327 posts

Re: Please do not attempt to simplify this code

#2

        // ==================================================================
        // PLEASE DO NOT ATTEMPT TO SIMPLIFY THIS CODE.
        // KEEP THE SPACE SHUTTLE FLYING.
        // ==================================================================
        //
        // This controller is intentionally written in a very verbose style. You will
        // notice:
        //
        // 1. Every 'if' statement has a matching 'else' (exception: simple error
        //    checks for a client API call)
        // 2. Things that may seem obvious are commented explicitly
        //
        // We call this style 'space shuttle style'. Space shuttle style is meant to
        // ensure that every branch and condition is considered and accounted for -
        // the same way code is written at NASA for applications like the space
        // shuttle.

Re: Please do not attempt to simplify this code

#3
post #2

// ================================================================== // PLEASE DO NOT ATTEMPT TO SIMPLIFY THIS CODE. // KEEP THE SPACE SHUTTLE FLYING. // ================================================================== // // This controller is intentionally written in a very verbose style. You will // notice: // // 1. Every 'if' statement has a matching 'else' (exception: simple error // checks for a client API ca…

hahaha well Kubernetes is the opposite of a special shuttle that keeps on flying. It crashes all the time, version updates etc. If you want stability go to apache or nginx.

Re: Please do not attempt to simplify this code

#4
// KEEP THE SPACE SHUTTLE FLYING.

I understand the intent, but it is a bit funny that the comment references a system that is no longer operational due to its poor safety record.

In ten years or so, will people even remember the Space Shuttle in a good light?

Re: Please do not attempt to simplify this code

#5
post #2

// ================================================================== // PLEASE DO NOT ATTEMPT TO SIMPLIFY THIS CODE. // KEEP THE SPACE SHUTTLE FLYING. // ================================================================== // // This controller is intentionally written in a very verbose style. You will // notice: // // 1. Every 'if' statement has a matching 'else' (exception: simple error // checks for a client API ca…

I tried to link directly to these lines, but hn's url sanitizer stripped off the anchor tags.

Re: Please do not attempt to simplify this code

#6
post #4

// KEEP THE SPACE SHUTTLE FLYING. I understand the intent, but it is a bit funny that the comment references a system that is no longer operational due to its poor safety record. In ten years or so, will people even remember the Space Shuttle in a good light?

Well over 100 successful missions carrying a bunch of people and gear up into outer space and then bringing them back home.

I hold it in a good light now, and will likely continue to feel that way. As far as human progress and net good, it was a success.

Re: Please do not attempt to simplify this code

#7
Main reason it is, as it is, and is usually not seen in any other languages is that go does not has operator functions for variable fallbacks and logical error handling. But overall this helps in improving performance of application(on a large scale).

Re: Please do not attempt to simplify this code

#8
Related article on Space Shuttle Software Quality [0]

Excerpt: "But how much work the software does is not what makes it remarkable. What makes it remarkable is how well the software works. This software never crashes. It never needs to be re-booted. This software is bug-free. It is perfect, as perfect as human beings have achieved. Consider these stats : the last three versions of the program — each 420,000 lines long-had just one error each. The last 11 versions of this software had a total of 17 errors. Commercial programs of equivalent complexity would have 5,000 errors."

[0] https://archive.is/HX7n4

Re: Please do not attempt to simplify this code

#9
post #4

// KEEP THE SPACE SHUTTLE FLYING. I understand the intent, but it is a bit funny that the comment references a system that is no longer operational due to its poor safety record. In ten years or so, will people even remember the Space Shuttle in a good light?

Wasn't a poor safety record whut killed the shuttle. It was the cost, and anticipation of degraded safety, in the future.

Even though more astronauts died, because of the two shuttle accidents, than any other NASA disaster, the safety record was absolutely amazing, when we consider everything that was going on.

The code seems damn good code.

Re: Please do not attempt to simplify this code

#10

Related article on Space Shuttle Software Quality [0] Excerpt: "But how much work the software does is not what makes it remarkable. What makes it remarkable is how well the software works. This software never crashes. It never needs to be re-booted. This software is bug-free. It is perfect, as perfect as human beings have achieved. Consider these stats : the last three versions of the program — each 420,000 lines lo…

[deleted]
Post reply on HN