Click here to Skip to main content
15,887,027 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: *cries in C++* Pin
charlieg17-Feb-22 11:48
charlieg17-Feb-22 11:48 
GeneralRe: *cries in C++* Pin
honey the codewitch17-Feb-22 12:04
mvahoney the codewitch17-Feb-22 12:04 
GeneralRe: *cries in C++* Pin
jschell17-Feb-22 11:54
jschell17-Feb-22 11:54 
GeneralRe: *cries in C++* Pin
honey the codewitch17-Feb-22 11:56
mvahoney the codewitch17-Feb-22 11:56 
GeneralRe: *cries in C++* Pin
bmarstella17-Feb-22 16:33
bmarstella17-Feb-22 16:33 
GeneralRe: *cries in C++* Pin
honey the codewitch17-Feb-22 16:45
mvahoney the codewitch17-Feb-22 16:45 
GeneralRe: *cries in C++* Pin
Stefan_Lang19-Feb-22 2:21
Stefan_Lang19-Feb-22 2:21 
GeneralRe: *cries in C++* Pin
honey the codewitch19-Feb-22 4:55
mvahoney the codewitch19-Feb-22 4:55 
"draw::text<>" has one purpose in my draw class in GFX, and has multiple overloads, the implementation of which spans several functions and one entire private header+cpp file. Because it renders truetype text. Even after factoring the function is half a screen on my display.

I agree with you in principle, but in practice I can't code that way. I have some wiring issues in my head that affect my short term memory, and if I over-factor I forgot how to navigate all the layers and calls. In some respects my condition can be debilitating. This is not one of those areas, but it does mean I have to adjust my approach. Cognitive load on the other hand, I can take for days. So give me a long function, as long as its purpose is singular.

But I understand that this is less than ideal, because I code professionally, and have coded on teams, from PM to lead to QA.

That's one reason I'm not a stickler for industry wide standards. I think a good coder can pick up a standard someone else uses, as long as that someone was consistent, and it's not awful - like there's sense to it. I mean, I have to consider myself and that I'm probably not the only one coding with a handicap of sorts.

As far as C++11 and beyond, I agree with you. But also I'm going to be difficult here - the introduction of variadic template arguments and things like that which facilitate metaprogramming and the metaprogramming itself creates its own kind of maintenance monster.

When you get used to reading "metaprogrammed" C++ it gets easier, but it's still a beast. I've had to reimplement a lot of what the STL hides at points because I target frameworks where the STL is partial if at all, and I don't know which parts are necessarily available, so I understand the sausage making therein.

On the other hand, you can do so much with it. Opening a dialogue with the compiler using your code, so that it can shape the generated code is just ... no other coding is like that. It sets C++ apart, and allows you to do some truly amazing things. In GFX I allow you to define pixels with arbitrary binary layouts and color formats. It then lets you manipulate all the individual color channels and if everything is const, it all resolves const. That means if you use a predefined color like "hot_pink" (an X11 standard color) it will resolve to a single scalar const value at compile time. You can even get the compiler to color blend and convert color formats (from like Y'UV to RGBA or BGR)

All that with C++14 and a somewhat byzantine header file (linked if you're curious) gfx/gfx_pixel.hpp at master · codewitch-honey-crisis/gfx · GitHub[^]

Anyway, you can't do that with C++ prior to 11 (14 in this above case), and you can't do it really in any other language, at least not as directly. (C# includes some code generation facilities now, but that's roundabout)
Real programmers use butterflies

GeneralOh boy. I've given myself a challenge now. Pin
OriginalGriff16-Feb-22 1:48
mveOriginalGriff16-Feb-22 1:48 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
honey the codewitch16-Feb-22 1:53
mvahoney the codewitch16-Feb-22 1:53 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Peter_in_278016-Feb-22 1:58
professionalPeter_in_278016-Feb-22 1:58 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Dave Kreskowiak16-Feb-22 2:08
mveDave Kreskowiak16-Feb-22 2:08 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Amarnath S16-Feb-22 2:15
professionalAmarnath S16-Feb-22 2:15 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Richard MacCutchan16-Feb-22 2:32
mveRichard MacCutchan16-Feb-22 2:32 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
craig robbins MN16-Feb-22 2:59
craig robbins MN16-Feb-22 2:59 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
dan!sh 16-Feb-22 3:06
professional dan!sh 16-Feb-22 3:06 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
PIEBALDconsult16-Feb-22 3:06
mvePIEBALDconsult16-Feb-22 3:06 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
kmoorevs16-Feb-22 3:50
kmoorevs16-Feb-22 3:50 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Matias Lopez16-Feb-22 4:05
Matias Lopez16-Feb-22 4:05 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Matthew Dennis16-Feb-22 4:21
sysadminMatthew Dennis16-Feb-22 4:21 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
OriginalGriff16-Feb-22 4:56
mveOriginalGriff16-Feb-22 4:56 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
DRHuff16-Feb-22 4:51
DRHuff16-Feb-22 4:51 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
k505416-Feb-22 5:12
mvek505416-Feb-22 5:12 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
kmoorevs16-Feb-22 8:05
kmoorevs16-Feb-22 8:05 
GeneralRe: Oh boy. I've given myself a challenge now. Pin
Gerry Schmitz16-Feb-22 8:22
mveGerry Schmitz16-Feb-22 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.