I'm not a programmer by any means. I am involved with writing though, and often I have to draw on other people's work to support an assertion I'm making. I just use some quotation marks "" and cite the author and page number at the end of the sentence (author #).
I know it isn't a one to one example, but I wonder why it is acceptable to quote and cite with no need for permission in literature, but when it comes to code people "own" their ideas?