{"id":256,"date":"2005-05-26T10:07:33","date_gmt":"2005-05-26T16:07:33","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=256"},"modified":"2005-05-26T10:07:33","modified_gmt":"2005-05-26T16:07:33","slug":"dropping-the-com-from-package-names","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/256","title":{"rendered":"Dropping the .com from package names"},"content":{"rendered":"<p>Dion <a href='http:\/\/www.almaer.com\/blog\/archives\/000956.html'>wonders whether you need fully qualified package names<\/a> on your java packages.  For instance, is code that I write with this package declaration: <code>package com.mooreds.foo;<\/code> that much better than <code>package mooreds.foo;<\/code>?<\/p>\n<p>Given that there are no other mooreds MLDs (from a search at network solutions):<\/p>\n<blockquote><p>\n\tmooreds.net is available.<br \/>\n\tmooreds.org is available.<br \/>\n\tmooreds.info is available.<br \/>\n\tmooreds.tv is available.<br \/>\n\tmooreds.us is available.<br \/>\n\tmooreds.cc is available.<br \/>\n\tmooreds.name is available.<br \/>\n\tmooreds.bz is available.<br \/>\n\tmooreds.co.uk is available.<br \/>\n\tmooreds.de is available.<br \/>\n\tmooreds.be is available.<br \/>\n\tmooreds.co.nz is available.<br \/>\n\tmooreds.at is available.<br \/>\n  \tmooreds.com is unavailable.\n<\/p><\/blockquote>\n<p>I think the answer is that it doesn&#8217;t matter very much right now.  And the chances of it mattering in the future are slim.  I&#8217;d have to write some code with the same classname as another &#8216;mooreds&#8217; packager, and want to import that code.  Improbable, but possible.  And if this situation arose, I&#8217;d have to rename my class, use a different package name (after all, packages don&#8217;t have to be meaningful) or use a different class.  <\/p>\n<p>What are the benefits of leaving off the <code>com.<\/code> declaration?  Well, it saves everyone who wants to use it four characters of typing per import (those who don&#8217;t use auto importers).  <em>Four<\/em> characters! <\/p>\n<p>So, it&#8217;s safe to say that <code>package mooreds.foo;<\/code> and <code>package com.mooreds.foo;<\/code> probably won&#8217;t hurt anything, but given the cost benefit analysis, I can&#8217;t see why anyone wouldn&#8217;t use the full package declaration: <code>package com.mooreds.foo;<\/code> .<\/p>\n<p>Now, if someone is using a domain they don&#8217;t own, well, that&#8217;s just braindead.  15$ and a credit card will get you a domain name.  If you can&#8217;t afford that, then choose a TLD of your own creation; <code>package lalala.mooreds.foo;<\/code> won&#8217;t collide with anyone who is following the spec, and has an even smaller chance of colliding with someone who isn&#8217;t than just dropping the TLD.  <\/p>\n<p>In a different vein, I used to give an unusual name for restaurant waitlists, but oftne when they called out &#8216;Archibald&#8217; I wasn&#8217;t attuned to it like I was to &#8216;Dan&#8217; and more often than not, I missed my seating.  Similarly, if you use a domain that someone else owns as your package name, well, you&#8217;re looking for trouble that you don&#8217;t really need to.  I mean, really, isn&#8217;t software hard enough?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dion wonders whether you need fully qualified package names on your java packages. For instance, is code that I write with this package declaration: package com.mooreds.foo; that much better than [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-256","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=256"}],"version-history":[{"count":0,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/256\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}