Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'example:': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'static': 0.04; 'compiler': 0.07; 'dynamically': 0.07; 'alain': 0.09; 'comment,': 0.09; 'lawrence': 0.09; 'prevents': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'def': 0.12; 'language.': 0.14; '"python': 0.16; 'on"': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'junior': 0.24; '---': 0.24; 'developers': 0.25; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'easier': 0.31; 'lines': 0.31; '>>>>': 0.31; 'writes:': 0.31; 'skip:m 30': 0.32; 'becomes': 0.33; 'guess': 0.33; 'info': 0.35; 'hundreds': 0.35; 'in.': 0.36; "i'll": 0.36; 'too': 0.37; 'two': 0.37; 'list': 0.37; 'easily': 0.37; 'to:addr :python-list': 0.38; 'does': 0.39; 'flow': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'referred': 0.60; 'free': 0.61; 'gone': 0.61; 'managers': 0.61; 'new': 0.61; 'viruses': 0.61; 'simply': 0.61; 'protection': 0.63; 'our': 0.64; 'map': 0.64; 'believe': 0.68; 'antivirus': 0.68; 'anything.': 0.68; 'lose': 0.68; 'quality': 0.72; 'subject:This': 0.74; 'enforces': 0.84; 'or:': 0.84; 'safety.': 0.84; 'serious': 0.97 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: OT: This Swift thing Date: Thu, 05 Jun 2014 23:13:00 +0100 References: <8738fjkc2w.fsf@dpt-info.u-strasbg.fr> <87tx7zi0i1.fsf@dpt-info.u-strasbg.fr> <87y4xbt447.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-20-79.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <87y4xbt447.fsf@elektro.pacujo.net> X-Antivirus: avast! (VPS 140605-0, 05/06/2014), Outbound message X-Antivirus-Status: Clean 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: 77 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402006397 news.xs4all.nl 2865 [2001:888:2000:d::a6]:58250 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72774 On 05/06/2014 22:53, Marko Rauhamaa wrote: > Mark Lawrence : > >> On 05/06/2014 21:07, Alain Ketterlin wrote: >>> Sturla Molden writes: >>>> On 05/06/14 10:14, Alain Ketterlin wrote: >>>>> Type safety. >>>> Perhaps. Python has strong type safety. >>> Come on. >> >> I don't understand that comment, please explain. > > I guess what is referred to is static typing. It serves two purposes: > > 1. It makes the managers of software development teams believe the > junior developers in their teams won't be able to do too much damage > as the compiler at least enforces some rigor in the code. Hence, > "safety." > > 2. It makes it much easier to automatically optimize the code. > > Unfortunately, it also has serious downsides: > > 3. The code becomes very tedious to type in. You may need hundreds of > lines of boilerplate code before it actually does anything. It also > easily makes you lose your focus. > > 4. The flow of the code becomes hard to understand because of the > boilerplate. Ironically, the very straitjacket that seeks to force > good quality on you prevents you from seeing the forest for the > trees. > > Example: > > > Map makeStreetAddressMap( > List infoList) { > Map map = > new HashMap(); > for (StreetInfo info : infoList) > map.put(info.getStreetAddress(), info.getZipCode()); > return map; > } > > vs > > def make_street_address_map(info_list): > map = {} > for info in info_list: > map[info.get_street_address()] = info.get_zip_code() > return map > > or: > > def make_street_address_map(info_list): > return dict((info.get_street_address(), info.get_zip_code()) > for info in info_list) > > > Marko > Interesting. We've gone from "Python has strong type safety" to "come on" to "I guess what is referred to is static typing". I'll simply say that I understand Python to be strongly, dynamically typed. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com