Re: Top 10 most common hard skills listed on resumes...

Liste des GroupesRevenir à cl c  
Sujet : Re: Top 10 most common hard skills listed on resumes...
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.c
Date : 09. Sep 2024, 02:07:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vblhp7$249ug$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 09/09/2024 01:29, Waldek Hebisch wrote:
Bart <bc@freeuk.com> wrote:

No.  It is essential for efficiency to have 32-bit types.  On 32-bit
machines doing otherwise would add useless instructions to object
code.  More precisly, really stupid compiler will generate useless
intructions even with my declarations, really smart one will
notice that variables fit in 32-bits and optimize accordingly.
But at least some gcc versions needed such declarations.  Note
also that my version makes clear that there there is
symmetry (everything should be added using 64-bit precision),
you depend on promotion rules which creates visual asymetry
are requires reasoning to realize that meaning is symetric.
Your posted code used 64-bit aritmetic. The xext and c 32-bit variables were used in loops where they need to be widened to 64 bits anyway. The new value of c is set from a 32-bit result.
(Have you tried 64-bit versions of xext, yext, c to see it it makes any difference? I may try it myself if I can set up a suitable test, but I can only test on a 64-bit machine.
Do you still have 32-bit machines around? I haven't been able to find one for a decade and a half!)

In my version type of pp is clearly visible, together with casts
this gives string hint what is happening: this is 32-bit addition
producing carry in 'c'.
It seems to do a 64-bit addition with a carry on bit 32 of the result stored in c.

Note, I did not intend to post a trap for you, but in your
egerness to shorten the code you removed important information.
And while this code is unlikely to change much (basically
upgrade to 64-bit version on 64-bit machines in the only likely
change), normally code evolves and your version is harder
to change.
3 copies of 'pp' is a bit harder to change than one!
Your code is basically doing 'p = a[i] + b[i] + c' in a loop, but spread over multiple lines and completed buried in all those 'unsigned long long' declarations:
         unsigned long long pp = (unsigned long long)(xp[i])
                               + (unsigned long long)(yp[i])
                               + (unsigned long long)c;
That was my main objection. And yes, all those casts because of mixing 32/64-bit arithmetic is another source of clutter.

More generally, my aim is to make code obviously correct
(I not saying that I was fully successful in this case).
I consider your version worse, because with your version
reader has more work checking correctness (even taking into
account that you lowered number of lines).
Sorry, I think mine (either version I posted) is easier to check.

Anyway, I illustrated to you how I use declarations in the middle
of a function.  There is nothing chaotic about this, type is
declared when variable first time gets its value.  And in most
cases variable scope is tiny.  AFAICS neither early Pascal nor
your language allows me to write programs in this way.
You can write declarations mixed within code in my language, but they will have function-wide scope. I tend to do that only for temporary code.

And if
you do not see benefits, well, this your loss.
Average number of local variables in a half-dozen C codebases I surveyed was 3 variables per function. So I find it hard to see the point of splitting them up into different scopes!

Date Sujet#  Auteur
24 Aug 24 * Top 10 most common hard skills listed on resumes...407John Forkosh
24 Aug 24 +* Re: Top 10 most common hard skills listed on resumes...3Lawrence D'Oliveiro
24 Aug 24 i`* Re: Top 10 most common hard skills listed on resumes...2Keith Thompson
24 Aug 24 i `- Re: Top 10 most common hard skills listed on resumes...1Lawrence D'Oliveiro
24 Aug 24 +* Re: Top 10 most common hard skills listed on resumes...8David Brown
25 Aug 24 i`* Re: Top 10 most common hard skills listed on resumes...7John Forkosh
25 Aug 24 i +- Re: Top 10 most common hard skills listed on resumes...1Michael S
25 Aug 24 i +* Re: Top 10 most common hard skills listed on resumes...3James Kuyper
25 Aug 24 i i+- Re: Top 10 most common hard skills listed on resumes...1Michael S
26 Aug 24 i i`- Re: Top 10 most common hard skills listed on resumes...1Vir Campestris
25 Aug 24 i `* Re: Top 10 most common hard skills listed on resumes...2David Brown
25 Aug 24 i  `- Re: Top 10 most common hard skills listed on resumes...1Chris M. Thomasson
24 Aug 24 `* Re: Top 10 most common hard skills listed on resumes...395Bonita Montero
24 Aug 24  `* Re: Top 10 most common hard skills listed on resumes...394Bart
24 Aug 24   +* Re: Top 10 most common hard skills listed on resumes...2Vir Campestris
24 Aug 24   i`- Re: Top 10 most common hard skills listed on resumes...1Thiago Adams
25 Aug 24   +* Re: Top 10 most common hard skills listed on resumes...360John Forkosh
25 Aug 24   i+* Re: Top 10 most common hard skills listed on resumes...357James Kuyper
25 Aug 24   ii+* Re: Top 10 most common hard skills listed on resumes...272fir
25 Aug 24   iii+* Re: Top 10 most common hard skills listed on resumes...270Bart
25 Aug 24   iiii+* Re: Top 10 most common hard skills listed on resumes...2Michael S
25 Aug 24   iiiii`- Re: Top 10 most common hard skills listed on resumes...1Bart
25 Aug 24   iiii+* Re: Top 10 most common hard skills listed on resumes...7tTh
25 Aug 24   iiiii`* Re: Top 10 most common hard skills listed on resumes...6Bart
28 Aug 24   iiiii `* Re: Top 10 most common hard skills listed on resumes...5Michael S
28 Aug 24   iiiii  +- Re: Top 10 most common hard skills listed on resumes...1Bonita Montero
28 Aug 24   iiiii  +* Re: Top 10 most common hard skills listed on resumes...2Bart
29 Aug 24   iiiii  i`- Re: Top 10 most common hard skills listed on resumes...1David Brown
30 Aug 24   iiiii  `- Re: Top 10 most common hard skills listed on resumes...1Lawrence D'Oliveiro
26 Aug 24   iiii`* Re: Top 10 most common hard skills listed on resumes...260Lawrence D'Oliveiro
26 Aug 24   iiii `* Re: Top 10 most common hard skills listed on resumes...259Bart
26 Aug 24   iiii  +* Re: Top 10 most common hard skills listed on resumes...257Ben Bacarisse
26 Aug 24   iiii  i+* Re: Top 10 most common hard skills listed on resumes...245Bart
26 Aug 24   iiii  ii+* Re: Top 10 most common hard skills listed on resumes...2Keith Thompson
26 Aug 24   iiii  iii`- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
28 Aug 24   iiii  ii`* Re: Top 10 most common hard skills listed on resumes...242Ben Bacarisse
28 Aug 24   iiii  ii `* Re: Top 10 most common hard skills listed on resumes...241Bart
28 Aug 24   iiii  ii  `* Re: Top 10 most common hard skills listed on resumes...240Ben Bacarisse
28 Aug 24   iiii  ii   `* Re: Top 10 most common hard skills listed on resumes...239Bart
29 Aug 24   iiii  ii    +* Re: Top 10 most common hard skills listed on resumes...237Ben Bacarisse
29 Aug 24   iiii  ii    i`* Re: Top 10 most common hard skills listed on resumes...236Bart
29 Aug 24   iiii  ii    i `* Re: Top 10 most common hard skills listed on resumes...235Ben Bacarisse
29 Aug 24   iiii  ii    i  `* Re: Top 10 most common hard skills listed on resumes...234Bart
29 Aug 24   iiii  ii    i   `* Re: Top 10 most common hard skills listed on resumes...233Ben Bacarisse
29 Aug 24   iiii  ii    i    `* Re: Top 10 most common hard skills listed on resumes...232Kaz Kylheku
29 Aug 24   iiii  ii    i     `* Re: Top 10 most common hard skills listed on resumes...231Ben Bacarisse
29 Aug 24   iiii  ii    i      `* Re: Top 10 most common hard skills listed on resumes...230Kaz Kylheku
29 Aug 24   iiii  ii    i       +* Re: Top 10 most common hard skills listed on resumes...228Ben Bacarisse
29 Aug 24   iiii  ii    i       i+* Re: Top 10 most common hard skills listed on resumes...219Bart
29 Aug 24   iiii  ii    i       ii+* Re: Top 10 most common hard skills listed on resumes...5Keith Thompson
29 Aug 24   iiii  ii    i       iii`* Re: Top 10 most common hard skills listed on resumes...4Bart
30 Aug 24   iiii  ii    i       iii `* Re: Top 10 most common hard skills listed on resumes...3Keith Thompson
30 Aug 24   iiii  ii    i       iii  `* Re: Top 10 most common hard skills listed on resumes...2Bart
30 Aug 24   iiii  ii    i       iii   `- Re: Top 10 most common hard skills listed on resumes...1Keith Thompson
30 Aug 24   iiii  ii    i       ii+* Re: Top 10 most common hard skills listed on resumes...57Ben Bacarisse
30 Aug 24   iiii  ii    i       iii`* Re: Top 10 most common hard skills listed on resumes...56Kaz Kylheku
30 Aug 24   iiii  ii    i       iii +* Re: Top 10 most common hard skills listed on resumes...43Tim Rentsch
30 Aug 24   iiii  ii    i       iii i`* Re: Top 10 most common hard skills listed on resumes...42Keith Thompson
31 Aug 24   iiii  ii    i       iii i +* Re: Top 10 most common hard skills listed on resumes...10Kaz Kylheku
31 Aug 24   iiii  ii    i       iii i i+* Re: Top 10 most common hard skills listed on resumes...2James Kuyper
31 Aug 24   iiii  ii    i       iii i ii`- Re: Top 10 most common hard skills listed on resumes...1Keith Thompson
1 Sep 24   iiii  ii    i       iii i i`* Re: Top 10 most common hard skills listed on resumes...7Tim Rentsch
1 Sep 24   iiii  ii    i       iii i i `* Re: Top 10 most common hard skills listed on resumes...6Keith Thompson
1 Sep 24   iiii  ii    i       iii i i  +* Re: Top 10 most common hard skills listed on resumes...4Kaz Kylheku
1 Sep 24   iiii  ii    i       iii i i  i+* Re: Top 10 most common hard skills listed on resumes...2James Kuyper
1 Sep 24   iiii  ii    i       iii i i  ii`- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
1 Sep 24   iiii  ii    i       iii i i  i`- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
1 Sep 24   iiii  ii    i       iii i i  `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
31 Aug 24   iiii  ii    i       iii i `* Re: Top 10 most common hard skills listed on resumes...31Bart
31 Aug 24   iiii  ii    i       iii i  +- Re: Top 10 most common hard skills listed on resumes...1Kaz Kylheku
31 Aug 24   iiii  ii    i       iii i  +- Re: Top 10 most common hard skills listed on resumes...1James Kuyper
1 Sep 24   iiii  ii    i       iii i  +* Re: Top 10 most common hard skills listed on resumes...3Tim Rentsch
1 Sep 24   iiii  ii    i       iii i  i`* Re: Top 10 most common hard skills listed on resumes...2Bart
1 Sep 24   iiii  ii    i       iii i  i `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
1 Sep 24   iiii  ii    i       iii i  `* Re: Top 10 most common hard skills listed on resumes...25Keith Thompson
1 Sep 24   iiii  ii    i       iii i   `* Re: Top 10 most common hard skills listed on resumes...24Bart
1 Sep 24   iiii  ii    i       iii i    +* Re: Top 10 most common hard skills listed on resumes...3Keith Thompson
1 Sep 24   iiii  ii    i       iii i    i`* Re: Top 10 most common hard skills listed on resumes...2Tim Rentsch
1 Sep 24   iiii  ii    i       iii i    i `- Re: Top 10 most common hard skills listed on resumes...1Keith Thompson
1 Sep 24   iiii  ii    i       iii i    +* Re: Top 10 most common hard skills listed on resumes...18Kaz Kylheku
1 Sep 24   iiii  ii    i       iii i    i`* Re: Top 10 most common hard skills listed on resumes...17Tim Rentsch
8 Sep 24   iiii  ii    i       iii i    i `* Re: Top 10 most common hard skills listed on resumes...16Janis Papanagnou
8 Sep 24   iiii  ii    i       iii i    i  +* Re: Top 10 most common hard skills listed on resumes...10James Kuyper
8 Sep 24   iiii  ii    i       iii i    i  i`* Re: Top 10 most common hard skills listed on resumes...9Janis Papanagnou
9 Sep 24   iiii  ii    i       iii i    i  i +* Re: Top 10 most common hard skills listed on resumes...5David Brown
9 Sep 24   iiii  ii    i       iii i    i  i i`* Re: Top 10 most common hard skills listed on resumes...4James Kuyper
9 Sep 24   iiii  ii    i       iii i    i  i i `* Re: Top 10 most common hard skills listed on resumes...3David Brown
9 Sep 24   iiii  ii    i       iii i    i  i i  `* Re: Top 10 most common hard skills listed on resumes...2James Kuyper
17 Sep 24   iiii  ii    i       iii i    i  i i   `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
9 Sep 24   iiii  ii    i       iii i    i  i `* Re: Top 10 most common hard skills listed on resumes...3Kaz Kylheku
9 Sep 24   iiii  ii    i       iii i    i  i  +- Re: Top 10 most common hard skills listed on resumes...1James Kuyper
17 Sep 24   iiii  ii    i       iii i    i  i  `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
17 Sep 24   iiii  ii    i       iii i    i  `* Re: Top 10 most common hard skills listed on resumes...5Tim Rentsch
17 Sep 24   iiii  ii    i       iii i    i   `* Re: Top 10 most common hard skills listed on resumes...4Janis Papanagnou
18 Sep 24   iiii  ii    i       iii i    i    `* Re: Top 10 most common hard skills listed on resumes...3Tim Rentsch
18 Sep 24   iiii  ii    i       iii i    i     `* Re: Top 10 most common hard skills listed on resumes...2antispam
21 Sep 24   iiii  ii    i       iii i    i      `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
1 Sep 24   iiii  ii    i       iii i    +- Re: Top 10 most common hard skills listed on resumes...1James Kuyper
7 Sep 24   iiii  ii    i       iii i    `- Re: Top 10 most common hard skills listed on resumes...1Waldek Hebisch
2 Sep 24   iiii  ii    i       iii `* Re: Top 10 most common hard skills listed on resumes...12Ben Bacarisse
2 Sep 24   iiii  ii    i       iii  `* Re: Top 10 most common hard skills listed on resumes...11Bart
30 Aug 24   iiii  ii    i       ii+- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
5 Sep 24   iiii  ii    i       ii`* Re: Top 10 most common hard skills listed on resumes...155Waldek Hebisch
29 Aug 24   iiii  ii    i       i`* Re: Top 10 most common hard skills listed on resumes...8James Kuyper
30 Aug 24   iiii  ii    i       `- Re: Top 10 most common hard skills listed on resumes...1Tim Rentsch
29 Aug 24   iiii  ii    `- Re: Top 10 most common hard skills listed on resumes...1Michael S
26 Aug 24   iiii  i`* Re: Top 10 most common hard skills listed on resumes...11Keith Thompson
26 Aug 24   iiii  `- Re: Top 10 most common hard skills listed on resumes...1Lawrence D'Oliveiro
26 Aug 24   iii`- Re: Top 10 most common hard skills listed on resumes...1Lawrence D'Oliveiro
25 Aug 24   ii+* Re: Top 10 most common hard skills listed on resumes...83Bonita Montero
25 Aug 24   ii`- Re: Top 10 most common hard skills listed on resumes...1Janis Papanagnou
25 Aug 24   i+- Re: Top 10 most common hard skills listed on resumes...1Bonita Montero
25 Aug 24   i`- Re: Top 10 most common hard skills listed on resumes...1David Brown
25 Aug 24   `* Re: Top 10 most common hard skills listed on resumes...31Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal