Deutsch   English   Français   Italiano  
<va5108$3tmmd$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

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 <david.brown@hesbynett.no>
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 21 Aug 2024 17:27:04 +0200
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <va5108$3tmmd$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <uvbfii$3mom0$1@news.xmission.com>
 <20240412094809.811@kylheku.com> <87il0mm94y.fsf@tudado.org>
 <way-20240413091747@ram.dialup.fu-berlin.de> <87il0lldf8.fsf@tudado.org>
 <choices-20240413123957@ram.dialup.fu-berlin.de>
 <v9lm2k$12qhv$1@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
 <20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
 <v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
 <va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
 <va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
 <va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Aug 2024 17:27:05 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f1f84c8ef38500396b4e29280e06726d";
	logging-data="4119245"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18GzLXPz2yER4JicvazfVja8/HQ1dJN/Dk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:kf4xYuAuFw4DEEc21EM9Nv9daBI=
In-Reply-To: <va4fbr$3qvij$1@dont-email.me>
Content-Language: en-GB
Bytes: 4863

On 21/08/2024 12:26, Muttley@dastardlyhq.com wrote:
> On Wed, 21 Aug 2024 11:10:53 +0200
> David Brown <david.brown@hesbynett.no> boringly babbled:
>> If you are writing network software for Linux, how is it relevant to
>> learn about the sound API, or the more advanced filesystem API's ?  If
> 
> You don't, but the subsystems don't exist in isolation, there's a lot of
> overlap. Eg network sockets use a lot of the same API functions as files
> (eg: read, write, fcntl, ioctl) so understanding may well help to understand
> the other.

Sure.

Of course understanding /some/ of this is essential for a lot of tasks. 
And understanding a bit more can be /useful/.  My argument is against 
this idea that you need to learn it all.

Let's take an example.  In my line of work, I use UARTs a lot - I've 
probably used UART's on 20-30 different microcontroller families, as 
well as external UART chips, bit-banging in software, with polling, DMA, 
interrupts, RTOS abstractions, SDK routines.  I've used them a /lot/.

Trying to understand the Linux documentation for UARTs is a nightmare. 
They are horrendous - the APIs, structs, flag sets, etc., are a vast 
jumble of crap for handling terminals that haven't been seen outside a 
museum for 50 years, long before Linux was conceived.  Trying to get the 
right selection of API calls, struct setups, etc., simple raw UART 
access to send and receive characters can take many days of studying 
documentation of questionable standard, trial and error, and guesswork. 
A good "Programming Linux" book /might/ help - but it might be out of 
date.  Snippets from googling, however, /does/ get the job done - you 
can find examples, try them out and see what works, and in a few hours I 
had everything running.

Even better, of course, is to ditch C and use Python - "pyserial" does 
it all, simply and cleanly.  (And the same code works on Windows, if 
that happens to be useful - though Windows picks pseudo-random names for 
serial ports and has nothing like udev rules.)  But for this particular 
customer, it had to be in C (well, C++, but that's a minor detail).

Would that task have been easier if I'd studied the details of fcntl, 
ioctl, and other calls that were needed for the task?  No, not at all. 
Would "knowing POSIX" have helped?  Would reading some old book on Linux 
programming have helped?  No.  (I /have/ read books on Linux programming.)

But a rough idea of some of the concepts of Linux development was 
useful.  Knowing /something/ about the OS is helpful.


> 
>> you are writing a gui program with QT, why should you be interested in X
>> APIs or POSIX threading and file handling - you'll be using the QT
>> libraries and APIs for graphics, threading and file handling.
> 
> Not necessarily.
> 
>> I have not suggested, or even hinted, that all you need is "core C" -
>> what you need is the knowledge that is relevant to the task at hand,
>> regardless of the OS, language, or whatever.
> 
> Its certainly the impression you gave.
> 

I can't imagine how you got that from my posts.