Support » Developing with WordPress » RFC: A professional WordPress API

  • I really had to lough when I read about ‘coding guidelines’ on these pages! Have the makers of WordPress ever seen a real API? ALL constants, variables and methods of the system should have a unique prefix (such as ‘wp_’ for example) in order to have separated namespaces. (They did it with the db table names, so why this mess in PHP?)

    Otherwise it’s quite likely to happen that someone overwrites an internal WordPress variables/methods when developing more complex themes. Other solution would be to encapsulate the whole WordPress-thingy in a class (yes, a bit like $wpdb) and ONE single, global instance provides all methods/data. Would be a much cleaner interface imho.

    If ‘code is poetry’ it should be self-explanatory and there shouldn’t be a need for so many (confusing) docs which are aiming at varying audiences (devs? designers? just bloggers in general?).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you tried Habari? 🙂

    jnt72: This is nonsense.

    The DB tables are prefixed because this allows having tables for more than one application in one database. It is merely a bonus for people who have limited hosting ressources.

    The PHP functions/variables/etc. don’t have to be prefixed, as those descriptors don’t collide with other applications. And it’s up to the theme/plugin authors to prefix their descriptors, as they write code based on the core system.

    Other solution would be to encapsulate the whole WordPress-thingy in a class (yes, a bit like $wpdb) and ONE single, global instance provides all methods/data. Would be a much cleaner interface imho.

    Go home, kid.

    Comments, suggestions and discussion about WP’s core code would be better directed at the wp-hackers mailing list:

    http://lists.automattic.com/mailman/listinfo/wp-hackers

    LesBessant: I agree, but I just couldn’t leave that first post uncommented.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘RFC: A professional WordPress API’ is closed to new replies.