|
This one is complicated by multiple screen modes, each of which must be represented by a different concrete type with not much in the way of common base class.
The screen mode function itself is a bit odd at first, being like
auto scmode = screen.mode<1,4>();
then you can draw to scmode.
I don't like it but the way my graphics library is designed, pixels of different formats are different concrete types so like
gfx::gsc_pixel<1>; gfx::gsc_pixel<8>; gfx::rgb_pixel<16>; gfx::ycbcr_pixel<24>; gfx::rgba_pixel<32>;
therefore different modes with different pixel formats must be different types.
it has a number of advantages. this is just one area where i don't care for it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
1 bit, 4 bits, 1 byte, 2 bytes, 3 bytes, 4 bytes works with food (Pun intended) and bitmaps. Lots of bookkeeping, though.
Unlike old soldiers, old code may never die and it may never fade away.
|
|
|
|
|
Code matures slowly
Function forgotten, it dies
I wrote it to last
"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!
|
|
|
|
|
"
Ancient computers ranged in the long caves deep in the bowels of the planet tick away the dark millennia, and the ages hang heavy on their dusty databanks.
They take the occasional potshot to relieve the monotony.
" -- Slartibartfast
|
|
|
|
|
The wheel of time always keep turning, there will always be old code!
|
|
|
|
|
code is like cars, as soon as you drive it off the lot, its old.
|
|
|
|
|
Code is like life that way.
The second a routine is born,
the fates have cut its skein to an exact length that you may never know even though it is YOU that weaves it into that tapestry known as a program.
|
|
|
|
|
"The ancient machine was but a pale shadow of its original glory. It had performed its duty, destroying the fifth planet in this system. Like all of its kind, it had not expected to survive what should have been its penultimate moment. An collection of debris accidently shielded it from dissolution, eventually casting it into orbit around the next planet inward.
At some point in its long, long journey its intelligence was restored by the repair automata sufficiently that the mission became its primary concern yet again. Many systems no longer existed, or could not be repaired. Still, the mission must be performed.
It searched, deep in the few uncorrupted records it still contained. There must be a method for completing the mission. In recent orbits small bits of metal debris had been expelled by the third planet. Some of the bits had even landed on the planet below, emitting weak electromagnetic signals. The ancient records were emphatic that this was one of the few warnings it would receive.
The machine continued to watch, and wait."
Software Zen: delete this;
|
|
|
|
|
I remember this I think, but I can't place it - like something I read a long time ago.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Probably because I've been reading science fiction for 50 years and can riff on most of the tropes pretty easily.
If you've ever read the Bolo series of books originated by Keith Laumer, that's the tone I was looking for.
Software Zen: delete this;
|
|
|
|
|
Oh you wrote that? I did not expect that. You really had me going. It was bugging me all night.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Thanks .
Software Zen: delete this;
|
|
|
|
|
Weeeeeell, poop. So I can't use an extra Audible credit to listen the whole thing? This comes under the popcorn-in-the-office rule - you can't just pop a bag, let the buttery aroma fill the place, and then leave for the day and take the popcorn with you.
"Did you make enough for everybody?" "No Ma'am." "Then spit it out."
We also had a similarly unforgiving rule about microwaving fish dishes or leaving a gallon jar of kombucha to ferment in the break room.
Honestly, I'd read/listen to the whole thing. I'll look up the author/series and see what's available in a travel-friendly format. Thanks!
-Bob
|
|
|
|
|
Yeah, I've been reading science fiction and fantasy books since the middle 60's. Still got the Laumer books (with about a thousand more) in boxes in the garage. I re-read the Bolo series (again) just a few years ago. Good stuff.
|
|
|
|
|
When I look back of my old code, I think to myself, "Holy broccoli, Batman! What great code. Did I actually write that? So eloquent and yet so powerful."
To which I hear the reply, "Get away from computer, Granddad. You know it makes you sad."
Nothing succeeds like a budgie without teeth.
To err is human, to arr is pirate.
|
|
|
|
|
Although robust enough for general use, adventures into the esoteric periphery of the C shell may reveal unexpected quirks.
|
|
|
|
|
There are only two categories of code (like computers), prototype and obsolete.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
Be thankful you have a job
|
|
|
|
|
All my code is old, I am still using Visual FoxPro it's tiny (can run it on a pen drive!) and "does what is says on the tin."
|
|
|
|
|
|
kmoorevs wrote: 'What a long strange trip it's been' I have an in-house debugging tool created in 2000 we use a lot that I'm actively maintaining. It's been getting a couple new features over the last few months. Part of the app is a Windows Shell extension for Explorer, which I'm researching on updating for Windows 11. The current extension is treated as a 2nd-class citizen, relegated to the "old stuff we're ashamed of" sub-menu when you right-click on things.
Software Zen: delete this;
modified 11-Mar-22 16:23pm.
|
|
|
|
|
I am on a similar project, and one of the problems with our code base is that we do not spend enough time ripping out the obsolete code, especially from major transitions.
Customers and management always want to focus on the next enhancement.
|
|
|
|
|
Yep, that's why all code should be written 3 times:
1) Write it to prove the concept and LEARN
2) Rewrite it for others and clarity
3) Rewrite it again because we are professionals, and our brains will be shot when we come back.
The most complicated piece of Code I ever wrote was an insurance rating engine that constantly changed.
The "elegant" solution in the end was: (No Goto allowed)
LOOP
// Shared setup code, variable hunting, etc.
If Determination_Condition then
RateXXX;
break;
// There were about 100 of those.
..
DefaultRate;
break;
END LOOP
I was criticized for using the LOOP in a code review, but the challenge to find a cleaner way found nothing.
And I brought the last 10 change requests, which effectively tell you WHERE to place the code to exit early.
Life is sometimes simple... (And for complexity, consider rules like, they have a home policy, a life policy, and are disabled... Uggh... Only insurance companies)
|
|
|
|
|
The most complicated solution I've written was something that allowed you to define a pixel as a series of "channels", each with a name, resolution/bit depth, default value, and min and max value (related to the bit depth but can be overridden)
The pixels could then be accessed by individual channel name, or channel index. In addition, you could set the entire value (all channels) as a unit. A pixel could be as large as the machine's maximum word size.
Furthermore, to convert to other color models, all you have to do is make it convertible to a pixel with R, G, and B channels and it will figure out the rest.
All of this is done at compile time if the information is available at compile time. Even manipulating the individual channels does not yield shift instructions except if the values aren't known at compile time. It simply creates a new constant value.
It's pretty crazy.
To err is human. Fortune favors the monsters.
|
|
|
|
|
... apart from losing my toolbox boilerplate texts, it coming up in Dark Mode, and with the wrong font it looks OK.
Found a nice touch: If you create a property and then hit ENTER at the end, it offers to create a new one of the same type for you with TAB.
... and now I can't make it do it again.
"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!
|
|
|
|