Re: this girl calls c ugly

Liste des GroupesRevenir à cl c  
Sujet : Re: this girl calls c ugly
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.lang.c
Date : 28. May 2026, 10:57:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <10v93ia$3bu3a$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 5/28/2026 2:18 AM, Janis Papanagnou wrote:
On 2026-05-28 01:49, BGB wrote:
[...]
>
In general I like her videos, and she seems to know what she is talking about...
>
But, I am not personally as much of a fan of C++ as she is...
 I'm a big fan of abstractions. - So many things beyond "C" are fine!
 
I am not saying that abstractions are bad, but I haven't usually found them to be worth the costs IME.

[...]
>
[ Cygwin ]
 A sensible but imperfect workaround provided for an inferior platform.
 
Yeah.
It was the main thing I had when I was in high-school.
   Well, Cygwin and MinGW.
By college, the "Windows Platform SDK" became freely available, and I mostly ended up jumping over this for native Windows development.
At least the C++ compiler worked, still failed to fully win me over.
   Tried writing minor things in C++, mixed results.

[...]
>
Similar reason to why one doesn't build complex patterns or do template- like stuff via function macros in the C preprocessor:
One can do this... But again, bloated binaries and terrible build times.
 Code patterns that are bulky in "C" can be formulated tersely with
C++/STL (while still preserving an efficient implementation, even with
complexities guaranteed); and the framework is flexible, orthogonally
designed. Easy to reuse high-level concepts as opposed to re-implement
the same code for different types. Or weaken the code by extensive use
of casts. All sorts of C's problems with memory can be addressed. (The
list can be continued; but I wonder why such things aren't recognized.)
 
Both have a similar issue when used in a naive way though:
   Non-careful use of either results in code bloat.
But, not really an "easy" way to avoid bloat, other than to write code specifically for what cases are relevant; while also avoiding needless duplication and copy paste (where, overuse of copy/paste can also lead to bloat; along with turning the code into an ugly mess).
But, OTOH, factoring things into too small of pieces can negatively effect performance (and, for non-leaf functions, prolog/epilog costs for too many tiny functions can also be a source of code bloat).
As can be noted, trying to mimic templates via creative use of C preprocessor macros can also easily result in excessive bloat...

>
So, one is back to the core issue:
The part that is actually usable, mostly still amounts to syntactic sugar over things you can already do in C.
 Huh? It may depend on the developer/programmer. But it's certainly a
lot more than "syntactic sugar".
 
Well, for example:
   Operator overloading:
     Basically glorified function calls made to resemble operators;
   Classes:
     Can be done with structs, and implementing vtables manually.
Implementing class hierarchies via structs can be done, but gets ugly (GTK's GObject system sorta went this way).
...

>
There are "niceties", granted, but relatively little "actually new".
 Not all concepts are "new", of course; we saw them in other languages
years or (in some cases) decades ago. But C++' and STL features are a
lot more than just niceties; it's beyond me how one may come to such
a valuation. (And now let's compare that formulated demand or wish of
new things with "C"?)
 
Well, it is a thing that can be done, but is a double-edged sword.
Saves code one might have to write out manually.
But, is very easy to result in things that negatively effect build times.
Usual strategy is to try to limit how much code is written, and also to avoid doing things in ways that result in too much code, or too much cruft.
Best to avoid both copy paste when reasonable, and sticking anything non-trivial in macros.

>
And, one of the rare few "actually new" features C++ offers: exceptions.
 We used them already in the 1990's.
 
Here, "new" in the sense that it can't be mapped directly back to stuff that can already be expressed natively in C.

Also comes with its own drawbacks (code bloat, try/catch+throw is usually slow, use with care else program explodes, ...). [...]
 I cannot confirm your statements, especially in that generality.
 I recall we had bloat with templates on a specific platform in the
very early pre-standard era, when they were first supported. But we
didn't have any [noteworthy] speed degradation with exceptions (or
templates).
 
The relative impact of try/catch is more modest.
Typically, it results in every function having an unwind-handling stub for, in-case an exception is thrown, it can call any destructors or similar.
This will depend a lot of the target and ABI, but for example, in my compiler, having exceptions enabled ends up costing around an extra 48 bytes for every non-leaf function.
This can easily add up to a fair number of kB over the size of a program binary even if they aren't used.
The per-function cost would be higher for functions which have objects with destructors or catch handlers. One could easily be looking at 100s of additional bytes for each such function.

>
Many people coding styles often forbid it and mandate that people use error-code returns or similar instead (like in C), with exceptions being globally disabled at build time (along with RTTI and similar), which, isn't really a strong selling point...
 Yes, stupid things are done. Mandating to use RCs and forbid to use
exceptions is particularly stupid as a general rule.
 Probably mentally inconvenient as "new" concept for FORTRAN, BASIC,
or "C" programmers? I can certainly understand that, psychologically.
But not technically. Maybe the support on the commercial platforms
was just better than on Cygwin?
 
On Cygwin, in the early 2000s, "g++" tended to often not work at all...
   MSVC gave a better experience in that at least the compiler worked.
Now, as for the rules like this in many coding standards, can't speak for all of them.
But, the main thing that stands out to me is how many of the projects that use C++ have absurdly slow build times and huge binaries.
Like, someone is like, "Thing takes 10 minutes to compile and the EXE is 50MB? Seems fine to me..."
Well, or LLVM, which can take upwards of an hour to rebuild from source, and eats huge amounts of RAM and HDD space while doing so.
So, yeah, I don't really use LLVM...
My own C compiler rebuilds from source in around 20 seconds or so.
   Well, or 1m38s via GCC...
But, yeah however long is considered a reasonable amount of time to recompile a 370 kLOC C compiler...
MSVC produces an 5.5MB EXE, whereas GCC produces a 12MB ELF.
If I switch "-O3" to "-Os":
   Time drops to 0m58s.
   ELF goes to 7MB.
Still pretty big...
Granted, my C compiler's codebase is a little bigger than I would prefer, but alas...
Granted, my C compiler isn't itself all that fast at compiling stuff, sadly:
It also takes around 20 seconds to recompile Doom (vs around 5 seconds for MSVC).
And, GCC takes around 16 seconds to recompile Doom.
So, yeah, as for its compiling-stuff speeds, it is typically slower than GCC.
Doom sizes:
   MSVC  : 776K  (x64)
   GCC   : 500K  (x86-64)
   GCC   : 1.2MB (RV64G, ELF)
   BGBCC : 272K  (XG3, *)
*: Custom ISA stuff bolted onto RISC-V (with 32/64/96 bit instructions, goes to bigger instructions rather than smaller, and expands register fields to 6-bits using both X and F registers as GPRs, so is the opposite of RV-C in this sense; but manages to compete for code density by reducing overall instruction counts).
For binary sizes, it is pretty close between XG3 and a differently-extended version of RV64GC though. Not yet a clear winner of the code-density crown, but it does more solidly win on speed.
Where, XG3 was more meant for optimizing the design for speed, but to some extent optimizing the design for speed also helps with code density.
Though, for RV64G, GCC seems to produce a lot of bloat in the ELF binaries through the use of excessive amounts of metadata, which is already fairly bulky in the ELF format if contrast with PE/COFF (which is what my compiler generates).
...

Date Sujet#  Auteur
27 May 26 * this girl calls c ugly363fir
27 May 26 `* Re: this girl calls c ugly362fir
28 May 26  `* Re: this girl calls c ugly361BGB
28 May 26   +* Re: this girl calls c ugly5Lawrence D’Oliveiro
28 May 26   i+* Re: this girl calls c ugly3BGB
29 May 26   ii`* Re: this girl calls c ugly2Lawrence D’Oliveiro
29 May 26   ii `- Re: this girl calls c ugly1BGB
28 May 26   i`- Re: this girl calls c ugly1Bonita Montero
28 May 26   +* Re: this girl calls c ugly19Janis Papanagnou
28 May 26   i+* Re: this girl calls c ugly15BGB
29 May 26   ii+- Re: this girl calls c ugly1Lawrence D’Oliveiro
29 May 26   ii`* Re: this girl calls c ugly13Janis Papanagnou
29 May 26   ii `* Re: this girl calls c ugly12BGB
29 May 26   ii  +* Re: this girl calls c ugly9David Brown
29 May 26   ii  i`* Re: this girl calls c ugly8BGB
30 May 26   ii  i `* Re: this girl calls c ugly7David Brown
30 May 26   ii  i  +* Re: this girl calls c ugly2Janis Papanagnou
30 May 26   ii  i  i`- Re: this girl calls c ugly1David Brown
30 May 26   ii  i  `* Re: this girl calls c ugly4BGB
31 May 26   ii  i   `* Re: this girl calls c ugly3David Brown
31 May 26   ii  i    `* Re: this girl calls c ugly2BGB
31 May 26   ii  i     `- Re: this girl calls c ugly1David Brown
29 May 26   ii  +- Re: this girl calls c ugly1Janis Papanagnou
30 May 26   ii  `- Re: this girl calls c ugly1Lawrence D’Oliveiro
28 May 26   i`* Re: this girl calls c ugly3Chris M. Thomasson
29 May 26   i `* Re: this girl calls c ugly2Janis Papanagnou
29 May 26   i  `- Re: this girl calls c ugly1Chris M. Thomasson
28 May 26   `* Re: this girl calls c ugly336fir
28 May 26    `* Re: this girl calls c ugly335BGB
29 May 26     +* Re: this girl calls c ugly328Lawrence D’Oliveiro
29 May 26     i`* Re: this girl calls c ugly327Janis Papanagnou
29 May 26     i `* Re: this girl calls c ugly326Bart
29 May 26     i  +* Re: this girl calls c ugly310Janis Papanagnou
29 May 26     i  i`* Re: this girl calls c ugly309Bart
29 May 26     i  i +* Re: this girl calls c ugly9Janis Papanagnou
29 May 26     i  i i+* Re: this girl calls c ugly2Bart
29 May 26     i  i ii`- Re: this girl calls c ugly1Janis Papanagnou
29 May 26     i  i i`* Re: this girl calls c ugly6Bart
29 May 26     i  i i +* Re: this girl calls c ugly4Janis Papanagnou
29 May 26     i  i i i`* Re: this girl calls c ugly3Bart
29 May 26     i  i i i `* Re: this girl calls c ugly2Janis Papanagnou
29 May 26     i  i i i  `- Re: this girl calls c ugly1Bart
29 May 26     i  i i `- Re: this girl calls c ugly1Keith Thompson
29 May 26     i  i `* Re: this girl calls c ugly299tTh
29 May 26     i  i  `* Re: this girl calls c ugly298Bart
29 May 26     i  i   +* Re: this girl calls c ugly296Keith Thompson
29 May 26     i  i   i`* Re: this girl calls c ugly295Bart
29 May 26     i  i   i +- Re: this girl calls c ugly1Janis Papanagnou
29 May 26     i  i   i `* Re: this girl calls c ugly293Keith Thompson
29 May 26     i  i   i  `* Re: this girl calls c ugly292Bart
29 May 26     i  i   i   +* Re: this girl calls c ugly5Keith Thompson
30 May 26     i  i   i   i`* Re: this girl calls c ugly4James Kuyper
30 May 26     i  i   i   i `* Re: this girl calls c ugly3Bart
30 May 26     i  i   i   i  `* Re: this girl calls c ugly2Keith Thompson
30 May 26     i  i   i   i   `- Re: this girl calls c ugly1Bart
30 May 26     i  i   i   `* Re: this girl calls c ugly286Dan Cross
30 May 26     i  i   i    +* Re: this girl calls c ugly282Bart
31 May 26     i  i   i    i+* Re: this girl calls c ugly280Keith Thompson
31 May 26     i  i   i    ii+* Re: this girl calls c ugly5Janis Papanagnou
31 May 26     i  i   i    iii+* Re: this girl calls c ugly2Keith Thompson
2 Jun 26     i  i   i    iiii`- Re: this girl calls c ugly1Janis Papanagnou
31 May 26     i  i   i    iii`* Re: this girl calls c ugly2David Brown
2 Jun 26     i  i   i    iii `- Re: this girl calls c ugly1Janis Papanagnou
31 May 26     i  i   i    ii`* Re: this girl calls c ugly274Richard Harnden
31 May 26     i  i   i    ii +* Re: this girl calls c ugly169David Brown
31 May 26     i  i   i    ii i+* Re: this girl calls c ugly166Bart
31 May 26     i  i   i    ii ii+* Re: this girl calls c ugly140David Brown
31 May 26     i  i   i    ii iii`* Re: this girl calls c ugly139James Kuyper
31 May 26     i  i   i    ii iii `* Re: this girl calls c ugly138David Brown
31 May 26     i  i   i    ii iii  +* Re: this girl calls c ugly4James Kuyper
31 May 26     i  i   i    ii iii  i`* Re: this girl calls c ugly3David Brown
31 May 26     i  i   i    ii iii  i `* Re: this girl calls c ugly2James Kuyper
1 Jun 26     i  i   i    ii iii  i  `- Re: this girl calls c ugly1David Brown
31 May 26     i  i   i    ii iii  `* Re: this girl calls c ugly133Keith Thompson
1 Jun 26     i  i   i    ii iii   +* Re: this girl calls c ugly2David Brown
1 Jun 26     i  i   i    ii iii   i`- Re: this girl calls c ugly1Keith Thompson
2 Jun 26     i  i   i    ii iii   +* Re: this girl calls c ugly129Janis Papanagnou
2 Jun 26     i  i   i    ii iii   i+- Re: this girl calls c ugly1James Kuyper
2 Jun 26     i  i   i    ii iii   i+* Constants and undefined behavior82Tim Rentsch
2 Jun 26     i  i   i    ii iii   ii`* Re: Constants and undefined behavior81Dan Cross
4 Jun 26     i  i   i    ii iii   ii `* Re: Constants and undefined behavior80Tim Rentsch
4 Jun 26     i  i   i    ii iii   ii  `* Re: Constants and undefined behavior79Dan Cross
4 Jun 26     i  i   i    ii iii   ii   +* Re: Constants and undefined behavior31Keith Thompson
5 Jun 26     i  i   i    ii iii   ii   i+* Re: Constants and undefined behavior28Dan Cross
5 Jun 26     i  i   i    ii iii   ii   ii+* Re: Constants and undefined behavior24Keith Thompson
6 Jun 26     i  i   i    ii iii   ii   iii+* Re: Constants and undefined behavior19Dan Cross
6 Jun 26     i  i   i    ii iii   ii   iiii`* Re: Constants and undefined behavior18Keith Thompson
8 Jun 26     i  i   i    ii iii   ii   iiii `* Re: Constants and undefined behavior17Dan Cross
8 Jun 26     i  i   i    ii iii   ii   iiii  +* Re: Constants and undefined behavior5Keith Thompson
9 Jun 26     i  i   i    ii iii   ii   iiii  i`* Re: Constants and undefined behavior4Dan Cross
9 Jun 26     i  i   i    ii iii   ii   iiii  i `* Re: Constants and undefined behavior3Keith Thompson
9 Jun10:46     i  i   i    ii iii   ii   iiii  i  `* Re: Constants and undefined behavior2Dan Cross
9 Jun23:07     i  i   i    ii iii   ii   iiii  i   `- Re: Constants and undefined behavior1Keith Thompson
9 Jun 26     i  i   i    ii iii   ii   iiii  `* Re: Constants and undefined behavior11Waldek Hebisch
9 Jun23:29     i  i   i    ii iii   ii   iiii   +* Re: Constants and undefined behavior3James Kuyper
10 Jun00:01     i  i   i    ii iii   ii   iiii   i`* Re: Constants and undefined behavior2Keith Thompson
10 Jun13:36     i  i   i    ii iii   ii   iiii   i `- Re: Constants and undefined behavior1Dan Cross
11 Jun15:49     i  i   i    ii iii   ii   iiii   `* Re: Constants and undefined behavior7Janis Papanagnou
11 Jun16:20     i  i   i    ii iii   ii   iiii    +* Re: Constants and undefined behavior2Dan Cross
11 Jun17:08     i  i   i    ii iii   ii   iiii    i`- Re: Constants and undefined behavior1Janis Papanagnou
11 Jun17:30     i  i   i    ii iii   ii   iiii    `* Re: Constants and undefined behavior4Waldek Hebisch
6 Jun 26     i  i   i    ii iii   ii   iii`* Re: Constants and undefined behavior4Tim Rentsch
5 Jun 26     i  i   i    ii iii   ii   ii`* Re: Constants and undefined behavior3Janis Papanagnou
7 Jun 26     i  i   i    ii iii   ii   i`* Re: Constants and undefined behavior2Tim Rentsch
9 Jun07:05     i  i   i    ii iii   ii   `* Re: Constants and undefined behavior47Tim Rentsch
2 Jun 26     i  i   i    ii iii   i`* Re: this girl calls c ugly45Keith Thompson
2 Jun 26     i  i   i    ii iii   `- Re: this girl calls c ugly1Chris M. Thomasson
2 Jun 26     i  i   i    ii ii`* Re: this girl calls c ugly25Dan Cross
31 May 26     i  i   i    ii i`* Re: this girl calls c ugly2James Kuyper
31 May 26     i  i   i    ii +* Re: this girl calls c ugly2Keith Thompson
31 May 26     i  i   i    ii `* Re: this girl calls c ugly102Tim Rentsch
31 May 26     i  i   i    i`- Re: this girl calls c ugly1Dan Cross
1 Jun 26     i  i   i    `* Re: this girl calls c ugly3Tim Rentsch
30 May 26     i  i   `- Re: this girl calls c ugly1David Brown
29 May 26     i  +* Re: this girl calls c ugly6Janis Papanagnou
30 May 26     i  `* Re: this girl calls c ugly9Lawrence D’Oliveiro
29 May 26     `* Re: this girl calls c ugly6Bonita Montero

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal