Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: David Brown Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Python (was Re: I did not inhale) Date: Thu, 22 Aug 2024 10:10:18 +0200 Organization: A noiseless patient Spider Lines: 43 Message-ID: References: <20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org> <87il0lldf8.fsf@tudado.org> <20240815182717.189@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 22 Aug 2024 10:10:19 +0200 (CEST) Injection-Info: dont-email.me; posting-host="e19e10a6f493b0642935e2bdebcb364b"; logging-data="399728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WHwgI2w5oZW3Zlmk9VFttS0EGb1lBGq8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:G2huRwke9WMrKRJCUQpzBIoo1ro= Content-Language: en-GB In-Reply-To: Bytes: 3888 On 22/08/2024 09:42, Muttley@dastardlyhq.com wrote: > On Wed, 21 Aug 2024 21:15:14 +0200 > David Brown boringly babbled: >> On 21/08/2024 17:40, Muttley@dastardlyhq.com wrote: >>> The problem with pyserial is you have to use Python. Horrible language >>> though like BASIC, useful for teaching kids to code. >>> >> >> Let's just say, opinions differ. Python /can/ be used for beginner > > Yes, its ultimately subjective. The reasons I don't like it are that I can't > stand dynamic typing in supposed "proper" languages and the syntatically > meaningful whitespace nonsense they took from Occam really grinds my gears. > In my current job I'm forced to use it but I'd never do it out of choice. > Dynamic typing has its advantages and disadvantages. You do lose a lot of human checking and static checking when you have dynamic typing, but you gain flexibility. Have you tried using type annotations in Python? For some code it can give a reasonable compromise, letting you have at least some control of types while also being flexible where you want. I am a big fan of clear and consistent layout and indentation, which is forced on you by Python (and Occam), but I too prefer explicit blocking. It's harder to get things wrong with explicit blocking, and you are never faced with space vs. tab conflicts causing semantic changes to the code. >> programmers - but it is also an excellent language for many real tasks. >> Of course it has its weaknesses and disadvantages as well as its >> strengths, and aspects that will appeal to some programmers and not others. > > IMO its fine for small scripts up to maybe a few hundred lines. Beyond that > no. > Oh, it's fine for /far/ bigger programs than that. But it is excellent for small scripts and utilities. Like any language, you need discipline and to work in a way that suits the language. If you approach Python coding as though it were C, or vice versa, you'll make a mess.