Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Is vars() the most useless Python built-in ever? Date: Tue, 1 Dec 2015 22:48:57 -0600 Lines: 78 Message-ID: References: <565cf141$0$1612$c3e8da3$5496439d@news.astraweb.com> <4f0f7fc5-c93a-4223-9c05-e192a8fafbbd@googlegroups.com> <565d5282$0$14486$c3e8da3@news.astraweb.com> <11a610aa-41d8-433c-b36b-e23ba4d83243@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de pY8qX8GrulKAd1LPh5DXJwhWyNPEGOoAyMXXmmDMdpbQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'subject:Python': 0.05; 'context': 0.05; 'inspired': 0.05; 'means,': 0.07; 'beginners': 0.09; 'scripting': 0.09; 'stdout': 0.09; 'underlying': 0.09; 'python': 0.10; 'output': 0.13; 'result.': 0.15; '"hello': 0.16; 'code?': 0.16; 'describing': 0.16; "guido's": 0.16; 'hypothetical': 0.16; 'means.': 0.16; 'method;': 0.16; 'ponder': 0.16; 'processes.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:ever': 0.16; 'subject:most': 0.16; "where's": 0.16; 'wrote:': 0.16; 'string': 0.17; 'beginner': 0.18; '>': 0.18; 'email addr:gmail.com>': 0.18; 'language': 0.19; 'student': 0.20; '2015': 0.20; 'do.': 0.22; 'next,': 0.22; 'dec': 0.23; 'header:In- Reply-To:1': 0.24; 'example': 0.26; 'room': 0.27; 'message- id:@mail.gmail.com': 0.27; 'experiences': 0.27; 'print': 0.30; 'code': 0.30; 'somebody': 0.30; 'writes': 0.30; 'another': 0.32; "can't": 0.32; 'december': 0.32; 'language.': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'clear': 0.35; 'identified': 0.35; 'but': 0.36; 'skip:i 20': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'to:addr:python- list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'skip:& 10': 0.37; 'expect': 0.37; 'method': 0.37; 'turn': 0.37; 'itself': 0.38; 'no,': 0.38; 'received:209': 0.38; 'minimum': 0.38; 'does': 0.39; 'subject:the': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'called': 0.40; 'your': 0.60; 'engine': 0.62; 'here.': 0.62; 'our': 0.64; 'between': 0.65; 'trail': 0.66; 'skip:\xc2 10': 0.67; 'manner': 0.69; 'teaching': 0.69; 'teach': 0.70; 'book,': 0.72; 'drivers': 0.72; 'discover': 0.73; 'productivity': 0.81; 'bread': 0.84; 'hood': 0.84; 'intuit': 0.84; 'temperature,': 0.84; 'to:name:python': 0.84; 'abc': 0.91; 'oem': 0.91; 'on?': 0.91; 'rank': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pV4rexGHWZONC/7D69ZFzRnKWlVbX3vYI9n/s7hfI+A=; b=m7lrXx5qEEx6d8UnTvT/kVE3mSrPkGFyO8qM0FIB0ik3f0YhC/5tmsoHIRhJr4u0OJ J78dTaHRaidgDD35zqxmRD3iCpiiw/w+QH45LdO6uq5V280de6mHOsdheTF8nM9/2CD7 lx1DsEJlM725ZWFZSIskVypgJ03oBOIP9LRWesGQfl/dnFwE4X+f6S2eG2CjBIsLLhV+ VThnrJCNjOTFiRa2BQwKrTg51h8GhpqwCL4HbrRYnSYC/3RhmQA21rKFYQYNLfSByl3L dvngeohaWkslgsBWPbhy6LVnf1pekeYtxusd8wOW4tW7bTSQMid82qetlMGXEH8eCbvF dAVw== X-Received: by 10.107.137.226 with SMTP id t95mr1770946ioi.188.1449031737692; Tue, 01 Dec 2015 20:48:57 -0800 (PST) In-Reply-To: <11a610aa-41d8-433c-b36b-e23ba4d83243@googlegroups.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99845 On Dec 1, 2015 1:36 PM, "Rick Johnson" wrote: > > On Tuesday, December 1, 2015 at 1:55:59 AM UTC-6, Steven D'Aprano wrote: > > Python was never intended to be "merely" a teaching language. I think > > Guido's original vision was for it to be a glue language between C > > libraries, and a scripting language. > > It's a well know fact that GvR was inspired to create Python from his experiences working with a language called ABC -- and ABC was designed *EXCLUSIVELY* to be a beginners language. Which is exactly what made ABC itself unsuitable for Guido's purpose, which was to create an *applications* language with better productivity than C to support users of Amoeba, the OS that he was working on at the time. > I am not arguing that "abstractions are evil", no, my position is that abstractions must be constructed in a manner that provides a clear trail of bread crumbs which lead to the underlying processes. With print, not only is the engine in another dimension, but the hood is as well! How is a noob to discover the engine when he cannot find the hood? > > Ponder the following example code (as a noob!): > > stdout.write("Dude, i found my car, the hood, and the effing engine!!!") > > Even a noob can intuit what is going on here. First we have an *OBJECT* named "stdout, and we can extrapolate that stdout is an abbreviation for StandardOutput. Next, we see a method called "write", and, if our IQ is above room temperature, then we can extrapolate what that method will do. This is absurd. You postulate a beginner so rank that they can't understand what "print" means, yet you expect them to intuitively know: 1) what an object is; 2) what a method is; 3) that a method is identified by placing a period between the object and the name of the method; 4) what "output" is in the context of programming; 5) and not be confused about what makes the output "standard". > Now ponder this code (as a noob!): > > print("Dude, where's the intuitiveness?") > > What the heck does print do? Where will the string go after i execute this line of code? Should i turn my printer on? Should i check my ink levels? And what OEM drivers are required? You're describing this as if your hypothetical beginner were learning Python in a vacuum. In reality, people learn from a teacher, or a book, or at minimum a tutorial. Here's how you teach somebody what "print" does: instruct them to type print("hello world") at the interactive prompt. Note that Python writes "hello world" as a result. If they really want, they can check their printer and see that nothing came out. That's it. The student now understands what "print" means.