What is the correct way to phrase this?

Solution 1:

I suggest

diverse topics including programming, cooking, photography and gaming.

or perhaps

diverse topics including photography, programming, cooking, gaming.

Using such as rather than including would ask the reader to extrapolate from four disparate topics to other topics. Such extrapolation may be inaccurate. Not having a comma in photography and gaming may lead to confusion about whether you regard photography and gaming as two topics or one.

The form from X to Y to Z may be used effectively when a spectrum or continuum ranges from X, through Y, to Z. Using that form with several incomparable elements is wrong if you merely mean to list several elements, rather than giving a puzzling or comic effect. The form from X to Y and Z again suggests a range, this time from X to implicitly-equated Y and Z.

Solution 2:

"...diverse topics from software programming to cooking to photography to gaming."

Your "and" only makes sense of "photography and gaming" is a single unified topic for some reason, and it's awkward even then.

Solution 3:

I would rewrite this as

diverse topics such as software programming, cooking, photography and gaming.