Auteur: Didier Kryn Date: À: dng Sujet: Re: [DNG] another programming language question
Le 24/10/2024 à 20:24, o1bigtenor via Dng a écrit : > Greetings
>
> If I am asking too many questions of this kind of nature - - - please
> advise - - - my guru
> died some years ago (may even be known to some of you) so I have no
> place to get information - - so the questions continue (they've been
> going for a long time already - - - - grin!!).
>
> In the beginning stages of learning how to program.
>
> My mentor had advised that I seriously consider Python - - - but - - -
> looking at the slow processing
> time and the impetus provided by this group I have been working on learning C.
> (Now its slow going - - - - it seems that learning has become a going
> around in too many circles with not a lot of " write this - - - see
> this - - - means x and you use it for these reasons and in
> the following fashion. " - - - Maybe its too close to what I call
> monkey see monkey do kind of learning but I know it works AND the info
> sticks - - - maybe its the idea that counting now starts with zero
> instead of one has warped some other things - - - LOL.)
>
> So I remember hearing about Cython - - - - sounds like that really
> might be useful - - - you know a marriage between C and Python - - -
> so fast and you can get down close to the proc etc etc. Is this
> something to consider in trying to program microcontrollers and SoCs
> (microprocessors) to do things for me or is this better left until I
> get some fluency in C and then added?
>
> Please advise
I definitely consider that C is a "must". But you are also advised
it is not well suited for large applications.
One of the other important features of high-level languages is to
let exceptions take a separate flow path. In C, the errors are generally
reported in the return value of a function: a meaningless value or a
non-zero value is what tells you there was an error. Therefore a correct
program always checks that the return value does not signal an error,
and this clobbers your algorithm with error checks and conditional
branchings. It makes your source bigger and painfull to read.
C also gives you the bad habit to choose your variable types after
hardware concepts, such as the size of registers. Truly high level
languages drop this consideration and take care themself of choosing the
proper hardware representation of your variables, pushing you to instead
match your data types with the nature of your problem.
But, despite the many drawbacks of C, this is a language you must
know; there's no altarnative.