Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'causing': 0.04; 'c++,': 0.07; 'context': 0.07; 'definitions.': 0.07; 'correct,': 0.09; 'exception.': 0.09; 'hiding': 0.09; 'historically': 0.09; 'oop': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'slices': 0.09; 'thread': 0.14; 'useful,': 0.14; '2001,': 0.16; 'dismiss': 0.16; 'distinct': 0.16; 'finney': 0.16; 'hits': 0.16; 'hopper': 0.16; 'programmer,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'community,': 0.19; 'pointed': 0.19; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'refers': 0.24; 'java': 0.24; 'people,': 0.24; 'nearly': 0.26; 'header:X -Complaints-To:1': 0.27; 'especially': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'writes:': 0.31; 'yes.': 0.31; 'programmers': 0.33; 'reader': 0.33; 'something': 0.35; 'definition': 0.35; 'etc.)': 0.35; 'operate': 0.35; 'really': 0.36; 'subject:?': 0.36; 'clear': 0.37; 'ben': 0.38; 'whatever': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'most': 0.60; "you're": 0.61; 'first': 0.61; 'act': 0.63; 'information': 0.63; 'term': 0.63; 'such': 0.63; 'field': 0.63; 'more': 0.64; '(that': 0.65; 'skip:\xe2 10': 0.65; 'worth': 0.66; 'money': 0.72; 'advertising': 0.74; 'increase': 0.74; 'million': 0.74; 'other.': 0.75; 'sale': 0.75; 'article': 0.77; 'bundling': 0.84; 'humanity': 0.84; 'subject:skip:E 10': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Encapsulation unpythonic? Date: Mon, 02 Sep 2013 09:32:16 +1000 References: <8255dfbd-a2a1-4ab7-b900-ee19faa459f2@googlegroups.com> <8c7c4854-70e1-46e7-a3ff-a3206c4c5c27@googlegroups.com> <5221567b$0$6599$c3e8da3$5496439d@news.astraweb.com> <5221d7ab$0$6599$c3e8da3$5496439d@news.astraweb.com> <5222f675$0$6599$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:6+BqHMO3yHYDFg0F8+/ZdcKqZ4A= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378078348 news.xs4all.nl 15980 [2001:888:2000:d::a6]:57483 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53440 Steven D'Aprano writes: > […] programmers have been using the *principle* of encapsulation since > before Grace Hopper was an admiral. […] > Encapsulation and information hiding are distinct things -- you can > have one without the other. […] > One of the most obnoxious and annoying traits of OOP zealots, > especially academics, is that they act as if programming did not exist > before Java and C++, or if you're really lucky, Smalltalk. (Somehow > they nearly always forget about Simula.) Yes. That's something which has been pointed out to such people, even in the Java community, for most (all?) of Java's history. Here's a JavaWorld article from 2001, by a Java programmer, with the clear title “Encapsulation is not information hiding”: Encapsulation refers to the bundling of data with the methods that operate on that data. Often that definition is misconstrued to mean that the data is somehow hidden. (That site unfortunately slices up the article into many pages to increase advertising hits and reader frustration, my apologies.) One of the more annoying traits of humanity is that whatever context we first encounter a term is disproportionately privileged, causing us to irrationally dismiss better (more useful, more reasonable, more pedagogically appropriate, more historically correct, etc.) definitions. This thread is an excellent illustration that the field of programming is no exception. -- \ Moriarty: “Forty thousand million billion dollars? That money | `\ must be worth a fortune!” —The Goon Show, _The Sale of | _o__) Manhattan_ | Ben Finney