One of Whitman's most important stylistic devices in "When I Heard the Learn'd Astronomer" is his extremely careful choice of wording, or diction. When, in lines 2 and 3, the meaning of the poem stresses the ordered and categorical process of science and mathematics, Whitman's language is full of mathematical words such as "proofs," "figures," "charts," and "measure." Or, when he is attempting to suggest the actual and magnificent nature of the night sky, Whitman describes the speaker's wandering with the words, "rising and gliding," which suggest the behavior of the stars or astronomical bodies themselves. This language is not simply descriptive; it is meant to bring out the poet's thematic goals because of the resonance of the words in the reader's mind.
Many words and sounds are repeated in Whitman's poem, beginning with the first line, which is a repetition of the title. This line also contains the internal slant rhyme of "heard" and "learn'd," and line 4 again repeats the sound of "lecture" with "lectured" and "lecture-room." "When" is the first word of each line of the first quatrain, and there is another internal repetition, "time to time," in line 7. Finally, there are a number of instances of alliteration, or the repetition of initial sounds, such as "myself, / In the mystical moist," and "silence at the stars."
When I Heard the Learn'd Astronomer