News for hackers. Stuff that matters.
Re:Ask HN: What horrifying and/or terrible things have you s... by S4M on Saturday June 21, 2014 @09:23AM (#7924899)
In a video game company, something like (it was in Action Script, I don't remember the exact syntax of that language):

    public class ScoreManager {
         //some statements
         public void updateScore(Action action) {
              int n = action.entityDestroyed;
              if n < n1 {
                   playSound1();
                   score += 100*n;
              } else {
                   playSound2();
                   score += 200*n;
              }
          }
    }
I had to deal with that piece of code for something, and asked the developer to move the functions playing the sound out of the ScoreManager class so I could reuse it, and he categorically refused without giving me any explanation.

EDIT: typos

There are no comments on this comment yet.