Welcome our actors, Patrick Kennedy, Tara Fitzgerald, Owen McDonald, and of course the wonderful Professor Mary Beard. For those who don't know me, I'm Siobhan Wilder and I am the director of the Josephine Hart Poetry Foundation. I have a few words I'd like to say that Josephine Hart wrote just before her wonderful Theatre Week at the Donmar, her poetry week. I have a note here from National Poetry Day 2022. Lucy McNabb is here with us somewhere. Oh, there you are Lucy. Just to draw your attention to the fact, I'm sure you all know, because you're obviously poetry lovers, tomorrow is National Poetry Day, the biggest one-day celebration of poetry across the UK when millions of people annually read, write, and share poems. This year's theme is the environment and there are some of Larkin's poems that touch on that and some of you I'm sure know already. And National Poetry Day is inviting people to share their favourite poems about the environment online with friends and family. And to join in, go to nationalpoetryday.org, which is full of poems and activities. And now I'm going to share a few words with you that Josephine Hart wrote for that opening night of her Poetry Week at the Donmar Theatre. She wrote that the basic purpose of the Josephine Hart Poetry Hour was to make a public performance of the great poetry of the dead poets read by great actors the norm in London. I think she succeeded. There are many others who followed in her footsteps. The philosophy behind Josephine Hart's Poetry Hours can be simply expressed in three parts. First, the life of the poet. Josephine agreed with T.S. Eliot that we understand the work better if we understand something of the poet's life. As Eliot said, the poet always writes out of his personal life, in his finest work out of its tragedy. Whatever it may be, remorse, lost love, or loneliness. Therefore, Josephine's introductions to the poets are always an important part of these evenings. And this evening, Professor Mary Beard is going to read Josephine's introductions. All of the introductions to the great poets were published by Virago in a volume called Life Saving, Why We Need Poetry. And the book was sent free of charge to all secondary schools in England, as were her two previous books about poetry. Words that burn and catching life by the throat. Second, on the poets read aloud, according to Josephine Hart, poetry startles us into a more full sense of life. It is a trinity of sound, sense, and sensibility. And the sense of sound, and what Robert Frost called the sound of sense, will be lost unless we hear it. Language caught alive. The gold in the oar is the sound. Seamus Heaney, as an undergraduate at Queen's, found that on hearing Eliot's four quartets read by the actor Robert Spate, what had been perplexing when sight read, for meaning only, was hypnotic when read aloud. Yates in his 70s said he'd spent his life clearing out of poetry every phrase written for the eye alone and bringing all back to syntax, that is for the ear alone. Ordon put it more bluntly. No poem, which is not better heard than read, is good poetry. And third, poetry read by great actors. Again, Josephine Hart agrees with T.S. Eliot that poetry should be read to us by skilled readers, the feeling for syllable and rhythm penetrating far below the conscious level of thought and feeling, invigorating every word. In 2016, a memorial floor stone, funded by the Josephine Hart Poetry Foundation, with the lines, our almost instinct, almost true, what will survive of us's love, from an arundal tomb, was installed at Poets Corner in Westminster Abbey London. I'm now going to hand you over to these wonderful voices to hear some wonderful poetry. Thank you. In 1984, I approached Philip Larkin to request permission to present an evening of his poetry read by Alan Bates. Though warned by his old friend Kingsley Amis, oh dear, no Josephine, Philip won't like this at all, Mr. Larkin said yes. I sent roses. Philip Larkin's letter of thanks described the arrival of the bouquet at reception in Hull Library, its procession from one department to another, the tentative smiles of hope which faded as impervious to silent entreaties let it be me, the arrangement was eventually handed to him. That letter could easily have been a poem, illustrating as it does the motif in Larkin's poetry which is uniquely his, the significance of small events, the pressure they exert on an individual psychology thrown into relief against the great themes of life. And though, as someone said, he made the familiar strange, he also, as John Bailey noted, was the only sophisticated modern writer who needs no sophisticated response from the reader. Of the novelist Barbara Pym, whom he greatly admired, he wrote, I like to read about people who have done nothing spectacular, aren't beautiful or lucky, who try to behave well in a limited field of activity, and who can see little, who can see in the little or tumble moments of vision that the so-called big experiences of life are going to miss them. I like to read about such things presented not with self-pity or despair or romanticism, but with the realistic firmness and even humour. That is, in fact, what I call the moral tone of Miss Pym's novels. It is also the moral tone of Larkin's poems. He once said that art should either help us to enjoy or to endure, yet he himself found it difficult to do either. Why? Philip Larkin was born in Coventry in 1922. To Sidney Larkin, eventually Sidney Larkin OBE, an administrative paragon with a passion for literature, and to Eva Day, an intelligent, bookish, nervous woman. They adored him. Crucially, it was a literary household. Sidney introduced his son to Eliot, Ordon and Joyce. Sidney had a passion for exactness in language, and he poured over dictionaries and grammars. He once told his son that Kingsley Amos' inability to grasp the difference between will and shall, would and could, precluded him for any possible future as a writer. Philip Larkin, a brilliant student, sailed into Oxford and sailed out again with a first-class honours degree in English.  I feel like a millionaire. A natural pessimist, he told everyone, he was going to get a third. He also left a published poet. Four poems in the listener, ten in poetry from Oxford in war time. Larkin failed his medical because of poor eyesight. His first collection, The North Ship, was followed by his two novels, Jill and a Girl in Winter. He was, very quickly, very much on his way. Borges like, he became a professional librarian, eventually appointed to the University of Hull in 1955, which famously, he never left. He combined the role of scholar, curator, and administrator in an exemplary career. His who's who entry states his occupation as librarian. A man is what he makes his living from. His early life was unmarked by trauma. He enjoyed great academic and literary success and a career to which he was dedicated. In fact, Larkin's life remained unmarked by personal tragedy, yet right from the beginning, a sad, if not a tragic note is struck. Perhaps the answer lies in his childhood, which was dominated, he said, by an atmosphere of clenched irritation, which curdled the whole experience. What was the rock my gliding childhood struck? A heartbreaking line. Powerful terrors pursued him. The terror of being trapped by marriage and children, a phobic fear of death, a phrase used in its clinical meaning by one of his doctors. They are key elements in the creative landscape from which he drew his poetry and by which he shaped his life. They served another carefully considered purpose in the brutal choice for the artist. Between perfection of the life or of the work, Yates's haunting phrase, Larkin came down firmly, knowingly, on the side of art. If Molly Blooms is the most emphatic, yes, in literature, Philip Larkin's is the most emphatic, no. Was he too clever to live? A comment, amongst others, kindly face, but no kidding him. Perverse psychology, Irish, perhaps. Written in a copper plate hand by the late A. L. Rouse in a copy of Larkin's collected essays, required writing, which I was lucky enough to buy from Rouse's library. Heaney is more gentle on the subject of Larkin's cool intellect, noting, we listen in his poems to his unfoolable mind, singing the melody of intelligence, as we will in toads, poetry of departures, vests to societe. All tell dreams of leaving of escape. And in Mr. Bleaney, the price of the unlived life. We start with a tribute to the whitest man I know, a Raj phrase. Who is he? According to George Hartley, he is Larkin, mocking the self, untarnished by life. Listen out for the marvellous last line in Symphony in White Major. Sympathy in White Major, 1974. When I drop four cubes of ice, chimingly in a glass, and add three goes of gin, a lemon slice, and let a 10 ounce tonic void in foaming gulps until it smothers everything else up to the edge, I lift the lot in private pledge. He devoted his life to others. While other people wore like clothes the human beings in their days, I set myself to bring to those who thought I could the lost displays. It didn't work for them or me, but all concerned were nearer thus or so we thought to all the fuss than if we'd missed it separately. A decent chap, a real good sort, straight as a die, one of the best, a brick, a trump, a proper sport, head and shoulders above the rest. How many lives would have been duller had he not been here below? Here's to the whitest man I know. Though white is not my favorite color. Mr. Blini, 1955. This was Mr. Blini's room. He stayed the whole time he was at the bodies till they moved him. Flowered curtains, thin and frayed, fall to within five inches of the sill, whose window shows a strip of building land. Tuskegee, littered. Mr. Blini took my bit of garden properly in hand. Bed, upright chair, 60-watt bulb, no hook behind the door, no room for books or bags. I'll take it. So it happens that I lie where Mr. Blini lay and stub my fags on the same saucer souvenir and try stuffing my ears with cotton wool to drown the jabbering set he egged her on to buy. I know his habits, what time he came down, his preference for sauce to gravy, why he kept on plugging at the four aways, likewise their yearly frame, the frinter folk who put him up for summer holidays, and Christmas at his sister's house in Stoke. But if he stood and watched the frigid wind, towsling the clouds, lay on the fusty bed, telling himself that this was home and grinned and shivered, without shaking off the dread, that how we live measures our own nature. And at his age, having no more to show than one hired box, should make him pretty sure he warranted no better. I don't know. Toads, 1954. Why should I let the toad work, squat on my life? Can't I use my wit as a pitchfork and drive the brute off? Six days of the week it soils with its sickening poison, just for paying a few bills. That's out of proportion.  Lecturers, lispers, lozals, lob-lolly men, louts, they don't end as paupers. Lots of folk live up lanes, with fires in a bucket, eat windfalls and tinned sardines. They seem to like it. Their nippers have got bare feet, their unspeakable wives are skinny as whippets, and yet no one actually starves. Ah, where I courageous enough to shout, stuff your pension. But I know all too well that's the stuff that dreams are made on. For something sufficiently toad-like, squats in me too. Its hunkers are heavy as hard luck and cold as snow, and will never allow me to blarney my way of getting the fame and the girl and the money all at one sitting. I don't say one bodies the other one's spiritual truth, but I do say it's hard to lose either when you have both. Toads revisited 1962. Walking around in the park should feel better than work. The lake, the sunshine, the grass to lie on, blurred playground noises beyond black stockinged nurses. Not a bad place to be, yet it doesn't suit me.  Think of being them, hearing the hours chime, watching the bread delivered, the sun by clouds covered, the children going home, think of being them, turning over their failures by some bed of libelias. Nowhere to go but indoors, nor friends but empty chairs. No. Give me my intray, my loaf-haired secretary. My shall I keep the call in, sir. What else can I answer, when the lights come on at four at the end of another year? Give me your arm, old toad, help me down Cemetery Road. Poetry of Departures, 1954. Sometimes you hear fifth hand as epitaph.  And always the voice will sound certain you approve this audacious, purifying, elemental move. And they are right, I think. We all hate home and having to be here. I detest my room, it's specially chosen junk, the good books, the good bed, and my life in perfect order.  Surely I can, if he did. And that helps me to stay sober and industrious. But I'd go today. Yes, swagger the nuts, strewn roads, crouch in the forecastle, stubbly with goodness, if it weren't so artificial, such a deliberate step backwards to create an object, books, China, a life, reprehensibly perfect. Ver de société, 1974, pardon my French. My wife and I have asked a crowd of craps to come and waste their time and hours. Perhaps you'd care to join us in a pig's arse, friend. Day comes to an end. The gas fire breeds, the trees are darkly swayed. And so, dear Warlock Williams, I'm afraid. Funny how hard it is to be alone.  Just think of all the spare time that has flown straight into nothingness by being filled with forks and faces, rather than repaid under a lamp, hearing the noise of wind, and looking out to see the moon thinned into an air-sharpened blade. A life. And yet, how sternly it's instilled, all solitude is selfish. No one now believes the hermit with his gown and dish talking to God. He's gone too. The big wish is to have people nice to you, which means doing it back somehow. Virtue is social. Are, then, these routines playing at goodness, like going to church? Something that bores us, something we don't do well.  But we try to feel because, however crudely, it shows us what should be. Too subtle that. Too decent, too. Oh hell, only the young can be alone freely. The time is shorter now for company, and sitting by a lamp more often brings not peace but other things. Beyond the light stand failure and remorse, whispering. Dear Warlock Williams, why, of course. Larkin's poetic masterstroke lies in a certain juxtaposition of two normally opposing philosophies, romantic and classical. In this juxtaposition, Christopher Ricks notes in a brilliant insight, a romantic swell of feeling meets the bracing counterthrust of classical impersonality. With Larkin, it usually happens in the last lines of which John Donne wrote centuries ago, the whole frame of a poem is a beating out of a piece of gold, but the last clause is as the impression of the stamp, and that is what makes it current. Alan Bennett, less elegantly but more wittily notes, you'll have to think about this in an Alan Bennett voice. Philip Larkin takes you firmly by the hand and doesn't let go of you until you're across the finishing line. You're almost always traveling in England. Most particularly in his collection, The Whits and Weddings, he turned his voice into one of the means by which his country recognizes itself, and remotions, telling phrase. He ne agrees. Larkin's poems like Joyce's Dubliners would happily fit under the title Englanders. If Larkin were to compose his own version of the divine comedy, he would not find himself in the middle of a dark wood, but in a railway tunnel halfway through England. In Going Going, written in 1974, he warns with great prescience of the destruction of the countryside. Churchgoing, reverence without religion, the church, a serious house in which it's proper to grow wise in if only that so many dead lie around. And the brilliant, I remember, I remember, Proust subverted, the station sign, Coventry, the Madeleine, which triggers memories of where my childhood was unspent. The truth of most ordinary childhoods tumbling down to one of the great last lines in poetry. Nothing like something happens anywhere. To Sonny Prestatin and the girl on the poster who was just too good for this world. Sonny Prestatin, 1962. Come to Sonny Prestatin, laughed the girl on the poster, kneeling up in the sand in torntened white satin. Behind her, a hunk of coast, a hotel with palms seemed to expand from her thighs and spread breastlifting arms. She was slapped up one day in March. A couple of weeks and her face was snaggletoothed and boss-eyed.  While someone had used a knife or something to stab right through the mustached lips of her smile. She was too good for this life. Very soon, a great transverse tear left only a hand and some blue. Now fight cancer is there. Going, going. 1972. I thought it would last my time. The sense that, beyond the town, there would always be fields and farms, where the village louts could climb such trees as were not cut down. I knew there'd be false alarms in the papers about old streets and split-level shopping, but some have always been left so far. And when the old part retreats as the bleak highrises come, we can always escape in the car. Things are tougher than we are. Just as Earth will always respond, however we mess it about, chuck filth in the sea if you must, the tides will be cleaned beyond. But what do I feel now? Doubt? Or age simply? The crowd is young in the M1 cafe. Their kids are screaming for more, more houses, more parking allowed, more caravan sites, more pay. On the business page, a score of spectacled grins approve some takeover bid that entails 5% profit and 10% in the estuaries. Move your works to the unspoilt dales, grey area grants. And when you try to get near the sea, in summer, it seems just now to be happening so very fast. Despite all the land left free, for the first time, I feel somehow that it isn't going to last. That before I snuff it, the whole boiling will be bricked in, except for the tourist parts. First slum of Europe, a roll it won't be hard to win, with a cast of crooks and tarts. And that will be England gone, the shadows, the meadows, the lanes, the guild halls, the carved choirs. They'll be books, it will linger on in galleries, but all that remains for us will be concrete and tires. Most things are never meant.  I just think it will happen soon. Church going, 1954. Once I'm sure there's nothing going on, I step inside, letting the door thud shut. Another church, matting seats and stone and little books, sprawlings of flowers cut for Sunday, brownish now. Some brass and stuff up at the holy end. The small neat organ, an intense, musty, unignorable silence, brewed God knows how long. Atlas, I take off my cycle clips in awkward reverence. Move forward, run my hand around the font. From where I stand, the roof looks almost new, cleaned or restored. Someone would know, I don't. Mounting the lectern, I peruse a few hectoring large-scale verses and pronounce, here endeth, much more loudly than I'd meant, the echoes snigger briefly. Back at the door, I sign the book, donate an Irish sixpence, reflect the place was not worth stopping for. Yet, stop I did. In fact, I often do, and always end much at a loss like this, wondering what to look for, wondering too when churches will fall completely out of use, what we shall turn them into, if we shall keep a few cathedrals chronically on show, their parchment, plate and picks in locked cases, and let the rest rent free to rain and sheep.  Power of some sort will go on in games, in riddles, seemingly at random, but superstition, like belief, must die, and what remains when disbelief has gone? Grass, weedy pavement, brambles, buttress, sky, a shape less recognizable each week, a purpose more obscure. I wonder who will be the last, the very last, to seek this place for what it was, one of the crew that tap and jot and know what rude lofts were, some ruin-biber, randy for antique, or Christmas addict counting on a whiff of gown and bands and organ pipes and myrrh. Or will he be my representative, bored, uninformed, knowing the ghostly silt dispersed, yet tending to this cross of ground through suburb scrub, because it held unspilt so long and equably what since is found only in separation, marriage and birth and death and thoughts of these, for which was built this special shell. For though I have no idea what this accoutred, frousty barn is worth, it pleases me to stand in silence here, a serious house on serious earth it is, in whose blunt air all of our compulsions meet, are recognized and robed as destinies, and that much never can be obsolete, since someone will forever be surprising a hunger in himself to be more serious, and gravitating with it to this ground, which he once heard was proper to grow wise in, if only that so many dead lie round. I remember, I remember, 1954, coming up England by a different line for once, early in the cold new year we stopped, and watching men with number plates sprint down the platform to familiar gates. By coventry, I exclaimed, I was born here. I lent far out and squinted for a sign that this was still the town that had been mine so long, but found I wasn't even clear which side was which, from where those cycle crates were standing, had we annually departed for those family halls, a whistle went, things moved, I sat back staring at my boots, was that my friend smiled, where you have your roots? No, only where my childhood was unspent, I wanted to retort, just where I started, by now I've got the whole place clearly charted, our garden first, where I did not invent blinding theologies of flowers and fruits, and wasn't spoken to by an old hat, and here we have that splendid family I never ran to when I got depressed, the boys all biceps, and the girls all chest, their comic forward, their farm where I could be really myself, I'll show you, come to that, the bracken where I never trembling sat, determined to go through with it, where she lay back and all became a burning mist, and in those offices, my doggerel was not set up in blunt ten point, nor read by a distinguished cousin of the mayor, who didn't call and tell my father, there before us had we the gift to see ahead, where you look as though you wish the place in hell, my friend said, judging from your face, oh well, I suppose it's not the place's fault, I said, nothing like something happens anywhere. A man who is capable of experience finds himself in a different world in every decade of his life, as he sees it with different eyes, the material of his art is constantly renewed, that's Elliot in praise of late Yates. In High Windows published in 1974, when he was 52, there is little evidence that Larkin saw life differently. The material of his art, time, choice, evanescence, and the voice remained consistent, that's the reason why the structure of this evening is more thematic than chronological, to Larkin and the women. His attitude to sex was never exactly politically correct. He once told Kingsley Amos after an unsatisfactory date at Oxford, all I got was a wet kiss, it's just not worth it, the food alone came to three pounds and nine shillings. Neither lust nor love, however, was going to lead to marriage or children. He's escaped one home, he wasn't going to create another, to escape from home is a life's work, like writing decline and fall of the Roman Empire. One of the greater piveness of my life was when I realised it wasn't people I disliked, just children. He was in fact a much loved man, Monica Jones and Maeve Brennan loved him for decades and there were many other relationships. In fact, he inspired in women levels of self-sacrifice as would have done Lord Byron proud. Amongst the last poems that you're going to hear is the shocking deceptions. I was the more deceived, a line again subverted, then three poems which strike a different note on love and sex, wild oats, early sexual lessons, high windows, everyone going down the long slide to happiness and as Mirabilis celebrated sexual joy which according to Larkin began in 1963.  The wits and weddings of Fellini-like vision of on station platforms of grinning and pomaded girls in parodies of fashion heels and veils, mothers loud and fat and my own favourite Larkin poem, Dockery and Son, a Dickensian title. He once said he found a way to make poems as readable as novels. He was right, the wifeless, childless, middle-aged narrator recalls a boy Dockery who seized his moment sexually and begot a son who now attends their old college. Then Larkin throws down the gauntlet. Why did he think adding meant increase and where do these insane assumptions come from? Larkin's later years, and he did not have enough of them, were garlanded in honours. The Queen's Gold Medal for Poetry, Fellowships, Membership of the Royal Society of Literature, companion in honour of honour, though not in poems. Larkin was offered and turned down the poet laureate ship, saying poetry, that rare bird has flown out the window and now sings on some alien shore. Larkin himself died as he had predicted in 1985 at the age of 63. It had long been an obsession of his that he would die at the same age as his father. After all his fear, he seemed the nurse said to be resigned. I go to the inevitable. His headstone reads simply Philip Larkin, writer. To our last poems of love and death, Obad, the darkest poem he would ever write, and we will finish with the softer Arundel tomb and the line which perhaps inexplicably connects us to him. What will survive of us is love, but first to talking in bed. Talking in bed, 1960. Talking in bed ought to be easiest. Lying together there goes back so far, an emblem of two people being honest. Yet more and more time passes silently. Outside, the wind's incomplete unrest builds and disperses clouds about the sky and dark towns heap up on the horizon. None of this cares for us. Nothing shows why, at this unique distance from isolation, it becomes still more difficult to find words at once true and kind, or not untrue and not unkind. Deceptions, 1950. Of course I was drugged, and so heavily I did not regain consciousness until the next morning. I was horrified to discover that I had been ruined, and for some days I was inconsolable, and cried like a child to be killed, or sent back to my aunt. Mayhew, London labour and the London poor, even so distant, I can taste the grief, bitter and sharp with stalks he made you gulp. The sun's occasional print, the brisk brief worry of wheels along the street outside, where bridal London bows the other way, and light, unanswerable and tall and wide forbids the scar to heal, and drives shame out of hiding. All the unhurried day, your mind lay open like a draw of knives. Slums, years have buried you. I would not dare console you if I could. What can be said, except that suffering is exact, but where desire takes charge, readings will grow erratic, for you would hardly care that you were less deceived out on that bed than he was stumbling up the breathless stare to burst into fulfilment's desolate attic. Wild Oats, 1962. About 20 years ago, two girls came in where I worked. A bosomy English rose, and her friend in specs I could talk to. Faces in those days sparked off the whole shooting match, and I doubt if ever one had like hers. But it was the friend I took out. And in seven years after that, wrote over 400 letters, gave a ten-ginny ring I got back at the end, and met at numerous cathedral cities unknown to the clergy. I believe I met beautiful twice. She was trying both times, so I thought not to laugh. Parting after about five rehearsals was an agreement that I was too selfish, withdrawn, and easily bored to love. Well, useful to get that learnt. In my wallet are still two snaps of bosomy rose with fur gloves on. Unlucky charms, perhaps. High windows, 1974.  Everyone old has dreamed of all their lives. Bonds and gestures pushed to one side like an outdated combine harvester, and everyone young, going down the long slide to happiness endlessly. I wonder if anyone looked at me 40 years back and thought, that'll be the life, no god anymore, or sweating in the dark about hell and that, or having to hide what you think of the priest.  And immediately, rather than words, comes the thought of high windows, the sun comprehending glass, and beyond it, the deep blue air that shows nothing, and is nowhere, and is endless. Anas Maribelis, 1971. Sexual intercourse began in 1963, which was rather late for me, between the end of the Chattelé ban and the Beatles' first LP. Up till then, there'd only been a sort of bargaining, a wrangle for a ring, a shame that started at 16 and spread to everything. Then all at once, the quarrel sank. Everyone felt the same, and every life became a brilliant breaking of the bank, a quite unloosable game. So life was never better than in 1963, though just too late for me, between the end of the Chattelé ban and the Beatles' first LP. This be the verse, 1971.  They may not mean to, but they do. They fill you with the faults they had, and add some extra, just for you.  Man hands on misery to man. It deepens like a coastal shelf. Get out as early as you can, and don't have any kids yourself. The Whitsun Weddings, 1964. That Whitsun, I was late getting away, not till about 120 on the sunlit Saturday did my three-quarters empty train pull out, all windows down, all cushions hot, all sense of being in a hurry gone. We ran behind the backs of houses, crossed a street of blinding windscreens, smelt the fish dock. Thence the river's level-drift breath began, where sky and Lincolnshire and water meet. All afternoon, through the tall heat that slept for miles inland, a slow and stopping curve southwards we kept, wide farms went by, short shadowed cattle, and canals with floatings of industrial froth. A hot house flashed uniquely, hedges dipped and rose, and now and then a smell of grass displaced the reek of buttoned carriage cloth until the next town, new and nondescript, approached with acres of dismantled cars. At first, I didn't notice what a noise the weddings made, each station that we stopped at. Sun destroys the interest of what's happening in the shade, and down the long-cool platform, whoops and scurls, I took for porters larking with the males and went on reading. Once we started though, we passed them, grinning and pomaded, girls in parodies of fashion, heels and veils, all posed irresolutely, watching us go, as if out at the end of an event waving goodbye to something that survived it. Struck, I lent more promptly out the next time, more curiously, and saw it all again in different terms, the fathers with their broad belts under their suits and seamy foreheads, mothers loud and fat, an uncle shouting smut, and then the perms, the nylon gloves and jewelry substitutes, the lemons, moaves and olive oakers that marked off the girls unreally from the rest, yes, from cafes and banquet halls up yards and bunting dressed coach party annexes, the wedding days were coming to an end. All down the line, fresh couples climbed aboard, the rest stood around, the last confetti and advice was thrown, and as we moved, each face seemed to define just what it saw departing. Children frowned at something dull, fathers had never known success so huge and wholly farcical, the women shared the secret like a happy funeral, while girls gripping their handbags tighter stared at a religious wounding. Free at last and loaded with the sum of all they saw, we hurried towards London, shuffling gouts of steam. Now fields were building plots, and poplars cast long shadows over major roads, and for some 50 minutes that in time would seem just long enough to settle hats and say, I nearly died. A dozen marriages got underway. They watched the landscape, sitting side by side. An odion went past, a cooling tower, and someone running up to bow. And none thought of the others they would never meet, or how their lives would all contain this hour. I thought of London spread out in the sun, its postal districts packed like squares of wheat. There we were aimed, and as we raced along bright knots of rail, past standing pullmen's walls of blackened moss came close, and it was nearly done, this frail traveling coincidence. And what it held stood ready to be loosed with all the power that being changed can give. We slowed again, and as the tightened brakes took hold, there swelled a sense of falling. Like an arrow shower sent out of sight, somewhere becoming rain. Dockery and Sun. 1964. Dockery was junior to you, wasn't he? said the Dean. His son's here now. Death-suited, visitant, I nod. And do you keep in touch with, or remember how black-gowned, unbreakfasted, and still half-tight, we used to stand before that desk to give our version of these incidents last night. I try the door of where I used to live, locked. The lawn spreads dazzlingly wide. Unknown bell chimes, I catch my train ignored. Canal and clouds and colleges subside slowly from view. But Dockery, good Lord, anyone up today must have been born in 43 when I was 21. If he was younger, did he get this son at 19, 20? Was he that withdrawn, high-collared, public schoolboy sharing rooms with Cartwright, who was killed? Well, it just shows how much, how little. Yawning, I suppose, I fell asleep, waking at the fumes and furnace glares of Sheffield, where I changed, and ate an awful pie, and walked along the platform to its end to see the ranged joining and parting lines reflect a strong unhindered moon. To have no son, no wife, no house or land still seemed quite natural. Only a numbness registered the shock of finding out how much had gone of life, how widely from the others. Dockery now, only 19. He must have taken stock of what he wanted and been capable of, no, that's not the difference. Rather, how convinced he was, he should be added to. Why did he think adding meant increase? To me, it was dilution. Where do these innate assumptions come from? Not from what we think truest or most want to do, those warped tight shut like doors. They're more a style our lives bring with them, habit for a while, suddenly they hardened into all we've got and how we got it.  Life is first boredom, then fear, whether or not we use it, it goes, and leaves what something hidden from us chose, and age, and then only the end of age. Next, please, 1951. Always too eager for the future, we pick up bad habits of expectancy. Something is always approaching, every day, till then, we say, watching from a bluff the tiny, clear, sparkling armada of promises draw near, how slow they are, and how much time they waste, refusing to make haste. Yet still they leave us holding wretched stalks of disappointment, for though nothing bulks each big approach, leaning with brasswork prinked, each rope distinct, flagged, and the figurehead with golden tits arching our way, it never anchors. It's no sooner present than it turns to past. Right to the last, we think each one will heave to and unload all good into our lives, all we are owed for waiting so devoutly and so long. But we are wrong. Only one ship is seeking us, a black-sailed unfamiliar, towing at her back a huge and birdless silence. In her wake, no waters breed or break. Oh, bad. 1977. I work all day and get half drunk at night, waking at four to soundless dark. I stare. In time, the curtain edges will grow light. Till then, I see what's really always there, unresting death, a whole day nearer now, making all thought impossible, but how, and where, and when, I shall myself die. Arid interrogation. Yet the dread of dying and being dead flashes afresh to hold and horrify. The mind blanks, blanks at the glare. Not in remorse, the good not done, the love not given, time torn off unused, nor wretchedly, because an only life can take so long to climb clear of its wrong beginnings and may never, but at the total emptiness forever. The sure extinction that we travel to and shall be lost in always. Not to be here, not to be anywhere and soon. Nothing more terrible, nothing more true. This is a special way of being afraid, no trick dispels. Religion used to try that vast, moth-eaten musical brocade created to pretend we never die. And specious stuff that says, no rational being can fear a thing it will not feel, not seeing that this is what we fear, no sight, no sound, no touch or taste or smell, nothing to think with, nothing to love or link with the anesthetic from which not come around. And so it stays just on the edge of vision, a small, unfocused blur, a standing chill that slows each impulse down to indecision. Most things may never happen. This one will. And realization of it rages out in furnace fear when we are caught without people or drink. Courage is no good. It means not scaring others. Being brave lets no one off the grave. Death is no different wind at than withstood. Slowly light strengthens and the room takes shape. It stands plain as a wardrobe. What we know have always known, know that we can't escape yet, can't accept. One side will have to go. Meanwhile, telephones crouched, getting ready to ring in locked-up offices, and all the uncaring, intricate, rented world begins to rouse. The sky is white as clay with no sun. Work has to be done. Postmen, like doctors, go from house to house. An Arundel tomb, 1956. Side by side, their faces blurred. The earl and countess lie in stone. Their proper habits vaguely shown as jointed armor stiffened pleat. And that faint hint of the absurd, the little dogs under their feet. Such plainness of the pre-baroque hardly involves the eye until it meets his left-hand gauntlet, still clasped empty in the other, and one sees with a sharp, tender shock, his hand withdrawn, holding her hand. They would not think to lie so long. Such faithfulness in effigy was just a detail friends would see, a sculptor's sweet commissioned grace thrown off in helping to prolong the Latin names around the base. They would not guess how early in their supine stationary voyage, the air would change to soundless damage, turn the old tenetry away, how soon succeeding eyes begin to look, not read. Rigidly they persisted, linked through lengths and breaths of time. Snow fell, undated. Light each summer thronged the grass. A bright litter of bird calls strewed the same bone-littered ground. And up the paths the endless altered people came, washing at their identity. Now, helpless in the hollow of an unarmorial age, a trough of smoke in slow, suspended skeins above their scrap of history, only an attitude remains. Time has transfigured them into untruth. The stone fidelity they hardly meant has come to be their final blazin' and to prove our almost instinct, almost true, what will survive of us is love.


The first thing I'm going to say is this is by far the largest room I've ever presented in so I'm right now scared out of my wets. So please like make huge jazz hands if I get way too animated and start talking way way too fast because I did that at Drupal Khan Bogota and I still have not forgiven myself for that so just let me know to slow down. All right so why don't we get started um just in case you didn't know which room we are in this is for capture the Drupal 8 flag. First thing you might be wondering is who is this weird person in front of you with the weird red hair and uh yeah you might be wondering yeah I actually do say that especially at 3am when the flag tests do actually pass. My name is Tess Flynn otherwise known as socket wench that's not wrench. I'm the module co-maintainer for flag for flag friend and for examples and I am a Drupal developer with FFW. There's a lot of different names for what FFW is supposed to stand for the one I'm most fond of is fruit flavored wombats. Who wants a t-shirt? T-shirt? I got one more anyone want another one? I think you raise your hand first. I've also got some flag stickers up here just a limited amount because I gave so many away already and I've got two sunglasses pairs of sunglasses so I'll be giving those out too. It's in case you didn't know we are hiring and you can either talk to me or you can talk to the people at the booth if the booth is still there because it's the last session of the con. So you might be wondering why the heck did I port flag module to Drupal 8? Well let's set the way back machine all the way to 2013 and I was in a room very much like this room at Drupal con Portland and I was listening to Angela Webchick Byron talk about the pants module and she was up there begging people please we need someone to port modules now because all we've done so far is core. We don't know if any of this will actually work in a module yet and I thought well yeah that's not a bad idea I can completely understand where you're coming from but yeah that's someone else's job and the thing is because my natural first question was why shouldn't I just contribute to Drupal 8 directly? I mean that sounds like the best thing to do right? Why waste my time on a module when I should be working on Drupal 8? Well there's a few problems I was facing. The first problem I would like to call is the reverse Sisyphus problem. Now if you remember the myth Sisyphus is a man that was doomed by the gods to push a boulder up a hill every day of his life and by the time he nearly got to the top of the hill and was almost finished it would start rolling all the way back down and he'd have to start all over again. Now the problem is the reverse Sisyphus problem is that the boulder is already running down the hill and I have to go and chase after it and hope that maybe maybe I can catch up to it. It imparts some small sense of momentum in it before it gets away from me again.  I had to learn about symphony. I had to learn how PHP object oriented programming works.   Now when you're a beginner you're up on beginner's hill and there's lots of stuff that you can do there's issue summaries running tests you could reroll patches but everybody really wants to be in dev city to work on to actually write those patches work on real issues really push core forward. The problem is between beginner's hill and dev city there's a big valley and in that valley of earth there might be some stuff you might work on. You've already you're already bored with all of the easy stuff you can do and it doesn't feel like you should be the one doing it because you're experienced at it you can turn it over in a few minutes a novice should be doing this now not you you want to do on something more impressive more interesting but there's not much between dev city and beginner's hill and I was really starting to bug me I was starting to get really depressed and I was sitting there one morning like any morning a good idea came to me while in the shower and it occurred to me you know given all this why don't you just do something else why don't you just completely change your strategy there's got to be a different way and I thought well I'm already a flag module maintainer why don't I just port flag module so who in this room knows what flag module is show of hands okay let me ask the opposite question who doesn't know what flag module is okay this section is for you guys and you know at one of you one of you should get a t-shirt or two shirts you and if someone could hand that way back to the gentleman way all the way back here there we go this is I'm amazed that my wrist is still holding up because I entered it in the cycling accident about three weeks ago so the flag module you'll hear this is picture of a rendered node on droop lake looks like any other node but there's these two little weird links at the bottom those are flag links now what does this allow us to do well let's abstract this a bit here we have a node happy little node and we have a user that comes along and goes oh shiny and they go and stick a flag in it the module that makes the point sound has yet to be developed you have a patch though I'll take it other users come along and add their own flags now from this we can actually come up with a definition of what flag module actually does it enables administrators to define boolean fields that may be attached to site content which each user each user may set or on set it's different than a checkbox because a checkbox only gets set once and usually only the node creator or editor can do that this is for every user it works kind of like this there are three principal objects involved there's the flag there is the thing that gets created to identify what the flag if it was flagged or not called the flagging and then there's the thing that we're flagging which my english teacher has never forgiven me for the flagable and it works kind of like this you can define the flag administratively and it lives as long as it's been defined flagging's can be a term be defined for the flagable entity and once a flagable entity a flagable has been a flagging has been created for the flagable entity it shows as flagged until they either unflag it or the flagging gets the flag it gets deleted I'm waiting for one person to finish their picture there we go so flags are the administrator defined boolean field it's stored as an entity since Drupal 7 since the module version 7x2x it may be attached to only one entity type but multiple bundles of the same type so you can define a node flag and it can be defined to one or more bundles one or more content types or you define a user flag or you define a comment flag in Drupal 7 Drupal 8 it's different or you don't have or you don't have to define oh geez there's a whole bunch of other kind of entity types that you could flag they're all created under administration flags and may be fielded as of Drupal 7 version 3x now flaggings are the entity created in response to when a user sets a flag it basically has four pieces of information in it which flag was set on what entity the flag was set when was the flag set and who set the flag flaggables are the entity that has a flag defined for it and for which flaggings may be created okay we know what flag module does now so let's sit down and we're ready to go we were said okay we're all fired up we're going to port this module to Drupal 8 it's going to be awesome there's going to be objects and there's going to be plugins there's going to be all this cool stuff and I'm ready to code in that's the last thing you should do first thing you should do is a code review ask yourself how does your module really really work one of the core pieces of flag module that I found is we have something called handler classes in the Drupal 7 version and they do a whole bunch of different stuff but usually they relate the flag to the type of entity that it actually applies to mostly the module is a pretty standard Drupal 7 module there's a large surface area of straight functions entity for support was refactored in object-oriented programming was actually used but well you know it's a bit like the blob php4 classes are just kind of weird today in flag there was a whole bunch of weird factory methods to make objects because there were no constructors in php4 and all of the object-oriented design in flag 7 came from php4 not 5 so we have all these weird factory methods all the methods were public too we had no access control on the individual methods all variables were public and basically what we got is a big blob of functions for every flag handler class it was a mess so now that we've reviewed our code we need to pick where we need to start the first thing after that how once you've done your code review you really want to sit down and look at it with new eyes figure out what you really want to do create a new vision for your module you want to question all the things ask yourself does the module really have to work this way we had to allow for assumption x before do we still have to allow for it can we do this better can we do the simpler you might also want to actually go and ask your users how do they actually use your module because you may have an idea on how your module is supposed to work but your users might have a very different idea indeed come at it with new eyes get up at 3am if you have to go on a vacation get away from code for a week and then look at it again anything to put you in a fresh mindset to look at your code from a completely new perspective and then start questioning everything then you want to set some expectations usually with the Drupal 8 module there's kind of two different perspectives you want to work at this there's the people who want to just get work done and then there's the people who just want to learn now if you're someone who wants to sit down and learn Drupal 8 and you don't care how long the porting process takes how many blind alleys you go down how many times you have to start all over again start now don't wait start now go go ahead open your laptop start coding i'll wait if you're the kind of person who wants to just get work done you're not that interested you just want to get the module ported and move on with your life then you probably want to wait now if you're in the middle you might want to keep it experimental open a branch or a new repository or a local folder of your code and just start playing around see what comes to your mind see what ideas you might want to explore most people are going to be in that keep it experimental stage you might have also thought okay well if i'm going to start my module i'm going to port my tests that's not a terrible idea test driven development has a lot of merits going for it but the thing is it's a double-edged sword simple test is available in Drupal 8 so you can largely write the same tests in Drupal 8 that you did in Drupal 7 it's not the preferred way it's probably going to go away in Drupal line but you can still do it now the only problem is that porting your tests means that you'll probably be limiting your thinking because with those tests come all the old assumptions of your module and you're no longer questioning everything after that identify the most central piece of your module and then work your way out now for flag module that was the flag entity so first we wanted to redesign the flag class with php5 and modern object oriented programming so what we did is we created a flag class but we also created a flag interface now an interface is kind of like a contract for your object it says this thing will do this stuff it's not the actual work but it says that this is the promise that we'll have these are the things that it will get done we also derive from a Drupal provided class called config entity bundle base and that does all of the Drupal work for us we break this down this is what the flag interface looks like it's a bit bigger now than it is but these are the core methods the interface is that contract it tells you what the module is supposed to do the things it does it does not contain any state or any method bodies it just contains the method names and signatures this is also a wonderful place to document your code because you can keep all your documentation in the interface class and the interface class then is a lot easier to read and then when you actually have your real code all you have to do is use an inherit doc in each method and you no longer have to have a huge doc block in your class Drupal has so Drupal 8 has two different kinds of entities in Drupal 7 we only had one an entity was an entity was an entity was an entity in Drupal 8 we have two different kinds we have configuration entities and we have content entities now configuration entity is designed designed for administrator defined structures it may be exported to YAML it lives in the database but it may be exported to YAML at any time and therefore moved from site to site to site and basically it's structure not data for our config entity we actually derive from this is supposed to be config entity bundle base the code is right the slide title is wrong it's the foundation class for configuration entities oh this does all the Drupal work for us so all of the extra stuff that makes an entity an entity is in that class we don't have to copy it we don't have to work with it it's just there all we have to do is extend from it and then it does all of the Drupal work in order to find the fields that belong on the configuration entity we need to create a config entity schema now the schema basically is a key value system that contains the data type of each field and what fields that it Drupal needs to save from the class this is a portion of flag schema it's stored in the module root slash config slash schema and you can see it's just a series of name values with types and labels this is just a sample there's a lot more in that class ideally we want to create a class variable for every field we define in the config entity schema this gives us a few different advantages it gives us code completion in our integrated development environment and it's also the easiest place to document the schema don't document it in the yaml file it's a mess it doesn't work very well documented in the entity class it feels much more natural it will belong there this gets to another point please please use an IDE and a debugger yes really it's time in Drupal 7 we had about 3000 files of which you needed maybe a dozen of them in order to actually understand how Drupal was really working how to write modules with it and those files tended to be very big in Drupal 8 there are at least five times that many files and each one of those is much smaller using a basic text editor can be done but you either have to have an amazing memory or you have to search google a lot an integrated development environment will actually save you a lot of time and a lot of hair pulling it will be frustrating if you're a plain text file editor at first then in a few weeks once you get used to it you'll wonder why you haven't done this sooner I like PHP storm but there's also net beans and a whole bunch of other ones that you could choose from also create a getter and setter for all your schema variables your interface isn't complete until you have a getter and setter for every schema variable also never mark any schema class variables as private because Drupal won't be able to access them and the reason why is that within the base config entity class there is actually a get and a set method which will be able to access all the class variables now if your schema variables are protected those methods will work without a problem if your schema variables are private in your entity class Drupal won't be able to do anything and your entity will be blank every time it tries to save all right we have our flag entity class defined let's plug that into Drupal so we have our class we're gonna hand it over to a on a golden platter to Drupal and then we're ready to go I was like I have brought you this and then Drupal's like what the heck am I supposed to do with that that's just a class I don't know what you're I've got lots of those why do I need another one and of course the flag class is sitting there sad and lonely the problem is that we need another piece of information we need something to tell Drupal what this class actually does we need kind of like a like a a config entity assembly manual for flag when we hand the assembly manual and the class to Drupal Drupal goes oh I get it now and it goes off and build stuff that assembly manual is called an annotation it's metadata contained within the class doc block so that Drupal knows what this class is supposed to do now it kind of looks like this it tells Drupal what the following class is why it's important and where to find the other important pieces of functionality this is what flags annotation looks at looks like at least part of it and you'll notice there's a lot of different stuff in here there's an entity type there's a whole bunch of id and label stuff some handlers some links let's break this down what is all this weird stuff the first thing is that we have this at config entity type at the top this is the annotation type it tells Drupal what follows is a configuration entity it's used for feature discovery after a clash and a cache clear so this actually prevents Drupal from having to execute all of those five times as many files it treats them as a text file and reads the annotation first and then it knows what to actually execute in PHP the next thing is the handler sequence the handler sequence tells Drupal where to find other related pieces of functionality like the list of all of these entities page or other key forms to create edit and delete this entity type all right so we have plugged our entity into Drupal now let's build the administrative interface it looks like this this is the this is the list all entities page for flag it's very rudimentary it's just a series of rows one ad flag button and some operations and some extra text at the bottom how we made this as we create how we derive from how we created a class called flag list controller it derives from a Drupal provided class called config entity list builder and provides the administration flags page it only has two important methods it has build header and build row build header defines the number of the kinds of columns that are in the list table and each row actually lets you populate the content of each row of each row in that table we don't even have to load the entity Drupal gives that to us for free now that we have the list page we need to do the ad and edit flag pages now the way that our ad and edit flag page works as they're kind of similar they're mostly the same other than a few special details so we have a number of form classes we actually have four form classes we have flag form base flag ad form flag edit form and flag delete form now let's ignore flag delete form for the moment and let's look at flag ad and flag edit both of those derive from a base class called flag form base and those derive from a Drupal provided class called entity form flag form base does all the real form stuff it builds the form it handles the validation it handles the submit so why do I have these two other classes then well both of these handle those different details that make one form different from the other when adding versus editing the flag it basically determines where the default values come from either statically or from the existing entity or and also changes the text of the flag submit button that's it that's all that's in there this is actually a very common pattern for creating forms in Drupal 8 you'll see this a lot you'll have a flag form you'll have a form base and then an ad form and then an edit form and we also have a flag delete form now the flag delete form looks like this when you actually access it it has a question it has some text and has either a delete button or a cancel link now that derives from a class called that that actually comes from flag delete form and flag delete form derives from a class called entity confirm form base now entity confirm form base is a Drupal provided class that provides us this quick yes or no form it only has about three methods we need to define that's it and then we have that form completed okay we have our admin interface we have our entity let's make it routable so we have a user they go to uh they go to Drupal 8 and then after that where we need to match all of this to our form classes somewhere in Drupal in previous versions we had hook menu but we don't have hook menu anymore so how do we tell Drupal where to find a route a path and match it to a piece of code to execute well we have a file called flag dot routing dot yaml and flag dot routing dot yaml contains these key pieces of information a route name and the path now we have the annotation as well which tells uh when we have the route when we have the path it matches to their outname and it matches to the annotation and loads the correct form this gets to another point Drupal 8 doesn't think in paths it thinks of route names so we wanted to add you know that add button to our existing path how do we do that you think oh we'll just add that to the routing file right i mean that works the problem is that we can't do that because the routing file only is for new paths you can only define new routes you can't modify existing ones for that we have another file we have flag dot links dot menu dot yaml this allows you to add to existing routes and what this does is this one adds the list page to system admin structure so that we actually when we go to the admin structure page we actually have a link to the flag list we don't define what flag list is because that's already defined within the routing document next we need to connect that add button again we can't add this to the routing file because we can only define new routes we need to add to an existing one so we have another file we have flag dot links dot action dot yaml which allows us to attach click actions to existing routes it has just it's basically a key value store it has the route name and it has which page it appears on so from here dribble can assemble all of this stuff necessary to actually link all the pieces of functionality together the thing is at this point you're like oh geez that's just a lot of code to write i'm gonna be at this forever because it's going to take me months to write all this boilerplate code and it just starts feeling like i've got a bunch of deep hurting and i'm not sure if i'll ever get any of this module stuff working again well i'll be in right now i'm going to show you how to do all of that build all of that in five minutes we have lots of scaffolding and dribble eight that's actually kind of par for course for any object oriented system we have lots of yaml files interfaces base classes base forms it's all necessary stuff and in the end it's actually better practice programming but it's really tedious to write so what are we going to do we're going to reduce our tedium by using dribble console dribble console is another project that will allow us to generate a whole bunch of that scaffolding code with a few clicks and a few key strokes on a command line so here we have the generate module we actually invoke dribble console and we call dribble generate colon module and then interactively we specify all the stuff we want the name of the module where we're going to put it the description the package name if any the core version and a few other things once we're done we can hit enter and boom we have the module structure but that doesn't really do anything yet okay that's fine let's make a config entity because that took a long time to make all the annotations the base classes and all this other stuff well there's also a generate colon entity config command we specify which module we want to do it's tab completed so we don't actually have to type the whole thing in then we enter in the class name for the entity we want to create and anything else and then after that it makes all this stuff for us the schema the routing file all the links file the interface the entity and the form stuff so all of that stuff that we've been talking about all done in that one command you can get dripple console at dripple console dot com or you could go to the dripple console page on dripple dot org all right so we have all of this module done now we need to make the flagging entity we need to complete that picture flagging entity starts out very much similarly to the flag entity we have the flagging class we derive from another base class called content entity base and we create an interface that contracts so we know what the flagging does content entity base is best for user created classes it lives in the database you can't export content entities to yaml they live in the database the fields are defined not with a schema but actually by overloading of a method on your entity class called base field definitions there's no need for hook schema anymore dripple will read base field definitions and make the tables for you beyond that flagging are really really weird they're not created through forms like a node or like a comment it works like this you go have a user they go to the web browser they go to dripple they load a node dripple will call flag entity view hook entity view and then it's going to attach a flag link to that node the user might click that link it goes to some route in dripple somewhere and then to something and then eventually we want to get to entity save so that we can save our new flagging now we could do the something could be a straight function called flag we had that in dripple seven but it's not really a dripple eight way of doing things so what we want to do is we want to do something better so in dripple eight we actually created a new flag service the flag surface is a plain php object but it's registered container wide in a file called flag dot services dot yaml and it allows us to compose other functionality from other modules as well as other pieces in dripple and create our primary storefront for our module this is where the api lives it's in flag service you can create any create a basic structure with dripple console with generate service once we have the service if you ever need to flag anything in dripple eight you actually just call the service from the container so you get the flag service and then you call the flag or unflag methods and that's it all right we want to make this expandable we have a working module but we have a large ecosystem of other modules that we want to have live on in dripple eight so we want to make this entire system expandable now we have the first thing is that we had flag we have the flag entity and we have all these flagable entities we want to relate it to okay well that makes sense we have a node a user and a whole bunch of entities we'll just make a subclass for each one of those i mean that's fine we'll have a flag node a flag user class and then oh right that doesn't quite work because suddenly there's a whole lot more entities in dripple eight than there were in dripple seven there's lots of entities you can practically trip over them in dripple eight and we don't want to recreate handler classes we went down this path before it's hard to expand it's not discoverable and generally no one has created another flag handler class in dripple seven in dripple eight we have to do better than that so what we have instead is instead of creating subclasses we create a flag a flag type plugin and the plugin relates the flag to the flagable the flag type plugin is discoverable using a custom flag type annotation you can create your own annotations in dripple eight and it's added dynamically to the flag entity it's not a subclass now because there's a flag type annotation and also a flag type base class if you want to make your own flag type go right ahead we have given you all of the pieces just define it in your module hit cache clear and it will show up we have a few different a few different flag type of classes we have node flag type user flag type they both arrive from entity flag type a base flag type base so you can even do non entity types if you'd like and they all derive from a dripple prided base class called plugin base so when we have all of this we have a node flag type and we have a user flag type but we still have that problem all those different kinds of entities well we have a special kind of flag type the entity flag type is called a derivative it allows us to use data to create the appearance of one entity type plugin for every entity on the site dynamically so everyone gets their own plugin all the time we also have to handle the problem of the other problem where we have that some route where does that some route come from because if we're going to make it so different for each individual entity type we want to have that kind of versatility as well so we want to salt and close that gap and what we have is another plugin we have a link type plugin now there's actually four link types now this is this screenshot has three there's an ajax one a confirmed form link and a regular normal link so if you want to expand the flag interface grab the link type base create a link type annotation and then you can do whatever you want you can make your own link type very very easily all right we want to create an api as well in flag seven we had hooks hooks were everything we had them to do all this stuff to define flags validate and grant access react to events provide flag types provide link types the thing is it's a lot of stuff in a droop will eat hooks aren't everything so instead it looks a lot more like this when we define flags if you have a default flag that your module provides we actually do that in cmi so you just have a yaml file that contains your flag you can even create it using the gooey in your instance of droopal and then export it and then just copy that into your module file for providing flag types and link types we have plugins we also have events now let's say we have a flag service we have someone we have another thing called an event dispatcher within droopal so we have something happens in flag module we flag something we unflagged something we delete a flag we reset a flag we want to let everyone know that that happened instead of invoking a hook the flag service actually is going to talk to the event dispatcher the event dispatcher is a piece of droopal another component within droopal that a whole bunch of event subscribers have actually listened to and they say i want to listen to this flagging event or these flagging events you can only get the events that you want and then every time that event happens flag service creates a flag event class which contains the information that is related to that event and then gives it to the event dispatcher the event dispatcher then broadcasts it to everyone who's looking for it there are only four events so far actually there's three events i'm really trying to get a patch to get number four in right now just entity if something is flagged unflagged a flag is deleted and if a flag is reset hooks hooks still exist in droopal eight there's actually another class called the module handler interface it provides a method called invoke all that's where module invoke all went off to in droopal eight you want to inject that module handler into your service and it would look kind of like this if you want to implement that in your services constructor you would inject that and then assign it to a local variable a class variable the thing is in flagged service we assumed that it was going to be a necessity that we'd have to use hooks and yet we haven't needed them we have not even needed hooks yet in droopal eight because there are so many different ways that we can do a lot of the things that we did before we might though in the future still use hooks there's still a debate about that all right we have our module let's have a few lessons that i learned while doing this entire porting process over the last two years first of all you want to do this in public but attach a warning label to it when you actually start your project the first thing you might want to ask is where should the code live should it just live on my particular laptop that's not really a good idea you want that module to live somewhere out there so that maybe you can pick up some extra contributors and if godzilla decides to attack your house and step on your laptop then well you might not have any backups of your code anymore then you'll have to start all over again there's three different way and three different places you can usually put it you can put it on droopal.org but is your module really ready to put it on droopal.org that's really public and you might just be starting your project you might be starting with an empty repository you don't know if you're going to get to be finished with it or if you'll have to start all over again okay you can put it in a droopal sandbox but droopal sandboxes have limited visibility they're really hard to find you'd have to do a lot of public PR yourself you might also want to put it in a public repository like github or bit bucket maybe you just need a clean break from droopal to develop your particular droopal eight module for a while until you deem it ready to move it back to droopal.org in flag's case we actually put it on github that's where the module started we kept it there for about a year and a half another thing is that we had to keep up with core keeping up with core over the last two years has been a bit difficult I can go into a long discussion about how difficult that was and the things that I learned and all the techniques I came up with but today none of that is really that relevant what you want to do right now is start with the latest release start with that and stick to it stick with it until you're ready to actually update once you get to a good break and updating your module then move to the next release that was that is out avoid developing against droopal head unless if you want to lose all of your hair because you will lose all of your hair if you try to keep up with droopal head by the time your module is kind of stable you might want to start testing it against head instead because the change is necessary to to keep up with head will be far less than the changes to your module that you want to make in order to complete your module also ask for help but be patient show a lot of appreciation there's lots of places to find help I went to droopal contribute on IRC that's where I found the most help but you can also find a lot of help on the droopal.org list changes page or just the issue key for droopal sometimes money is your problem sometimes you need to ask for funding so you can have travel money to get your team together you might want to attend a conference you might want to just take some time off from work just so you can code in my case I actually needed to run a crowdfund to go to droopal con Austin so that I could get to and get through the last few big hurdles that I was experiencing in the flag project and I actually ran that project and it was successful and we had views support by the end of that week you might want to start wondering when do you want to move your module back to droopal.org if you kept it in a sandbox or if you kept it in a third party repository now there's a lot of things that you might want to think about when doing this issue cue noise you might be rapidly developing your module making a lots of little commits and you really don't care about the commit messages or making issues about it because it doesn't matter because you already know what you're doing and no one else is working on it you might have git log pollution where you have all of this stuff is happening you might on the other side of that you might want to really leverage your community in order to help you work on your module or you really need the visibility so that you can attract developers to your project now you might be tempted to do this the issue cue noise and the git log pollution that stuff is forever it's going to take a lot of mental effort and it's going to live in your repository for a long time and really in that case you'll be you'll think that well I don't think a lot of people are going to be working on this because I'm going to keep this all in my head and it's not it doesn't have to be visible because the module is already pretty popular don't do that you want to do this one thing that we had during running flag modules we kept it on github for far too long it took forever to get it anywhere because it was just me working on it and in the end the issue cue noise we wasn't really a factor we came up with 70 issues by the time we moved it back to triple dot org and all of those were notes saying please do this later also the git log pollution that was a bit more of an issue but in the end it turned out turned out that it was more important to keep all of that history rather than actually throwing it all away and making a big bang squash connect leveraging the community and having visibility is far more energy intensive because it takes a lot more time to raise the awareness you have to go and talk to people get on podcasts do all of this stuff and keep screaming and yelling and talking about your new module in order to get the attention necessary to get one contributor to submit one patch you don't want to do that you get it for free on drupal.org in your existing module project also things are a lot easier now we have example module for drupal 8 we didn't have that when i started we didn't have drupal console either so i had to do a lot of this work myself reading core code which is a bit of an effort by itself just to try to figure out how to make all this stuff you don't have to suffer the way that i suffered there's a lot of ways you could do this now that's a lot easier one night i sat down with drupal console it took me 15 minutes to make 75 percent of the entire module and i had to go have a beer after that port if you're if you're looking at your drupal 8 module you want to port now if you're here to learn if you're to work you'll probably want to wait but don't wait too long we're late in the beta stage that release candidate's going to happen at any time we're at 25 criticals the last time i looked at it and furthermore we have in flag module not have had a module breaking problem for three months that's a long time in git commits so really don't wait too long also do a code review question everything that your module does nothing is sacred question everything so you can really reimagine how your module works please use an ide and a debugger it's going to save you a lot of time in the ad patiently ask for help when you can but show appreciation a lot of the core developers are glad to help but they're really time constrained especially after this long development cycle that we're at things are actually easier now especially since drupal console than it was then where we had to ask people directly for every little thing do your make your module in public but put a warning label on it don't have users go ahead and downloading your module if it's going to break or if it's half done put a warning label on it but don't hide it make sure people see it is money your problem maybe you want to consider crowdfunding also move out of your sandbox quickly don't keep it in the third party repository order drupal.org sandbox for too long and also things are a lot easier now all right i'd like to take a moment to thank all the people who made flag module today possible and also for the reason why i'm here today especially ffw who i work for we're hiring just in case you didn't know again who wants another shirt i've got like three of these and two it's like you raised your hand first and then there was you not so much of an arm okay sure i again i do have some flag module stickers up here two sets of shades i also have stickers for the twin cities drupal camp which is just next month it was mentioned in the keynotes we throw a great camp it's four days long one day of sessions one day of free training two days of sessions one day of sprints it's a beautiful beautiful sunny minneapolis all right come sprint with us today tomorrow right here learn and contribute about drupal core mentors will help you set up and find your issues or maybe you want to work on flag module with me maybe just maybe it'll be right here at the convention center room 403 ab from 9 a.m to 6 p.m all right thanks everyone you can find the slides on github.io and you can find me on twitter and i don't even know how far how much time we have left am i over i think i have like 15 minutes i think anyone have any questions question i think i saw your hand first see now my other wrist is tired from how holding the microphone the entire time um thanks thanks um great i enjoy using flag all the time um did you say we're not manually building install files any longer that schema that a custom table is so we don't really need to define define hook schema anymore when defining a configuration entity or a content entity it does that automatically so it just looks at the either the base field definitions method for content entities or it looks at the configuration schema for config entities and then it will create the tables for you i think it's really cool i saw the there's a form you added that because that was uh bundekraut had done a module for dupal 7 for flags to do a form as the flag in i saw it's in there right you put it in the model yeah there's actually a new um field entry link type and drupal 8 it's one of the big features that i actually added in this release cycle because we've had it for so long but it was only accessible programmatically so it was kind of a mess and now we actually just have a link type so you select it and you can add fields to your flag like any other entity and it will have all the regular form fields and it will be awesome anyone else uh what approach did you take for the tests did you do it as you went along or did you wait until you kind of had a certain chunk finished and what problems did you come up with uh tests there's a story about tests so how it kind of went around is that for about nine to ten months of developing the module we had no tests in it it was just me trying to make a flag and then flagging something and that's because most of the module didn't do any of that stuff and we weren't sure if behat was going to be in core or if we should be using ph php unit or any of those things in the end it came down to it was getting too annoying so i sat down one weekend and learned how to write simple tests because i hadn't done that before and wrote a whole bunch of simple tests at that one time and we're still maintaining them i'd love to rip them all out and replace them with behat tests which was my original vision but that hasn't happened quite yet someday i might do that any other questions yeah this is really a follow-up on that so um i've been i've ported my initial module you know i got a couple of contribs and i've gone through that once like back in october or something like that um so what's really confusing to me is kind of where testing really is at from that perspective in terms of because there's all the what's available in drupal 8 versus what's actually on drupal.org versus you know that kind of stuff so do i hear you saying that behat testing is available in drupal.org or that it it's kind of available we've laid the groundwork and one of the criticals to actually support broader behat testing within drupal.org and on base core drupal but it's not really yet a full behat solution where you can just write gherkin syntax stuff and then turn that over it's not quite at that point yet but i'm really hoping that someday it will be because behat tests are a lot shorter and easier to maintain any other questions okay just i've got two of them you're closer unfortunately so if i understood right uh hooks can be substituted by event subscribers the answer is yes depending on if you're asking krel or not the other co-maintainers are like no you can pull the hooks from my cold dead hands and krel is like why the heck are you still using that events are good the only problem is that that events are not as performant as hooks so if you have a hook that is invoked a lot of times you might want to keep with a hook because it's still faster than an event we're working with that to make events as fast as hooks and then the idea is in drupal 9 we probably won't have hooks anymore it will probably be events and in practice events are actually better because you only subscribe to the ones you need and you can pass a class with any structured information you need with that so that it can take much more complicated data than a massive array of doom and then a few scalar parameters you particularly prefer events so far i have preferred events because they are more the object oriented solution and we we haven't really had any hooks yet in fact i'm trying to get one out of the module right now because flag service doesn't depend on the module handler yet and this one is kind of old leftover 7x code and we're trying to replace that with an event i think that will get in by tomorrow night but we'll find out and i know that you had a question and fortunately you're in an empty row so i can get to you fast i think you answered most of my question i think you pretty much had the similar question but yeah i was going to ask you what was your learning experience on getting away from hooks and how invented you know not to use hooks and do you think it's going to change anytime soon that you would want to go back to hooks because they might improve so to be honest i'm a mutant because i started i have tried writing drupal five six and seven modules for years and the fact is that i never liked them and i came from an academic background where object oriented programming was a lot more common so as a result i'm much more used to objects and all of the weirdness that drupal does in order to work made sense in php4 but in php5 it's like why the heck are we still doing this and i don't really like hooks i find them weird mystical magic metachlorian level stuff and i really don't like them all that much so that kind of the common complaint we have at work everybody hates hooks and we're like why are we still doing this look we have much better ways to use and the other thing is that hooks are really kind of nightmarish for documentation they are horrible horrible horrible horrible for documentation because every time i have to go work on client work in the drupal seven world after working on drupal eight during the evening it's like i can't find anything that works you mean i have to implement three hooks to get this one thing why isn't this an object because i would be done already and it only needs one page on drupal.org to tell me what i'm supposed to do instead i need three different hooks and they're in three different pages and they're not telling me all the stuff i need to do it's a mess objects are a lot easier to actually document they're a language level feature to document so they have language level support so it's actually a lot easier in the end once you get over the intimidation factor and over any knowledge gaps that you might have with object oriented programming even if a performer is better with hooks i i i particularly prefer i would prefer using events yeah this is no this is what i i'm catching that's kind of how i think about it too because i can define an event on the event class and i could send one link to someone saying here's the events after that use the normal event pattern to subscribe to stuff you'll be fine and you can do all the stuff you need it's like what kind of structured data do i need how many of you in this room have had to go where in the array of doom do i have to find the stuff i need that's passed to my hook i hate that but if it's an object it's like oh i just go find the object it's got a name there's the fields there's the methods okay i'm all good i'm all good give me another coffee anyone else all right awesome again i still have i don't have any more t-shirts but i actually still do have two pairs of shades if you want them um and i also have some flag stickers there's only a few of them left don't don't go let me go home with them please i also have a bunch of tc drupal stickers so please go ahead and take them please take take