Search code examples
algorithmpseudocode

What is your favorite phrase, saying, or quote expressed as code?


Do not explicitly state your saying, in comments or otherwise. Your Code should express itself!

For example:

for (Person person : people) {
    if (!HouseTypeEnum.GLASS_HOUSE.equals(person.getResidence().getHouseType())){
        throw new StonesException();
    }
}

Solution

  • This simple expression is about as compact as I know...

    2B || !2B
    

    Or as a regex

    /(bb|[^b]{2})/