|
Would doing it at run-time be preferable? Sounds like not.
|
|
|
|
|
It's not practical, and in some cases I don't think it's possible? I'd have to think around too many corners right now to be sure of that last bit.
I like the way I'm doing things, but if there's a better alternative I'll take it, particularly where maintenance is concerned. It's hard to even get the compiler to instantiate all of my templates and thus compile all of it, much less test it at run time. I've run into compile errors on versions I've released (early on, but yikes).
To err is human. Fortune favors the monsters.
|
|
|
|
|
Back in the days before the craze of header only libraries, we used to have statically linked libraries and you would use one such library for for your specific hardware.
Frankly, I see no merit in having some humongous headers that could work on 100 devices as long as I'm going to use it with just one display adapter. It seems to me you are forcing your users into un-needed complexity with the dubious benefit that you have a single code base.
Might sound harsh, but it's written with best intentions in mind
Mircea
|
|
|
|
|
You can't export templates from a static library and I can't do what I'm doing without templates.
And the actual display drivers ship separately.
The adaptability that I mentioned in my post prior is so I can use any given display driver as efficiently as it allows for.
Edit: My library contains several headers, but it does things like True Type fonts, and JPGs. I can't practically put that all in one file unless I get the computer to help me merge working files and I don't see the point. It's a lot in there is my point here, but the drivers themselves are relatively simple.
To err is human. Fortune favors the monsters.
modified 23-Apr-22 16:44pm.
|
|
|
|
|
honey the codewitch wrote: It strikes me as an anti-pattern I'm not fond of the phrases "anti-pattern" or "code smell", because all too often they are used to criticize code without knowledge of the constraints and compromises that went into writing it. Fortunately you document very actively.honey the codewitch wrote: The templates to make this happen are a mess, but I don't know how else I can achieve the sort of flexibility and efficiency I enjoy with this technique. My experience with templates (and their predecessor, #define macros) is that their capability needs to be matched by documentation that explains why they are defined and used in a particular way, and how they contribute to the problem solution. This need is far greater than that for ordinary code. It's especially true for templates given that even today compiler diagnostics for them usually have a lot of 'cognitive distance' between the problem and the actual cause in the source.
Software Zen: delete this;
|
|
|
|
|
It sounds like C++ template meta programming. If you haven't looked into it, maybe some of the techniques might help make your code more readable.
|
|
|
|
|
It is template metaprogramming, but a particular technique involving it, and unfortunately I can't use most of the pre-fab stuff because the STL is barely available on the platforms i target.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I am disgusted with Edge this morning: They started posting "help" with the daily wordle on the Edge home page. In one post they will tell you what letter the daily word starts with. In another they post further clues, like the letter the word ends with.
And you cannot avoid the clue. It glares at you when the home page opens.
I am going to have to change my browser home page. I think I will change it to Code Project.
Get me coffee and no one gets hurt!
modified 22-Apr-22 9:56am.
|
|
|
|
|
I'd start by changing my browser ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Cp-Coder wrote: I am disgusted with Edge this morning Fixed that for you. Who uses Edge other than for downloading some other browser ?
|
|
|
|
|
I use Edge for everything. However I do agree that giving the first letter of the daily Wordle is wrong.
|
|
|
|
|
I use Edge. Been using it for months
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
|
First Wordle problem?
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Whats a worlde? And how does it affect grown ups?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hopefully, this craze will pass sooner rather than later. This "you did it in 4, I did it in 3, hooray for me" is getting old. Real old. I do 0/0 every morning.
>64
Some days the dragon wins. Suck it up.
|
|
|
|
|
|
I am rubber, you are glue.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
<snark> I use edge all the time with the home page set to DDG.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
|
Artificial intelligence for all. Every time I see that, I still wonder if that means that we all are naturally dumb and desperately need that.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I am sorry I do not get that.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
HE SAID.... [Loudly and slowly]...
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
yes, what did he say?
I wonder when this great joke of mine will be understood. We are dumb, we need AI
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[ ^]
|
|
|
|
|
You are just trolling😊
Thanks for the footnote.
|
|
|
|