The essence of both patent and copyright is that a creator/inventor gets legal protection and exclusivity within broad limits, in exchange for some form of publication/public disclosure. Similarly a patent is invalid if prior art exists, but only if the prior art meets certain criteria.
Clearly, putting ones book on amazon or ones own website, suffices for copyright, and putting the design on ones website suffices for prior art, to prevent someone else patenting the same implementation of an idea. Equally, if not published (the creator keeps it secret, doesn't show or tell others), then copyright doesn't begin or run.
But what counts as publication/disclosure for these purposes? Suppose a creator doesn't want to publicise something (a work or implementation), but wants to gain the protection allowed by law. What could they do to minimise actual public knowledge in detail, without being considered to have not actually published?
Examples to give an idea (not limited to these, just off the top of my head): suppose they publish the implementation details in a very obscure language, or on a website that is public but has no links from elsewhere on the web, or is briefly published then removed (and was not indexed on web searches while publicised), or only one copy is sold, and that sold via an outlet that means it's unlikely to really be read, or just 100 copies are sold, but all burned on purchase, or...?
I appreciate the answer will be different for copyright and patent, I'm interested in both really, as the question seems applicable to both.