Path: csiph.com!news.swapon.de!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'that?': 0.05; 'semantic': 0.07; 'core,': 0.09; 'indexes': 0.09; 'received:gmx.net': 0.09; 'throw': 0.09; 'index': 0.13; 'do,': 0.15; 'alphabet': 0.16; 'anymore': 0.16; 'arrays.': 0.16; 'did,': 0.16; 'different,': 0.16; 'hint': 0.16; 'reason.': 0.16; 'wrote:': 0.16; 'language': 0.19; '>>>': 0.20; '(the': 0.22; 'arrays': 0.22; 'aspect': 0.22; 'assuming': 0.22; 'programming': 0.22; 'code.': 0.23; 'decide': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'example': 0.26; 'rest': 0.26; 'sense': 0.26; 'mathematical': 0.27; 'tend': 0.27; 'from:addr:gmx.com': 0.29; 'array': 0.29; 'normally': 0.30; 'position.': 0.30; "i'd": 0.31; 'probably': 0.31; 'another': 0.32; 'core': 0.32; 'language.': 0.32; 'problem': 0.33; 'choices': 0.33; 'languages': 0.34; 'quickly': 0.34; 'structure': 0.34; 'authors': 0.35; 'sometimes': 0.35; 'should': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'being': 0.37; 'expect': 0.37; 'say': 0.37; 'starting': 0.37; 'doing': 0.38; 'data': 0.39; "didn't": 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'easy': 0.60; 'your': 0.60; 'impact': 0.61; 'here.': 0.62; 'more': 0.63; 'different': 0.63; 'great': 0.63; 'fact,': 0.67; 'letters': 0.67; '99.9%': 0.84; 'advantages.': 0.84; 'air.': 0.84; 'balanced': 0.84; 'learn.': 0.84; 'apparent': 0.91 Date: Tue, 08 Sep 2015 14:05:59 +0100 From: Mario Figueiredo User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:25.7) Gecko/20150827 FossaMail/25.1.7 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python handles globals badly. References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55EE9EEC.1060907@rece.vub.ac.be> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:k9L2RVXAWTrBSe3HmKhFZd/kXr0OFMFwB+SPFFRGtZdxaJUL3m1 f8DNJe7J7yt3kdZ5iRAudMSSNrXkrpzJoIBp7UsDZ38fVKSXwWIgo2/w+llSylsM/qJ7bLZ KKAB6yUDt38IL6/lrS5SjvNZdzZJ+u3VQvFd/OoMHoQn0rLjs8rUq3GR4iRuE5lntrwEoZp kerCK7fOKkud83NeWy5bg== X-UI-Out-Filterresults: notjunk:1;V01:K0:1Rmq8EDiGZo=:7F/Twi0TfVDOi9CRFLeUlV lGvx8ux1g97+nZtwh+pxtq8lim3a50ymm7vjUxSgrA/6HF12o8SFNsFHbMC1IVtQuOVGgf6VC c/d6bGBjbN0w+q+InfxHbFMALihz4oMjEQptBfpFN77V41hqT2dOGonubI8wXByQF03sfCn57 gWsZ6B2cj6NMKPkPuQjbVgsca+FRtacRF7cM79PWNSwaANuxmF0EPu55D+stZr44Wpnkx1r+q tS39QWyS2CUjLfwuInB+65yG9HmYWhXyK48DcPJJsSnbtlqw6pwkkXzyipDjzFS5xWtyS4hx3 TLxeNHFvY3L7xOI1Bpyx3SwY27Vfx9zk5ty5N56QBGGuEdKik1yxH1YNFc5SBYnOnlhvgRfmu OOfIxb8m/tgbVevmD2nIBypfmeu54WBgGJqZNoQ0bh5FyeYiq4uf9Afvv8j9qUL9MMHFaAHCX 6pz9HysQRiuwQWF0QqTuNziUAZ0D1jY06zcMcJzMPda/PWYFeSAc+pVQTLrxIaFaYHvdRYd1W gJOqC1c5Nvy1BVBpIgpDUrXje+Oj8YSPLUHTQEEQKaOeNCeoaRaakfPVjFBVyodEtY4/knJN2 gQF9libGzZXhHunIAppRZMmoaKcxNiohKgeyeJ6R7V0ZLdKWFABRcINr+gJF1PSeuUg+rd/1J NqcoUyJvLLxjfWw1kmrL6+COah8iTjDRaYSGFm3fte3VfXMJUTfz1xrZkKwAVs0jyE44Zv1gh 4PHM5QfpHYSWIIZy0Ey26Rt91MGq6Q0ArHwSfA== X-Mailman-Approved-At: Tue, 08 Sep 2015 15:42:39 +0200 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: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441719760 news.xs4all.nl 23830 [2001:888:2000:d::a6]:48800 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96127 On 08-09-2015 12:55, Vladimir Ignatov wrote: >>> I had some experience programming in Lua and I'd say - that language >>> is bad example to follow. >>> Indexes start with 1 (I am not kidding) >> >> What is so bad about that? > > It's different from the rest 99.9% of languages for no particular reason. > > ( => perfect example of "design smell" => not a good example to follow) > Assuming that some programming language makes design choices "for no apparent reason" is your first hint you should probably reevaluate your position. People who design programming languages don't tend to throw coins to the air. Lua was based of a scientific language with a strong mathematical core, where 1-index arrays make more sense and are standard. The authors didn't expect for the language to become successful and by the time it did, you couldn't just change anymore such a core aspect of your language. 1-index arrays tend to be a problem in Lua, only for those people that don't normally program in Lua. Those that do, quickly learn to use them and they are not more difficult or easy to use than 0-index arrays. There is nothing inherently bad about 1-index arrays. They are just different, with some of the disadvantages being balanced by some of its advantages. And there either no design smell here. From the perspective of the language user (the programmer), the choice of the starting index of an array should have no impact on their ability to code. It's just another semantic aspect of the language they should learn. No different than having to learn other semantic nuances of each particular language. In fact, a great language is the one that offers the ability for the user to decide what starting index they want to use. Depending on the data structure a user sometimes is better served by a 0-index array, others by a 1-index array, and if you are doing an array with the letters of the alphabet you would love to have an array starting at 'a'.