Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Considering migrating to Python from Visual Basic 6 for engineering applications Date: Mon, 22 Feb 2016 00:54:06 +1100 Lines: 52 Message-ID: References: <90cc50d2-1ce5-4588-9bfd-a49d439f00dd@googlegroups.com> <14c75a68-0d2e-45cc-8d73-0d71b6a6aea6@googlegroups.com> <9e57761f-26e1-41c5-8e71-23800de1fdd3@googlegroups.com> <7f9c473e-b0c2-4d77-91d1-d0733c93b12d@googlegroups.com> <23d8156f-1808-4395-9c04-27d2984fe67c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 9uHH+7akNc/DmtyRYniT7wU5Ft+2rg+uTSkc31FMuqGQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'subject:Python': 0.05; 'float': 0.05; 'needed,': 0.05; 'append': 0.07; 'cc:addr:python-list': 0.09; '22,': 0.09; 'integer,': 0.09; 'subject:Visual': 0.09; 'python': 0.10; 'output': 0.13; 'read.': 0.13; 'syntax': 0.13; 'subject: \n ': 0.15; 'value.': 0.15; '(there': 0.16; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'parameters,': 0.16; 'personally,': 0.16; 'pythonic': 0.16; 'readable': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sign.': 0.16; 'thread.': 0.16; 'way;': 0.16; 'wrote:': 0.16; 'string': 0.17; ';-)': 0.18; 'accepting': 0.18; 'input': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'imposed': 0.22; 'parameter': 0.22; 'pass': 0.22; 'programming': 0.22; 'am,': 0.23; 'feb': 0.23; "python's": 0.23; 'this:': 0.23; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'parameters': 0.27; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'defining': 0.27; 'function': 0.28; 'values': 0.28; 'another.': 0.29; 'larry': 0.29; 'anywhere': 0.30; 'classes': 0.30; 'code': 0.30; 'anyone': 0.32; "can't": 0.32; 'limitations': 0.33; 'that,': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'quite': 0.35; 'but': 0.36; 'needed': 0.36; 'received:209.85': 0.36; 'possible': 0.36; 'basic': 0.36; 'subject:: ': 0.37; 'starting': 0.37; 'received:209': 0.38; 'subject:from': 0.39; 'still': 0.40; 'called': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.62; 'making': 0.62; 'more': 0.63; 'information': 0.63; 'between': 0.65; 'equals': 0.66; 'obvious': 0.76; 'as:': 0.79; 'chrisa': 0.84; 'clearer': 0.84; 'distinguish': 0.84; 'to:none': 0.91 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:cc :content-type; bh=4ZT6Ro/AGjMB8RXo6dDnq2QARaMJXG79+KsL5uR2nV0=; b=yP6boVfzdo2/29rGexk3JJICwMbBZZv1DUiwku1g+i3MRvpnZPvHT4g9HBFlJv7R6+ WCyCA9eyC9m3lTPQWrXE7XMflQYRS7eSsqWKyFpSCyt3VBsWOSa6RAGST7pa1N+ED28V TkCCThboAJwGOcPgBFfn71p4qA2loqXakc946NtqUo4WbLsZSx4yjMe0USrbdXgsLHC9 1Uh5XtgNbcTGgVzUbFMjCvjyE+2oGbV6iX0QEPboMVPc1O4UNYbRlpKFZoxaGQRgLC6W m4sJq/SoEZ3SZ3nBOclokuYu2VHs0WgCWwhFl+Pk8uwFLan/dbJXVTVyZvfiDaiUfPtR tkNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=4ZT6Ro/AGjMB8RXo6dDnq2QARaMJXG79+KsL5uR2nV0=; b=Hn71roBJLep5ZZ+2m7stdTiNhT3yMpA8nZBGmtmYBF035NMTUi7ZZqxbC+RzDmuTIL 0b1QXhR1r3Xym9l43MSMjYIFb6jdr0wKHCfNh3PqPFHIexjOkffJNSO8KxJ1LtNpu1z9 GDHeg+BgeC1iu7n75b0v/kYZTG7XWVSPK84vI9ojb1Mc/d1c6KDk4tk7Rum7UEZxUJoo BVJmOpypqthLu1iqb+A3PymXq0SZY/U6oml1L8y7XuWz+EeOtRP8I2pem/CR84kDS9ad WNPpjwouWYUigb/Qpnbed733mherjLiK/AtVjIYA+5jy8B3GDYJYSef1i37Edy1TpHxQ DWBw== X-Gm-Message-State: AG10YORZDZKcGf7nPIUxA6oaSh7HkmTgnYCpsg7F7dzfMVkvVY2JfwgVRIALmxyqVNLDyw8n01N9CYJ8nXGyOw== X-Received: by 10.107.47.162 with SMTP id v34mr21761200iov.19.1456062846516; Sun, 21 Feb 2016 05:54:06 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 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:103289 On Mon, Feb 22, 2016 at 12:16 AM, BartC wrote: > On 21/02/2016 07:28, Larry Hudson wrote: >> >> On 02/20/2016 10:38 AM, wrong.address.1@gmail.com wrote: > > >>> Or can I write my own reading subroutines which can then be called like >>> ReadVBstyle 8, ND, NIN, NT >>> to make the code more readable? > > >> ABSOLUTELY!! Most Python programming consists of defining the functions >> and classes needed, which definitely makes Python more readable. > > >> No need for anyone to re-invent the >> wheel! ;-) > > > I keep seeing this in the thread. Python has all this capability, yet it > still requires a lot of fiddly code to be added to get anywhere near as > simple as this: > > read f, a, b, c > > And this is code that is not going to be obvious to anyone starting out. > Even accepting that syntax limitations might require this to be written as: > > readline(f, a, b, c) > > I can't see a straightforward way of making this possible while still > keeping a, b and c simple integer, float or string types (because Python's > reference parameters don't work quite the right way). How about: a, b, c = readline(f) > (There is also the question of 'readline' knowing what types of values to > read. This information would not be needed in Fortran or Basic but somehow > needs to be supplied here, if a particular set of types is to imposed on the > input.) You'd still need to solve that, one way or another. But the Pythonic way is to distinguish between "input" and "output" parameters by having the input parameters as parameters, and the output parameters as the return value. And personally, I find it *way* more readable that way; while it's perfectly possible to pass a list as a parameter and have the function append to it, it's much clearer if your return values are on the left of the equals sign. ChrisA