‹ BackHN Continuity

Thread

Ten lines of code that changed my world

148 points · 46 comments · dimonomid

  1. irregularbowels · · focus · HN ↗
    I had an assembler class back in the mid-90s at college. I discovered the self-modifying code trick while doing an assignment. The program had the desired output, so I turned it in. The professor, who was head of the department at the time, called me into her office.

    Professor: "Your code modifies itself. You can't do that here."

    Me: "It runs and prints the output the assignment outlined in its instructions. There is nothing on the assignment that says I can't do what I did."

    Professor: "OK, but don't do it again."

    The next class she announced that any assignment could not modify its own code. Any submissions that did so would be disqualified.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.