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?
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.
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.
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!
Comments