Source: /cirosantilli/sponsor/updates/8/list-topics-on-home-page

= List topics on home page

The new default homepage for a logged out user how shows a list of the topics with the most articles.

This is a reasonable choice for default homepage, and it immediately exposes users to this central feature of the website: the topic system.

Doing this required in particular calculating the best title for a topic, since it is possible to have different titles with the same ID, the most common way being with capitalization changes, e.g.:
would both have topic ID `javascript`.

With this in place we also added the preferred topic title to the top topic page.

The algorithm chosen is to pick the top 10 most upvoted topics, and select the most common title from amongst them. This should make topic title vandalism quite hard. This was made in a single <SQL> query, and became the most complext SQL query <Ciro Santilli> has ever written so far:

{title=Screenshot showing the list of topics}
{description=The page is:[] for the logged out user,[] for the logged in user.}

{title=Screenshot showing a topic page}
{description=The page is:[]. Before this sprint, we didn't have the "Vector Space" at the top, as it wasn't necessarily trivial to determine what the preferred title would be.}