Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.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.051 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:Error': 0.07; 'operator,': 0.09; 'python': 0.11; 'algebra,': 0.16; 'assignment.': 0.16; 'equality.': 0.16; 'expressions;': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiers': 0.16; 'notations': 0.16; 'syntactic': 0.16; 'so.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'programming': 0.22; 'issue.': 0.22; 'mathematical': 0.24; 'fairly': 0.24; 'math': 0.24; '(or': 0.24; 'question': 0.24; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'words': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'arts': 0.31; 'comparison': 0.31; 'pascal': 0.31; 'stands': 0.31; 'problem': 0.35; 'equal': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'programming,': 0.36; 'similar': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'read': 0.60; 'expression': 0.60; 'most': 0.60; 'new': 0.61; 'course': 0.61; 'teaching': 0.64; 'more': 0.64; 'close': 0.67; '20,': 0.68; 'maths': 0.84; 'subject:Testing': 0.84; 'rusi': 0.91; 'whereas': 0.91; 'differences': 0.93; '2013': 0.98 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=y+t81XGUfzYpHaQ1ZwxWb6W+J2Pf70GIBOqyYUFxV+E=; b=cBM0GBN+UOeJPdHCmmCjdq5qTqibKEMbH3/t5yGtFlflHk3cNxvkLDOM9ymV+dl4MD pDLCcTb5L05zgcwlay7GWVm30e58Pl6EjIVebDdKZ1N4EFqj5Q50u/VjeDMslhgIMykO RiU6d1OLc+caBOu+4NMwlLB1geSZlWYfnE498YzdJHIm7dBrlptllU55pNXfROZz6MwD M0NfnUB6ALR/Sjw7Jv32xlK/a6B6+nu3euurefxQ6qsL6EVPIv+A85bQ90DlOsc6JPMa 89kVdrYilufFnvkybs6xxgM3rDF190xAtRT/HbQPYxmy8nRecKLEG94TYRlCcLtpblCL qE/w== MIME-Version: 1.0 X-Received: by 10.66.161.229 with SMTP id xv5mr10412592pab.87.1382221683896; Sat, 19 Oct 2013 15:28:03 -0700 (PDT) In-Reply-To: <9e734f2b-9bcd-47d8-adb9-de6501fa6e7d@googlegroups.com> References: <33549834-2f27-47f3-abea-eb3486909dec@googlegroups.com> <9e734f2b-9bcd-47d8-adb9-de6501fa6e7d@googlegroups.com> Date: Sun, 20 Oct 2013 09:28:03 +1100 Subject: Re: Error Testing From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382221693 news.xs4all.nl 15887 [2001:888:2000:d::a6]:59587 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57124 On Sun, Oct 20, 2013 at 3:22 AM, rusi wrote: > The problem is that python is an imperative language and uses the '=' sign for assignment. In math of course '=' stands for equality. Pascal tried to create a new operator, := to be read "becomes", to deal with the whole equality-vs-assignment issue. Did it really help anything? I don't think so. Just syntactic salt. Even the comparison isn't really mathematical - in maths, "x = y" is a statement of truth, whereas in programming, it's a question ("is x equal to y"). Teaching maths and programming at once is like teaching any other two arts at once - there'll be differences to grok as well as similarities to jump on. I would say that the expression evaluator in (almost) any modern language is a fairly close parallel to standard mathematical expressions; yes, abutting tokens is multiplication in algebra, but on the flip side, we don't use (or need) subscript to make multi-letter identifiers in code. Programming uses more words and less blackboard notations (compare abs(x) to |x| for example), but it's expressing things in fairly similar ways most of the time. ChrisA