• Question: have you ever made a code and by accident,it made a short or funny sentence?Did the sentence make sense or was it just random words shoved together?

    Asked by cookieowl on 18 Mar 2021.
    • Photo: Peter Megyesi

      Peter Megyesi answered on 18 Mar 2021:


      Oh, I see now what you meant before…

      I can think of two reasons why something like this might happen:
      1) very common – people find it hard to simplify complex things or they just don’t bother 🙂
      2) rare – people put it there on purpose, so that it makes someone else later smile/cry 😀 e.g. look

      Example of 1)
      // IMPORTANT! make sure to call this here!!
      parser.finaliseParsingOf(originalDocument.clone.cachedElement.getTheJunk());

      admittedly, not that funny unless you recognise it’s something you’ve done or had to work with.

      Examples of 2)
      https://www.goskills.com/Development/Resources/Best-easter-eggs
      and
      https://fuzzzyblog.blogspot.com/2014/09/40-most-funny-code-comments.html

    • Photo: Alan Diaz

      Alan Diaz answered on 19 Mar 2021:


      When you write code, often times you want to check that it is working correctly and without errors; we refer to this as testing and debugging. A common and handy way of doing so is to display text (or print) with statements that help you check the flow of your code. When I do this, I like to create conversations between the sections of my code, often using funny references to movies or simply nonsense context.

    • Photo: Erika Duriakova

      Erika Duriakova answered on 22 Mar 2021:


      I generally dont write code that makes sentences, but I certainly wrote a code that did not do what it meant to do and instead did something else. Interestingly sometimes such bugs in the code can spark new ideas and lead to new discovery!

    • Photo: Andrea Federico

      Andrea Federico answered on 28 Mar 2021:


      It happens to me a couple of time. But unfortunately, I didn’t get any sentence, but just an endless sequence of numbers and question marks XD

Comments