Comedy did not feature at all when the Edinburgh Fringe began but over the past three decades it has become the "spiritual home" of Britain's funny folk.
While London lays claim to being the birthplace of "alternative" comedy in the 1980s, it was the Scottish capital where the new generation of comics received their education before transforming British humour.
Comedy talent such as Steve Coogan, Lee Evans, Bill Bailey, Alan Davies, Harry Hill, Jo Brand and Al Murray all got their big breaks in Edinburgh.
According to comedy impresario Nica Burns the "golden year" was 1991 when Frank Skinner won the Perrier Award, beating Eddie Izzard, Jack Dee and Paul O'Grady's character Lily Savage.
Some found fame quickly while others such as Graham Norton and Michael McIntyre slogged away in Edinburgh for years before getting their big break.
Despite constant claims of its imminent demise, the Edinburgh Fringe has continued to be a unique showcase for comedy talent over more than 30 years.
In more recent times John Bishop, Sarah Millican, Kevin Bridges, Ross Noble, Russell Kane and many others have seen successful Edinburgh runs springboard them to TV fame and arena tours.
This year's Fringe features more than 3,000 shows and more than a third are comedy.
That means more than 1,000 comedy acts from all over the world will be in the city during August.
Nica Burns, who took over the Perrier's, the awards that became synonymous with Edinburgh comedy, says: "When I started with the awards in 1984 I used to personally go and see all the shows. You could not start to do that now."
These days she employs a judging panel to go around the 700 eligible comedy acts and make a shortlist for the award, now sponsored by lastminute.com but still coveted by comedians.
Richard Herring, who has appeared in Edinburgh for most of the past 30 years, does not qualify for the comedy award because it does not include people who have already had a TV series.
He broke into TV in the mid-90s with Stewart Lee in Fist of Fun but even though he is a 50-year-old Fringe veteran he says: "Sometimes I'll be annoyed I've not been nominated - then I remember that no judge has seen my show because I'm not eligible."
The Edinburgh hour
Herring says that the Fringe is still the "best arts festival in the world" but it has changed beyond recognition since he first performed in a student revue in 1987.
He says that sketch shows by Oxbridge students such as him were coming in for a lot of stick from the new wave of comedy stand-ups who were starting to see the Fringe as their domain.
They saw it as a place to come for three weeks, hang out with other performers and hone their material.
Herring says one of the major changes that Edinburgh developed was the one-hour comedy show.
Even in the late 1980s it was rare for stand-up comedians to do a full hour-long show on their own and they would often partner up with other performers to fill the Edinburgh hour.
Nica Burns says: "The Edinburgh Fringe became the learning ground because in the clubs you could only do part of the show.
"You started with a five-minute guest spot, if you were any good you could do 10 minutes and work up to 20 or 30 minutes for the headline act.
"For that jump to a whole show, to be able to play in a larger theatre, to be able to go on the road, you need to develop your material live.
"Comedians suddenly realised that Edinburgh was a fantastic place to come and book yourself a hall.
"That's the great thing about the Fringe, it's not curated, so anybody can do it."
Comedian Simon Munnery, who has also been performing in Edinburgh for 30 years, says: "The hour-long slot gives you more space to experiment. For most comedians it's a big step to go from 20 minutes to an hour.
"When you are doing that sort of time there is more pressure to have some sort of theme or to have something to say."
Fred MacAulay first appeared at the Fringe in 1989 as part of a collective of Scottish comedians called the Funny Farm.
For his first four Fringes he was part of a composite show with other comedians, taking a bigger time slot each year.
He says: "It is always there very much on the horizon for you as a new stand-up that the target is to do an Edinburgh hour."
"I always thought it was very much like a skiier," he says.
"You are skiing on the blue runs but out of the corner of your eye you can seeing a red or a black run and you know 'I'm going to have to tackle that one day'."
MacAulay says that a few festivals around the world, such as Melbourne in Australia, have followed Edinburgh's comedy model but the Fringe remains unique in its scale and scope.
Karen Koren was there at the start of Edinburgh's comedy boom.
She founded the Gilded Balloon venue in 1986, which along with The Pleasance and The Assembly led the 1980s comedy boom.
"I was certainly there at the beginning of the stand-up comedy surge," says Koren, who set up her first comedy club because her friends were looking for a place to perform "alternative" comedy.
"I blame Margaret Thatcher myself," she says.
"It was really satirical and political back then.
"Nowadays anything goes but then it was quite serious comedy, with the likes of Mark Thomas and Mark Steel, Jeremy Hardy and Kevin Day. Although there have always been silly performers as well."
Nica Burns agrees that the Edinburgh comedy boom was fuelled by acts who were reacting to the politics of the time and Prime Minister Thatcher.
But she says they were also seeking to overthrow the old comedy establishment.
Burns says: "It was a really exciting time because alternative comedy was a political movement.
"For the original comics, such as Alexi Sayle, it was about changing what comedy stood for - no more homophobic, racist or sexist jokes.
"Within a very short time they had run off all the old comics and TV moved into the new era."
Burns says that the new comedy movement may have begun in London but Edinburgh was the "school for clowns", where they learned to how to perform.
Comedy around the clock
Koren quickly went from running one studio theatre with 150 seats to 14 venues of various sizes dotted around the Cowgate.
To maximise use of her spaces Koren wanted comedians to perform day and night.
She says: "I remember that stand-up was always considered to be for the evening.
"No performers wanted to go on before 7pm and they didn't want to go against each other.
"I had to push that concept to them all. The more the merrier. Think about your own show and what you are doing."
As well as getting to perform your own show there was another factor that attracted comedians to Edinburgh - the camaraderie.
Munnery says: "It's wonderful to be in the same place at the same time as all these other people who are in the same sinking boat."
For Herring his early appearances are as memorable for the nights out with fellow comedians as they are for his shows.
Koren says: "I started a show called Late 'n' Live. It ran from midnight to four in the morning.
"We had the latest licence on the Fringe. It became a place where people came to see other comics die.
"It was where all the comics got drunk and had a great time together. That type of camaraderie that was around then really enhanced it and pushed it forward.
"There was lots of young kids going 'I want to be like that guy up on stage'."
And it was usually a guy.
Despite Burns and Koren being a strong female presence on the comedy scene they both agree that it was very much a "boy's club" in the early days.
Burns says: "The number of women doing shows was so small you could count them on one hand at the beginning.
"When it started it was much harder for women.
"There was a real feeling that when a woman came on there was a collective folding of the arms by the audience, and they were saying 'OK, show us you are funny'.
"The audiences was very male because it involved smoking and drinking as well and quite a lot were above pubs.
"There was nowhere to get changed back stage, certainly nowhere for women, they had to get changed in the toilet. It was a tough environment and a tough way to learn your craft. They had to overcome a lot of hurdles."
The first women to win the Perrier Award was Jenny Eclair in 1995 and it was another decade before the next, Laura Solon.
However, Burns feels that recent years have seen a breakthrough and women, who still only make up less than a third of comedy performers, do not have to persuade audiences they can be funny any more.
Female comedy performers, just like their male counterparts, are cashing in on a comedy boom that has seen more and more of them touring large venues.
As comedy has become big business, festivals have sprung up all over the UK but Edinburgh has maintained its position as the number one place for comedians.
Ed Bartlam, who founded the Underbelly venues in 2000, says: "Edinburgh has been a platform for alternative comedy and that is still the case.
"The Edinburgh audience and the Edinburgh critics are adventurous and they like to see something different. Edinburgh is a great example of a festival that manages to fit both the mainstream and the alternative very nicely."
Underbelly runs comedy venues on the South Bank in London but it is Edinburgh that acts as a feeder for new talent.
Bartlam says: "In Edinburgh we have got 17 venues ranging in size from 50 seats to 400 seats, therefore we can show lots of different acts at different levels.
"In London we have got two tents and they have both got 400 seats.
"Inevitably it means we are programming shows we think can sell that amount of tickets.
"In Edinburgh we've got this broad range of venues so we can programme interesting new material which might only sell 50 seats.
"Edinburgh is so important because it allows those at the beginning of their career to play in small spaces."
Another factor in Edinburgh's reinvention has been the rise in the Free Fringe over the past decade.
Free Fringe shows, which are predominantly comedy acts in the spare rooms of pubs, allow the audience to watch for free and they are invited to make a contribution at the end.
It is a cheap way of getting to perform on the Fringe and has led to comedy careers for a number of new comedians such as Imran Yusuf and John Kearns.
Herring says his generation of comedians often wonder if they would have made it if there had been the same amount of competition when he was starting out.
He says the current crop of comedians are much more polished and professional than the acts of the 1980s.
"In 1992 I came up with shows I was still writing," he says.
"By the end of Edinburgh I hoped to have a good show but now you can't really behave like that. You need top be good on day one."
He says many comedians these days keep themselves fit and don't drink.
"The performers from the 1980s and 90s would find that very strange," he says.
Another major change has been the costs involved.
"It was bit cheaper for everyone in those days - for the punters and for the acts," Herring says.
He says he has lost thousands of pounds on Edinburgh shows but always hoped to win enough work to make up for it later.
The gig economy
For Fringe veterans such as Koren, whose Gilded Balloon venues were forced to move to the Teviot after a devastating fire in 2002, the peak was in the late 80s and early 90s.
"Now everybody wants to be a star and not everybody is going to become a star," she says.
Munnery says some aspiring comedians go to extreme lengths to get noticed.
He says: "There are some ridiculous things like huge twice-human size posters for a show and then venue is some portable cabin.
"They are spending more on advertising than they can possibly make back at the box office.
"I used to be with an agent like that," he says.
"They tell you that you are investing in your future and at some point you have to ask 'when is my future going to start?'.
Munnery adds: "You basically go to Edinburgh, lose thousands of pounds, spend a year paying it off and then go and do it again.
"It would probably be illegal to be employed on that basis but because you are employing yourself it's alright. It's the gig economy, literally."
Despite the skyrocketing costs of Edinburgh rents and they increased competition for audiences, performers keep coming back year after year.
Herring says: "Even when I'm negative I've never said it's not amazing.
"It's the best festival in the world and it is an amazing thing to be a part of.
"I've spent two years of my adult life in Edinburgh just by coming to the Fringe.
"It's a phenomenal festival and it's breath-taking how good the shows are."