Content-Type: text/shitpost


Subject: Sheesh
Path: you​!your-host​!ultron​!uunet​!asr33​!hardees​!triffid​!gormenghast​!extro​!goatrectum​!plovergw​!shitpost​!mjd
Date: 2018-09-25T16:25:50
Newsgroup: rec.food.cooking.sheesh
Message-ID: <6aa418ab017b437b@shitpost.plover.com>
Content-Type: text/shitpost

I just wrote a program that didn't do anything when I ran it.

It's because the main loop had:

 if len(base_word) < 6 or len(base_word) > 5:
     continue

That 5 should have been a 7.

Now it has me thinking about what programming language designs would enable the programming system to notice that error and issue a warning “Hey, you wrote a test, but it can never return false”.

Maybe instead of some sort of briliant static analysis, what we need instead is an eaasy dynamic analysis: “Hey, here's a list of tests in your program that always had the same result.”

Has someone outfitted Eclipse or some other IDE to annotate your program after each run with pastel shades showing which parts were actually exercised and which were never run? That seems like it could be useful.