Shakespeare is clever, bawdy, and often amusing, and you have to be even more clever to understand it. A lot his wordplay is based on idioms no longer in active use.
Take, for example, Act 1, Scene 1 (http://www.shakespeare-literature.com/Romeo_and_Juliet/2.htm...)
SAMPSON
'Tis all one, I will show myself a tyrant: when I
have fought with the men, I will be cruel with the
maids, and cut off their heads.
GREGORY The heads of the maids?
SAMPSON Ay, the heads of the maids, or their maidenheads;
take it in what sense thou wilt.
'Maidenheads' as a colloquial term for a woman's virginity (or more crudely, her hymen).Or Act 1, Scene 3
NURSE
And since that time it is eleven years;
For then she could stand alone; nay, by the rood,
She could have run and waddled all about;
For even the day before, she broke her brow:
And then my husband--God be with his soul!
A' was a merry man--took up the child:
'Yea,' quoth he, 'dost thou fall upon thy face?
Thou wilt fall backward when thou hast more wit;
Wilt thou not, Jule?' and, by my holidame,
The pretty wretch left crying and said 'Ay.'
To see, now, how a jest shall come about!
I warrant, an I should live a thousand years,
I never should forget it: 'Wilt thou not, Jule?' quoth he;
And, pretty fool, it stinted and said 'Ay.'
The nurse is speaking of her husband and Juliet. As a small child, she 'waddled all about', fell on her face and 'broke her bow'. The husband asks, amused -- when you have more wit, will you not fall on your back? The young Juliet clearly innocently replies 'Ay', likely sending everyone tittering -- to fall on her back when she has more wit is an oblique reference to her having sex (on her back) when she's older (has more wit).It's crude, inappropriate, and -- at least to me -- pretty damn funny, in the story's context. It also has a hell of a lot to do with "words arranged in a particular order", and the nuances of the meanings of words. Memorizing it forces you to study the text more deeply than you likely have before.
I've never made use of Shakespeare as a programmer, but I still remember reading his works in school -- and the significant appreciation I had for the art and cleverness of it. I even memorized the entire Queen Mab Speech for extra credit (I'm glad I didn't refuse!). It did help that I went to a private school where the teacher was intelligent enough to explain the word-play to us, and didn't avoid the less appropriate aspects of it.