{"id":61,"date":"2006-12-01T13:58:17","date_gmt":"2006-12-01T21:58:17","guid":{"rendered":"http:\/\/simplepie.org\/blog\/2006\/12\/01\/more-on-method-names\/"},"modified":"2013-05-15T03:16:29","modified_gmt":"2013-05-15T11:16:29","slug":"more-on-method-names","status":"publish","type":"post","link":"https:\/\/simplepie.org\/blog\/2006\/12\/01\/more-on-method-names\/","title":{"rendered":"More on Method Names"},"content":{"rendered":"<div xml:lang=\"en-GB\">\n<div class=\"blogimage\"><img decoding=\"async\" src=\"\/images\/128\/designer.png\" alt=\"Designer\" \/><\/div>\n<p>A month or two ago, we ran a poll with three options: drop <code>get_<\/code> from method names, add <code>set_<\/code> to others, or leave it as is. The result was overwhelmingly for the second option, adding <code>set_<\/code>.<\/p>\n<p>One month ago, I changed the methods that directly interact with the SimplePie class. This proved controversial, despite the fact people writing PHP <em>really<\/em> should know that development code should <em>not<\/em> be relied upon, knowing that it may not work, or break backwards compatibility without warning. There&#8217;s been various <del>discussions<\/del> <ins>arguments<\/ins> about whether other verbs (such as enable) should be used in some of the method names. Anyone got any thoughts?<\/p>\n<p>The second issue is to do with SimplePie_Item::get_description(). If we&#8217;re to have two methods &#8211; one that gets the description, and another that gets the content (or description, if that doesn&#8217;t exist), what should the methods be called? I&#8217;m in favour of the description method being SimplePie_Item::get_description() and the content method being SimplePie_Item::get_content(), thereby breaking backwards compatibility; however, I&#8217;m open to suggestions.<\/p>\n<p>Lastly, anyone interested in mailing lists, for either announcements or support?<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A month or two ago, we ran a poll with three options: drop get_ from method names, add set_ to others, or leave it as is. The result was overwhelmingly for the second option, adding set_. One month ago, I changed the methods that directly interact with the SimplePie class. This proved controversial, despite the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-simplepie"],"_links":{"self":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":1,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}