Title: darage's Replies | WordPress.org

---

# darage

  [  ](https://wordpress.org/support/users/darage/)

 *   [Profile](https://wordpress.org/support/users/darage/)
 *   [Topics Started](https://wordpress.org/support/users/darage/topics/)
 *   [Replies Created](https://wordpress.org/support/users/darage/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/darage/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/darage/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/darage/engagements/)
 *   [Favorites](https://wordpress.org/support/users/darage/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Bad API](https://wordpress.org/support/topic/bad-api/)
 *  Thread Starter [darage](https://wordpress.org/support/users/darage/)
 * (@darage)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/bad-api/#post-511165)
 * Wow.. thanks all for the replies. I didn’t mean to insult anybody but i wrote
   the post in the most blunt manner to get the point across. the_categories() function
   is one example of a bad approach to an api design because it returns an unordered
   html list which is a clear mix between formatting and behavior. for example if
   i wanted to return the categories is a div list instead i have no choice but 
   to not use the the_categories() function.. but if the function just returned 
   a list of categories and left it for me to choose how to format the output it
   would’ve made it easier for me than using sql queries.
 * The sole function of a good api is provide reuse and hide implementation so that
   i don’t have to go the database and understand the data model in order to achieve
   what i want to do. Another principle it to facilitate reuse and flexibility which
   is not achieve by above function.
 * another thing, naming conventions are really poor. For example the_categories
   is a really bad name for the following reasons:
 * 1. why prefixing it with the? it doesn’t add any information no?
    2. function
   names should be verbs that explain what the functions do. for example get_categories()
   would’ve been a better function name (although im not a fan for underscores but
   that’s another issue). 3. it’s not obvious from the name that the function returns
   a formated list.. so maybe it should’ve been get_formatted_category_list(). of
   course it’s better that the function doesn’t return formatted output.
 * and so on and so forth.. i didn’t even go into how the parameters are constructed.
 * another bad naming is prefixing things with WP, why is that? it is absolutely
   unnecessary and i can’t find any reason for it.
 * for those who argued that the api is designed for non programmers. for me who
   esle is going to use an api other than a programmer?

Viewing 1 replies (of 1 total)