Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Mon, 25 Jul 2016 05:00:28 +1000 Lines: 82 Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de OVadz2zaSkT64lpsIJ/RBAh3uSjAH8Js5JuTIW0GlYdQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'warnings': 0.03; '#include': 0.07; 'default.': 0.07; 'main()': 0.07; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'argument,': 0.09; 'subject:Why': 0.09; 'python': 0.10; 'subject:not': 0.11; 'syntax': 0.13; 'argument': 0.15; '"use': 0.16; '--help': 0.16; '-o2': 0.16; '-wall': 0.16; '2016': 0.16; 'bounds': 0.16; 'compilers': 0.16; 'delimit': 0.16; 'did.': 0.16; 'editor,': 0.16; 'emit': 0.16; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'italian': 0.16; 'mercurial,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:{ 30': 0.16; 'subject:allow': 0.16; 'wait.': 0.16; 'wrote:': 0.16; 'language': 0.19; 'windows': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'saying': 0.22; "aren't": 0.22; 'gcc': 0.22; 'ok.': 0.22; 'am,': 0.23; 'third-party': 0.23; 'plain': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; "doesn't": 0.26; 'rest': 0.26; 'right.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'restrict': 0.27; 'function': 0.28; 'looks': 0.29; '(maybe': 0.29; 'cat': 0.29; 'obscure': 0.29; 'screen.': 0.29; 'sure,': 0.29; 'array': 0.29; 'themselves': 0.29; 'system,': 0.30; 'you?': 0.30; 'code': 0.30; 'becomes': 0.30; 'skip:[ 10': 0.31; 'guess': 0.31; 'everyone': 0.31; "can't": 0.32; 'says': 0.32; 'ideal': 0.32; 'getting': 0.33; 'point': 0.33; 'choosing': 0.33; 'int': 0.33; 'smart': 0.33; 'running': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'conditions.': 0.35; 'installing': 0.35; 'something': 0.35; 'sometimes': 0.35; 'but': 0.36; 'there': 0.36; 'tool': 0.36; 'possible': 0.36; 'tools,': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'expect': 0.37; 'there,': 0.37; 'things': 0.38; 'version': 0.38; 'stuff': 0.38; 'someone': 0.38; 'why': 0.39; 'format': 0.39; 'does': 0.39; 'rather': 0.39; 'where': 0.40; 'field': 0.60; 'him': 0.60; 'save': 0.60; 'care': 0.60; 'your': 0.60; 'real': 0.62; 'matter': 0.63; 'money.': 0.63; 'more': 0.63; 'week,': 0.64; 'subscript': 0.66; 'choose': 0.68; "today's": 0.69; 'jul': 0.72; 'power': 0.72; 'quality': 0.72; 'life.': 0.81; 'hand': 0.82; 'chrisa': 0.84; "else's": 0.84; 'etc,': 0.84; 'forced': 0.84; 'princess': 0.84; 'ram,': 0.84; 'virtue': 0.84; 'to:none': 0.91; 'wait,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc :content-transfer-encoding; bh=S1knEUAahlceUr2sRykz5k1ndYC9wPjVithfSTE662Y=; b=yfulgu1TwMax2mAYv4/uG5S2X2LcNgKLHTX1vuX3lRvhlv/rUZc9ozkk9hBatvJFbh ihKWxs9A+UA8NPmsYoxMJQPKD/Yso7cuNqqmD/W77SFH18+hDDrYY7BfDdjYYyFbZf3A 2ImyrJ5ubG+8wTLZNTAY5XwE08rAeJhpxmGtC4zaNI8W1RsFfZOCGw2eVsih6DLp10V8 4XjdcUWAIdTnAd8Bk7QC3kaEURgm7hM9Q5aLivqWZ9GCQwAfFAUeCIRfbQ+2zBnzKKDJ r9UPE7wTzg/xGoSiyPxpoe8AxV+Wi6MHQpcOHzEQsJ5iJADW5GhBIRyO7fKWEtcYwcdQ hSPQ== 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:from:date :message-id:subject:cc:content-transfer-encoding; bh=S1knEUAahlceUr2sRykz5k1ndYC9wPjVithfSTE662Y=; b=ir19em+AipC8b2yHjs61B1euTZZt8lgJMDNKECLHgEqmgpm2pPd+q/qHKg+j1T0Pfq IWdBBiunVVLEE81XsmfRjZzELppCrJHD2DdJ16KyFVtAFGyxQGrh4YLMx+9mwz9RcEkr evnPMB+R0un3sIWaguBy9GvlB9/Q0tbwpeoRTqokh7zbT6u9wMp+t5Hj30pvgzZ3oYa5 CknyezdivNGDpv4OUDh5dsFJlonjpfvZtVBZ8qSMFvS0YwAW3baGGxyNa6gtlr7pfz/n DNxR8TbGO58F544MZtqG3ktaKCCtFrouIPj5tbE5AowkN1buT+I3S28RF2qPeZNq5o1G w2JA== X-Gm-Message-State: AEkoouvGGWFbQBfe4A8TeZUP5kA3BEAQUUWLKfZH3Qc9G1uLFkSS0A09OnaLJDGd2bEpMb3WjngLKxIfk3hjgA== X-Received: by 10.28.142.135 with SMTP id q129mr15659759wmd.41.1469386829651; Sun, 24 Jul 2016 12:00:29 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:111821 On Mon, Jul 25, 2016 at 4:14 AM, BartC wrote: > OK. I understand that it is not possible to point out any kind of weaknes= s > of a language (any language not just Python!) because the counter-argumen= t > is always going to be about: > > Use syntax highlighting, use a smart editor, use a version control system= , > use a linter, use 'tabnanny', use tool X, Y or Z to get around the proble= ms, > use obscure language options.. Obscure? I guess - it's not like it's listed in the --help screen. Oh wait. And of course, all you need to do is upgrade to Python 3 and it becomes the default. Wait, you lump "use a VCS" into the category of "stuff people tell you that you're not really willing to do"? Are you saying you don't use git, Mercurial, etc, etc, to track your projects? Then start using one. Now. "Now-now", as Princess Anna says in the Italian dub. > The thing is, if everyone does depend more on such tools, then it really > doesn't matter exactly what the language does - the tools will take care = of > such details. So the language could delimit blocks using any scheme it > likes, including use 'end', 'else' and so on. > > It only becomes important to people like me who use plain editors. Yes, that's exactly right. Tell me, is this part of a linter or a language compiler/interpreter? rosuav@sikorsky:~$ cat 1.c #include int main() { int months[12] =3D {31,28,31,30,31,30,31,31,30,31,30,31}; printf("The array is at %p.\n", months); printf("There are %d days in December.\n", months[12]); printf("And this is what 28 looks like: %s\n", months[1]); } rosuav@sikorsky:~$ gcc -Wall -O2 1.c 1.c: In function =E2=80=98main=E2=80=99: 1.c:7:9: warning: format =E2=80=98%s=E2=80=99 expects argument of type =E2= =80=98char *=E2=80=99, but argument 2 has type =E2=80=98int=E2=80=99 [-Wformat=3D] printf("And this is what 28 looks like: %s\n", months[1]); ^ 1.c:6:2: warning: array subscript is above array bounds [-Warray-bounds] printf("There are %d days in December.\n", months[12]); ^ rosuav@sikorsky:~$ Today's C compilers emit warnings for things that yesterday's third-party linters did. Is there virtue in running gcc with all warnings disabled? Equally, is there a valid reason for choosing to use a "plain editor" when you could use one that helps you? A skilled craftsman in any field will choose to use quality tools. They save time, and time is money. Are there any carpenters who restrict themselves to hand tools? (Stylistic choice aside. KirkwoodWorking has "hand tools Sunday" where he avoids all power tools, and it's taking him months and months to finish one cabinet. But the rest of the week, power tools win.) Would you, if given the choice, use an ancient 80386 running MS-DOS in 4MB of RAM, or a modern system running a modern OS in 16GB? Would you type your code on a tablet computer or something with a real keyboard? So why do you use "dumb editor" as a line of argument, rather than getting a smarter editor? I don't have a lot of sympathy for people who use suboptimal tools and expect everything to work for them. Sure, sometimes you're forced to use something less than ideal (maybe you're stuck on someone else's Windows box and good tools simply aren't there, and you can't go installing a ton of stuff just to get started), but then you KNOW you're working in bad conditions. You don't make that your normal life. ChrisA