Former president also said TV should be avoided: ‘Those are two things I’d advise, if you’re a good president, not to do’

Barack Obama appeared to take a swipe at Donald Trump on Wednesday, saying he would “advise, if you’re president” to avoid social media and cable news.

The former US president was speaking as a guest at an event for Splunk, an international data and software firm, when he was asked how he parsed information while in office. He touted the importance of building a solid team to stay informed.

“The presidency is like drinking out of a fire hose – you can’t absorb that information yourself,” he said. “You can make sure you have a team that is distilling info as effectively as possible so you can get a basic framework for what the problem is.

“The other thing that’s helpful is not watching TV or reading social media,” he added, to laughter from the crowd. “Those are two things I’d advise, if you’re president, not to do.”

The criticism appears to be targeted at Trump, known for his Twitter diatribes and obsession with cable news channels and how they portray him. Trump tweeted 284 times a month over the last six months, the Hill reports, an increase from months past. Despite the increase in frequency, Trump is getting less engagement on his posts today, the report showed.

Splunk’s chief executive, Doug Merritt, said the company invited Obama, who is “a bit of a data nerd”, for insight on the rise of data and its uses. The company did not say how much it paid for Obama to speak. The former president’s visit to San Francisco comes days after Trump’s own stop in the Bay Area, where he raised campaign funds at a private event.

Obama said spending time on social media and focusing on how polls and media portray you can make it more difficult to run the country effectively.

“It creates a lot of noise and clouds your judgment,” Obama said. “You start mistaking the intensity or passion of a small subset of people with a broader sense of how a country feels – it will sway your decision in an unhealthy way.”

The comments mark a rare departure from Obama’s typical strategy of keeping quiet about the current administration. Obama has tended to eschew politics for media, including American Factory, a documentary he produced that was recently released on Netflix – and getting plenty of shuteye.

“I’m getting more sleep – so cheers to sleep,” he said. “It’s a drug, it’s magical.”

The former president also discussed misinformation campaigns, problems technology can solve, basketball, and his recent meeting with the young climate activist Greta Thunberg, whom he called “fascinating”.

Before wrapping up, Obama had another warning about social media’s impact. He said he was concerned about the division and polarization he thought was “accelerated” by the platforms.

“The degree to which everyone lives in a bubble of self-reinforcing hides and viewpoints, that’s not healthy for democracies and not healthy between countries,” he said. “But we can understand each other, and we all have a set of common hopes and dreams and impulses we can recognize in each other. And our survival depends on that.”