By the time Vint Cerf was 17 he considered himself a failure. At that time, Dr Cerf - one of the "founding fathers" of the internet - was yet to be published, and throughout history, all the great mathematicians had done their best work in their teens.
"But it all worked out in the end," said Google's chief internet evangelist, addressing an audience of 250 school students in Edinburgh last week.
Recounting his career so far, he also said that there was a lot left to do. One of the challenges Nasa was currently grappling with was how to build an interplanetary internet, said Dr Cerf, a visiting scientist at the space agency.
It was much more complicated to send a signal 35 million miles - the distance between Earth and Mars when they were at their closest - than around the world, he explained.
Then there was the disruption caused by the planets rotating, he added. "We've not figured out a way to stop that," he said.
Dr Cerf spoke to the students at the invitation of ScotlandIS, the trade body for the country's ICT industry, which wanted young Scots to recognise the "massive" opportunities in the digital industry on their doorstep.
Each year Scotland produces 1,700 computer science graduates for about 7,000 digital jobs. According to the IT and business sector body e-skills UK, over the next five years the country's digital industries face an estimated annual skills shortage of between 9,000 and 10,000 people.
"We have a skills crisis in the sector; we want to show youngsters the opportunities that are out there," said Polly Purvis, executive director of ScotlandIS. "Improving the computing science curriculum in schools so that young people become interested in the subject and become creators of technology, not simply consumers, is vital."
Dr Cerf told the students that within a decade our communication with computers would be more akin to a conversation, as opposed to using keyboards and mice. And 3D printing would change the face of manufacturing, he said: countries would in future simply export raw materials rather than finished products.
Students attending the question and answer session described it as "inspiring". Lee Trotter, an S6 pupil from Knox Academy in East Lothian, said: "The way he talked about the future and all the possibility he saw - it really made you think bigger."
Meanwhile, Paul Burns, an S6 pupil at Crieff High in Perth and Kinross, said: "Some of the things he was talking about just did not seem real - it was like stuff out of a film. It definitely made you realise you can do more than you ever thought possible."
In recent years, Scottish schools have been accused of turning youngsters off computing science with irrelevant and boring lessons. But Ms Purvis said that the curriculum was now improving with the introduction of new qualifications and Curriculum for Excellence. And with on-the-job training in the pipeline for computing teachers, industry was more optimistic too, she added.
This month marks the beginning of a two-year continuing professional development programme that is intended to reach every computing teacher in the country. It will target everyone from non-specialists delivering the subject in early secondary to computing teachers delivering the Advanced Higher.
Plan C (Professional Learning And Networking in Computing), funded by the Scottish government and delivered by Computing at School Scotland and the British Computer Society, also aims to build networks of teachers to offer each other support.
However, last year, Computing at School Scotland revealed that almost one in 10 Scottish secondary schools had no computing science teacher.
Ollie Bray, deputy headteacher at Grantown Grammar in Highland and a former national adviser for emerging technologies in learning, said this showed that more CPD would not be enough to solve the "digital literacy crisis" in Scottish schools.