News for hackers. Stuff that matters.
Re:Facts about State Machines by missblit on Friday September 30, 2022 @08:42PM (#33042577)
How to implement a state machine in Python:

    def next_state(state):
      if state == 90000:
        return 0
      return state + 1
But more seriously; once I was asked to implement offsetof in an interview for an entry level C++ position. I didn't quite remember that this was impossible during the heat of the interview, but I did remember enough to not produce an incorrect solution that relies on undefined behavior. I didn't get that job.

There are no comments on this comment yet.