Deutsch English Français Italiano |
<qhf1qk-664.ln1@lazy.lzy> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Piergiorgio Sartor <piergiorgio.sartor.this.should.not.be.used@nexgo.REMOVETHIS.de> Newsgroups: comp.lang.python Subject: Re: Triggered By Mediocre Code (Posting On Python-List Prohibited) Date: Tue, 27 Aug 2024 19:38:34 +0200 Organization: A noiseless patient Spider Lines: 43 Message-ID: <qhf1qk-664.ln1@lazy.lzy> References: <vag94r$23hhf$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 27 Aug 2024 19:39:07 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7854502ca6e3fd1513c784b88b2dfc3a"; logging-data="3239882"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x228RYaMd3bZwqMchKRs7" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:8tg0GrYvC37mftHyw/tHFO969i4= In-Reply-To: <vag94r$23hhf$2@dont-email.me> Content-Language: it, en-GB Bytes: 2312 On 25/08/2024 23.53, Lawrence D'Oliveiro wrote: > Looking at this article about the top three languages for getting > programming jobs > <https://www.zdnet.com/article/want-a-programming-job-make-sure-you-learn-these-three-languages/>, > naturally I couldn’t help noticing the code in the screenshot at the > top (my transcription): > > bufferedNumber = str(doc.GetTime().GetFrame(docFps)) > if len(bufferedNumber)<4: > for x in range(len(bufferedNumber),4): > bufferedNumber = "0" + bufferedNumber > > I mean, really? Four lines to do what could be done in a single > expression? > > Was that written by a PHP programmer, do you think? That the more correct question would be: What is easier to read? And to debug? The four line version or the one liner? To paraphrase someone: "If the length of a program would be measured by the time needed to understand it, some program would be too short to be short." Because the world is plenty of one liner nobody (almost) doesn't understand. There is even a category in the OCC (https://www.ioccc.org/). Don't get me wrong, I like and dislike one liner. Namely, I like mine and dislike the others :-) bye, -- piergiorgio