r/programming • • Jul 30 '16

A Famed Hacker Is Grading Thousands of Programs — and May Revolutionize Software in the Process

https://theintercept.com/2016/07/29/a-famed-hacker-is-grading-thousands-of-programs-and-may-revolutionize-software-in-the-process/
835 Upvotes

209 comments sorted by

View all comments

0

u/[deleted] Jul 30 '16

[deleted]

0

u/[deleted] Jul 30 '16

[deleted]

9

u/vinnl Jul 30 '16

And uses only bug-free tools to build and run that software.

1

u/[deleted] Jul 30 '16

The software that I write has no organic parts, thus it is bug-free by definition.

You can write bug-free code though, but it requires lots of formal verification, good hardware, and lots of checking. Generally, this kind of software should be written in places where human lives are considered important (such as nuclear power plants).

6

u/[deleted] Jul 30 '16

with no vulnerabilities and no bugs

Yo, every reasonably large code base has bugs. Heck, operating systems, language compilers, and interpreters themselves have bugs. How exactly do you write code with "no bugs"?

7

u/manuscelerdei Jul 30 '16

It's possible to do for very constrained problem spaces, and it takes * fuckload* of engineering and QA effort. State machines have to be formally modeled, implementations have to be completely documented, all code paths must be testable, and dependencies have to either be completely understood or not exist.

http://number-none.com/blow/john_carmack_on_inlined_code.html

Indeed, if memory serves (it's been a while since I read about this)... The fly-by-wire flight software for the Saab Gripen (a lightweight fighter) went a step further. It disallowed both subroutine calls and backward branches, except for the one at the bottom of the main loop. Control flow went forward only. Sometimes one piece of code had to leave a note for a later piece telling it what to do, but this worked out well for testing: all data was allocated statically, and monitoring those variables gave a clear picture of most everything the software was doing. The software did only the bare essentials, and of course, they were serious about thorough ground testing. No bug has ever been found in the "released for flight" versions of that code.

1

u/mfukar Jul 31 '16

It's possible, but not profitable. It's not a technical problem (mostly), it's an economic one.

7

u/[deleted] Jul 30 '16

How exactly do you write code with "no bugs"?

I got rid of all the bugs in my PHP code with one simple line

error_reporting(0);

I haven't seen one error since!

1

u/Murbarron Jul 30 '16

Haha, this seems to be the only possible solution!

0

u/[deleted] Jul 30 '16

That's not true, I've found many bug free solutions over the years. For example, if you're super high tech and are using Visual Basic 6, you can use

On Error Resume Next

At the top of your subroutine to avoid issues.

;)

6

u/[deleted] Jul 30 '16

What is this 'non-standard' code you're talking about?

2

u/Murbarron Jul 30 '16

Hello word probably.

0

u/[deleted] Jul 30 '16

[deleted]

1

u/Murbarron Jul 30 '16

I am sold. Who needs profits, amiright? Ask oracle in regards to bug free software and top notch quality.