Conversation
Notices
-
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:07 JST Iron Bug @d_pechkin @erabo my iguana once re-programmed the light controller in terrarum. he pressed some buttons with his claws and then I noticed the light in terrarium started to get on and off at some strange times. so iguana was a bit of a programmer too :) - Alexandre Oliva likes this.
-
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:15 JST Playing with Fediverse @iron_bug @d_pechkin Iron Bug hat geschrieben:
. but my grand parents were very punctual about "family dinners" so I can relate ?Dont be afraid?, i like "family dinners" and the "Otherwise I'll get into trouble with my family" is written with a На губах ухмылка.
I also not only live with my family but also with some "reptiles" not directly in my home but in my garden, just they are feathered "reptiles" (parakeets) and lots of fisches and snakes in the garden ponds ... but sadly no one of them does know to program. -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:16 JST Playing with Fediverse @iron_bug @d_pechkinit always was plain and simple. and it still is.Agree; and I wouldn't even dare to doubt your bigger brother ;)
But i cant
.... but I can't help myself: In college we "smiled" at C as a macro assembler. (Duck away...)
And since I could be your father in terms of age, I >surrender< to your speed of writing and have to eat a few bites again to recharge my batteries. -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:18 JST Playing with Fediverse @iron_bug @d_pechkinC is there since 1972. and I'm 5 years younger than it.so C is you bigger brother than. So you must feel symphaty to it ?
.... schnell was essen ... -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:19 JST Playing with Fediverse @iron_bug @d_pechkin
puhhh Schweißausbruch vor Schreibanstrengung...:Schwitzendes_Smily":iron_bug hat geschrieben:
I always easier dealt with hardware and systems than with people ?Tut mit Leid, dass ich ein mensch bin (I'm sorry to be a human) ?
I will try my best to get assimilated. ... schnell wieder was essen .... -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:22 JST Iron Bug @d_pechkin @erabo well, if you dealt with assembler and binary machine codes you can clearly understand the thing with addressing and the difference between direct and addressed access to data, and that there's no really 'int*' or 'float*' types but intXX_t that is defined by the address bus. and on modern PC machines I can use int64_t type for addresses. C is flexible enough to allow this without problem (and this is why I like it). pointers are just a convenience.
I'm not a teacher kind of person. I always easier dealt with hardware and systems than with people :) but what I know for sure is C is plain and simple. I learnt it when I was 12 and I barely knew English then. I had only a K&R book and text file with description of standard functions for borland C. and it wasn't that difficult. now people say 'it is unsafe and error prone' but this is something wrong with their head, not with C :) C is there since 1972. and I'm 5 years younger than it. it always was plain and simple. and it still is. -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:23 JST Playing with Fediverse @iron_bug @d_pechkin
ui, uii, uiii....
when I want to keep up with your writing speed I get out of breath...
shorter,
i agree: rust is a hype and often people think there errors are all about the wrong tool, changing the tool eliminates automatic all errors in their future works. (But it's also not wrong, that with respect to different tasks different tools my be better supporting the work; unquestionable)
"hould learn programming in assembler first "
By the way, i did "start" programming with Punch cards and assembler among others. Obviously the effect you associate with it did fail on me ;)
Sometimes i help people learning programming to understand the simple pointer-thing concept by describing it on a very analog Indexed Cardfile System. Everyone understand it than, it's independant from a specific programming language. -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:24 JST Playing with Fediverse @iron_bug @d_pechkin
"emphasize that I write in C .." no problem, see above ?
"the code clarity and code style is important ": agree
"they're principally wrong": disagree
"I think that coding style is important.":agree
"they have a chaos in their head": disagree with respect to my head
a) 'int *(*f)(int *x);'
<==>
b) 'int* (*f)(int* x);'
<==>
c)
typedef int* TpIntPtr;
TpIntPtr (*f)(TpIntPtr x);
That ist the only exact correct ?.(a) Directs the focus of perception of the reader on to the dereferencing process.
(b) Directs the focus of perception to the a type centric one
(c) clearly places focus of perception type centric one.
And non of them "is principally wrong".I would predict that in an experiment concerning the speed of grasping the meaning of an expression, the result would be clearly in favor of (b).
;) And for my slowly aging eyes, even (b) is easier and thus faster to grasp than (a).
This, on the other hand:
int
*
x=5;
is clearly a style which would be undeniably error-prone ;) but still it is "exactly" correct syntactically and semantically.
But be aware, in dont want to change your falvour-prefferings. -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:26 JST Iron Bug @d_pechkin @erabo and I emphasize that I write in C all these years. so the code clarity and code style is important and should not allow things like 'int* x'. because they're principally wrong and may lead to errors if the code is changed later. and it means that people don't understand the C typing and type assotiation rules. and then they cannot understand a little more complicated things like 'int *(*f)(int *x);' and so on. because they have a chaos in their head and mistake common declarations and evaluations. and note that (*f) means a pointer to function, because pointer is attached to the defined object, not to the type it dereferences.
the example of proper code style is the Kernel coding style: clear and fine. I think that coding style is important. -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:28 JST Playing with Fediverse @iron_bug @d_pechkin
s1)
The only 'it is exactly...' is the satisfying the syntax-definition and the semantic-definition of the language;
s2)
all others is of type a flavour one prefers.
The 'I write ...' is a non-argument on factual basis and at max the try of a dominance-argument ;)
I dont surrender,
as i'm programming over 40 years and all of them professional - dont count the non professional years from school-time -.
We can make a rythmic song:
you: Surrender!
I: Surrender"
(got to start)
Or :
Allow everyone to use the flavour he or his team likes and helps. -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:30 JST Iron Bug @d_pechkin @erabo but it's int *TpIntPtr.
because
typedef int inta, *intptrb;
surrender! I write in C for over 30 years and 22 of them I do it professionally :) -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:31 JST Playing with Fediverse @iron_bug @d_pechkin
?
you can type
typedef int* TpIntPtr;
void f(TpIntPtr x);
This is why it is exactly 'int* x', not anything else.
;)
And syntactically you may type ' int BLANK BLANK BLANK * BLANK BLANK BLANK BLANK x' and many else ;) -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:32 JST Iron Bug @d_pechkin @erabo this is why it is exacty 'int *x', not anything else. -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:34 JST Iron Bug @d_pechkin @erabo the rationale is simple: you can type things like
int a, *b; -
Embed this notice
Playing with Fediverse (erabo@friendica.erabo.de)'s status on Saturday, 19-Nov-2022 05:50:35 JST Playing with Fediverse @iron_bug @d_pechkin
It's just how you which to represent the semantical aspect:
int* x
Focuses on "x is of type 'pointer of int'"
int *x
focuses on "dereferencing the pointervariable delivers an int"
Rest is more ideological driven (informatic costructs computer languages to serve humans, not humans to server computer language ;) ).
And the cat in the picture is voting for (1) as it manipulates
int * ptr into intptr by eating up the * -
Embed this notice
Iron Bug (iron_bug@friendica.ironbug.org)'s status on Saturday, 19-Nov-2022 05:50:37 JST Iron Bug @d_pechkin int *ptr.
'coz it's logically right. -
Embed this notice
Pechkin :emacs: :linux: (d_pechkin@linuxrocks.online)'s status on Saturday, 19-Nov-2022 05:50:43 JST Pechkin :emacs: :linux: int *ptr or int* ptr?