EARLIER this year I caught the train to Aberdeen to go to the library.

Not just any library but the still-newish University library, a £57 million zebra-striped monolith designed by Danish architects Schmidt Hammer Lassen. It was worth the journey. The building is a formidable example of the public space as a theatrical event. Walk through the entrance and you are confronted with a dramatic atrium that draws the eye upwards and upwards. Right at its heart is an oval void that repeats and repeats through seven canted floors. It is a swirl of absence that gives the building an amazing presence. In short, I quite like it.

I like it because the building appeals to the architectural groupie in me. More than that, though, I like it because in its show-offy grandeur it is a statement of belief in the very idea of the library. And, Andrew Carnegie knows, we need such statements at the moment. Because for every new bloom like Aberdeen University Library, or the still-under-construction Library Of Birmingham (which, when finished, will be the largest in Europe), a far greater number are withering.

The last couple of years have seen an assault on UK library provision as councils look for soft tissue to cut away under the Government's austerity programme. Since last April, some 407 libraries have been either closed, threatened with closure, privatised or moved to volunteer control.

This is primarily an English, Welsh and Northern Irish problem. Extra Scottish Government investment means our library service has been ring-fenced from closures. That said, some services have moved from council control to the purview of community trusts and staff numbers while opening hours have been squeezed. Purchasing budgets are also af-fected. As Falkirk librarian and Unison branch secretary Gray Allan has said: "If you can't afford a key book for your studies and the library can't afford to buy it either, how are you to achieve your full potential?"

As a nation we still believe in the idea of libraries. According to research released last week by the Carnegie UK Trust, 61% of Scots have used a library in the last year, the highest percentage by some distance in the UK. And most of those visits are not to the bright, shiny new university libraries like Aberdeen but to rather more modest libraries in towns, cities and villages around the country. No wonder, then, that any murmur of threat to them has prompted a huge outpouring of love and anger. At the forefront of public campaigns to protect our libraries have been Scottish writers such as Ian Rankin and Julia Donaldson. A year ago this month, Leeds-born author Alan Bennett declared that shutting libraries was comparable to child abuse. Yet every week brings news of further closures. As I write, the Women's Library, currently housed in the London Metropolitan University, is under threat.

In some places, then, there is still a fight to be had to defend the very idea of libraries. It is one I would be more than happy to sign up for. But – and hopefully this is not an inconvenient time to raise the question – can I ask what exactly I am signing up for?

It is easy to romanticise libraries. Many of us can conjure up reveries of teenage hours spent surrounded by books in hushed reference rooms. My own were spent in Northern Ireland, looking for science fiction and thrillers in the only place I felt totally myself other than the cinema and my bedroom. Libraries are concrete statements of the pleasures of learning, early adopters of the idea of a knowledge economy several centuries before some policy wonk came up with the buzzphrase. Yes, defenders of libraries romanticise them. There's a lot to romanticise.

The danger is, however, that we hang on to a vision of these institutions that refers back to our own youth or, worse, to some received notion of what a library should be – a hushed, book-lined space of almost spiritual retreat. And then we're disappointed when their modern-day equivalent doesn't conform to that image. So we moan when they introduce CDs, DVDs or audio books. We complain about bookshelves being cleared for computer terminals. When the author Philip Pullman dared to suggest that libraries were about more than books in a newspaper article last month, he was upbraided by readers who vehemently disagreed. For some, a library without books isn't a library.

I WONDER. I don't own a Kindle. I don't have an iPad. I love the feel, the smell and the heft of books. Books are wonderful and economical vehicles for information and entertainment. But increasingly, they are not the only ones.

Here's the thing. Doom-mongers speculate that we are approaching the end of print. The book is not dead; in years to come, no doubt, it will adapt and reconstitute itself. (I have a vision of books becoming high-end luxury items – a process that has already started on the coffee table.) But it would be counterproductive to argue that books should continue to be at the heart of libraries as the years go by. We are becoming ever more digital as a culture.

As I sat in Aberdeen University's cafe, it was difficult to ignore the fact that none of the students around me was reading a book. They were on their phones, on Kindles, on iPads. They were plugged into the digital world. It would seem curious, then, for the building they sat in to ignore this.

Chris Banks, the university's librarian, is far removed from the popular notion of librarians (the shy, quiet, insular, bookish Ronnie Corbett in Sorry type). "There is that stereotype," she admits, "and I'm probably not it." It is as much, she says, about being willing and able to stand up in front of huge groups and talk as it is one-to-one help. "There's been quite a shift in terms of the natural personality type coming into the role, or certainly in those who will survive in the role." She sees the library as a conduit between university departments, between university and city, and between students and knowledge. Aberdeen has plenty of books, some 400,000 in open access (and that's without mentioning the library's impressive and unique manuscript collections). But, increasingly, knowledge arrives digitally. "The information landscape is immensely complex," Banks explains. "We license a huge amount of resources. They're often difficult to use, so a lot of our staff resources are devoted to training people how to use the electronic stuff that we are buying. Students don't have offices. They are nomads. They've got their dorm or a room at home, but if they're going to study and work, the library is the physical space where they come to do that."

In a way that has always been the case, but the idea of what the building's architect Morten Schmidt calls "the third space", a space beyond home and work, is leading to libraries taking on new areas of responsibility. In Aberdeen, there's a cafe and a gallery space. Schmidt also points to his practice's work on the extension of the Royal Library in Copenhagen, the Black Diamond, which added a chamber music hall plus a lecture hall to the library blueprint. "That has been really successful," he says. "Thousands of people come there every week to get high culture."

This is an interesting add-on to the library's function. The result is that they are becoming noisier places (though you can still find peace and quiet if you need it), more interactive spaces. Books are still part of the story but no longer the complete story.

But welcome as this can be, it is important to stress that it is an add-on. Libraries are welcome to start branching out into other cultural areas if and when it can be done. Aberdeen is a statement of what libraries can be when there is money and will behind them. But in Scotland it is the exception rather than the rule. What about the small community libraries most of us use on a day-to-day basis?

A few weeks after my visit to Aberdeen I popped into Bonnybridge Community Library. Bonnybridge has a population of roughly 8000 people, almost 3000 of whom have a library card. Borrowings per year top 50,000. But spend any time here talking to the very bubbly librarian Naomi Kenny (once again no Ronnie Corbett type) and it becomes clear that the library's role in the community extends far beyond books (though books and reading remain at the heart of it). Kenny organises reading and drama groups. She arranges visits from the community policewoman. She has taken children to the Edinburgh Book Festival to meet Jacqueline Wilson. She is keen to provide a community service in a community where there's not much else to do. "It's not just about coming to the library to read a book. It's about seeing this as a comfortable space."

Kenny argues that the library is there to be used by kids, teenagers, schools and community groups (the Greenhill Historical Society's meet during my visit), and it is her job to make sure it is reaching all of those groups. And so she goes out and talks to anyone who'll listen, organises events in the library and makes the building more than just about the books you can find inside.

This matters, and, it seems to me for two reasons. Firstly, it is a reminder that, with the very idea of the library under threat, libraries are every day proving that they are plugged into their communities. They reflect local people's interests and give the community the space to play out those interests. (And at no cost, remember. How many buildings allow you to spend the day there without buying something?) If we get wrapped up in the idea of them being providers of books we are limiting what they can do.

Also, the danger is that if we get hung up on book provision we leave libraries open to the spurious argument that when everything is increasingly available online then book-filled libraries don't matter so much.

As Chris Banks points out, it's because much is available online and in digital media that libraries matter more. Someone has to guide you through this world. Or allow you to access it in the first place. It is easy for some of us to say we can download anything now. And if you can download anything why do you need libraries to do it for you? But that's like saying everyone can walk into a bookshop and buy a book. Most of us can. Some can't – and in comparison with computers and other digital platforms, books are cheap.

It is important, then, that libraries continue to adopt new technology to ensure everyone has access to it. (At Bonnybridge you can borrow pre-loaded books on MP3 players. Kindles for borrowing will surely follow).

I think this is key. Libraries are re-imagining themselves for the 21st century. And they are doing it for the best reasons. They are doing it to provide a service for those who can't afford books or digital technology. They are doing it to remain relevant to their communities. They are doing it because society is changing and everyone should be able to tap into that change.

Books will not disappear from libraries. Aberdeen University Library, one suspects, will make more and more of its archive because it is not online. But libraries of the future cannot be institutions that resemble something out of the 19th century.

Libraries address a lack. They are a presence that fills in absences. Poverty can be about a financial absence. It can also be about a lack of access. Libraries are there for you to borrow the latest James Patterson book if you want to. But increasingly they are a space to address digital poverty, too. According to Government statistics from last year, 33% of UK households do not have internet access.

In the end libraries serve the same purpose they always did. They allow for self-improvement. "It's about getting people to university," says Naomi Kenny. "But also for the adults and for their lives too. It's about feeling valued for themselves and exploring their horizons, to allow them to go as far as they want to go, even if that's just to knit an Arran jumper."

I love libraries. I love the fact that they helped change my life – or at least, offered me a place to imagine that change. How strange would it be then to say that libraries themselves can't change. For libraries to matter they must continue to give us the power to change our lives. That change may come from the pages of a book or through a computer screen, or in a way we haven't imagined yet. We need to stand up for libraries. But it is important we don't stand in their way while we're doing it.