|
I taught myself metaprogramming. That's kind of an issue because I have this code I wrote that I understand but can't explain to others, and when I try it tends to confuse people.
I don't think it's their fault.
Sure, maybe some of it is that metaprogramming isn't done so much day to day with C++.
But also it's because I lack the lexicon and foundation.
I'm not really sure what to do about that. Most of the material I've seen on metaprogramming leverages the STL in ways that are unavailable to me on some IoT platforms. Ergo, I wasn't going to be served functionally by learning the STL'ized version of this. I had to go to the metal, but I've never seen good material on it, except for stuff that explains the STL.
Meh. I feel like I've kind of painted myself into a corner. On one hand I can code all day like this, and I love the flexibility. On the other hand, I think my code might be something of a black box when you dig into it.
Real programmers use butterflies
|
|
|
|
|
You should try some Rust. I'm serious. I cut teeth on C++ (and a dummies book) in 1993 or so & I used C++ (a lot via MFC) for many years until C# really took over.
I think C# really did help to make nicer/gentler/prettier code for the most part. But of course that is because it had the privilege of being further from the metal in most cases.
Anyways, I recently wanted to see what all the fuss about Rust was so I picked up the fantastic book, The Rust Programming Language (Covers Rust 2018)[^] (No Starch Press) and started into it.
I built a little app (GitHub - raddevus/watcher: File System Watcher implemented in Rust - can watch events on directories & tail files (continuously watches files or directories)[^])which allows you to watch any part of your file system & runs natively on any OS. That's a very cool part.
Sidebar - You can learn a lot by watching what files are accessed by the system.
My Real Point -- And I Do Have One
Ok, but my point is that the things the Rust language developers have done to "fix C++" are amazing (though at times feel annoying & confusing when you are first learning) and they give you a new view of what Programming Languages are really trying to do and how many things were actually done improperly in other languages.
Being a C++ developer makes the experience of learning Rust far richer. I think you'd really like it.
Check Rust out and let me know what you think. Also, let me know what you think of my little file watcher app.
|
|
|
|
|
Will do. I've been meaning to but I've been doing so much IoT stuff these days I haven't had the chance. Rust doesn't target the hardware I target.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Rust doesn't target the hardware I target.
That's a good point. Now you got me thinking if anyone is working on that -- thinking how gnu toolchain could be leveraged to take Rust and build for different MCUs??? That wold be cool.
Someone is probably working on it.
|
|
|
|
|
Quote: I have this code I wrote that I understand but can't explain to others You are way ahead of me.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Do you really have to explain your code to anyone else? You usual way to is provide an API, document the classes and calls, and call it a day. Since, as I understand it, you are providing a library, that should be sufficient.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
In theory yes, because it implies that the code is at least somewhat understandable to somebody else, which is ultimately about readability and not burying intent behind things like layers of recursive template instantiations.
My APIs are usually as clean as possible. I'm actually pretty good at that, I think. I've had many other people compliment me on that, so in that particular area I'm confident.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: My code might be something of a black box when you dig into it.
This is the real goal of template metaprogramming.
|
|
|
|
|
My employer just announced that masks are optional. Let the naked face happy dance begin!
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote: masks are optional
Was it worded exactly like that?
Because what I see there is: "Come in dressed at Batman if you would like to".
|
|
|
|
|
I'm pretty sure I've seen cloth face masks with a Batman theme around here...
Software Zen: delete this;
|
|
|
|
|
This may sound an exaggeration, but seems true:
It is because of masks that we are alive today.
|
|
|
|
|
Amarnath S wrote: It is because of masks that we are alive today.
I am sure that vaccines, social distancing, minimal contact with others, cleanliness and sterilization where needed, boosted immune systems, natural immunity, and plain old common sense had a lot to do with saving lives as well. -- I could be mistaken; I usually am.
|
|
|
|
|
In addition to masks. Isn't it?
|
|
|
|
|
I hazard to guess that vaccines and natural immunity are more effective than masks at preventing COVID.
Can you site some studies or scientific data that indicates masks are the most important aspect to saving lives, because your original comment implies that we are all alive due to masks. you mention no other measures.
|
|
|
|
|
All of those restrictions Slacker mentions reduce spread. Only vaccines reduce severity.
|
|
|
|
|
Even the Delta variant had a 98+% survival rate, so yeah, your statement may just be a bit of an exaggeration.
If you think 'goto' is evil, try writing an Assembly program without JMP.
|
|
|
|
|
Does that now give people a right to rag on those that continue to wear masks? I'm trying to picture "dancing", but I can't.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Maybe so, but my group won't be doing it. One of our guys is immuno-suppressed after a heart transplant, so he'll stay masked.
Software Zen: delete this;
|
|
|
|
|
But didn't COVID teach us that pants are also optional????
To err is human to really elephant it up you need a computer
|
|
|
|
|
My least favorite part of being back in the office is not the pants, it's the shoes.
I would much rather be barefoot.
Software Zen: delete this;
|
|
|
|
|
My feet are in shock, I reintroduced them to shoes for the first time since I retired (I read somewhere that barefootedness promotes warts).
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I think that is bare feet in shared, public areas like gym showers or dance class. There is a very high chance that a child in (barefoot) dance class will have warts on their feet (pre covid). Post covid may have better sterilization!
|
|
|
|
|
And what is about pants and outerwear? Also optional?
|
|
|
|
|