Both require precision. Both allow for beauty within constraints.

def haiku():
    return """
    ancient pond
    a frog jumps in
    the sound of water
    """

The compiler does not care for metaphor, but the reader might.