|
As Ox01AA said, bytes or nibbles work. And ideally it would be nice if endianness was indicated somehow.
Jeremy Falcon
|
|
|
|
|
Would converting those nibbles to hex be more convenient? I mean more human-readable.
|
|
|
|
|
I am writing a "super_format_integer" routine which generates every conceivable format string id est hex dec oct bin SI IEC words and provides every conceivable option for each base.
|
|
|
|
|
Wow!
Will be valuable if it comes up here on CP as an article.
|
|
|
|
|
My very first experience with programming was on a Univac 1100 system, so I'd prefer "010101 010101 0101xx". However, halfword support was somewhat limited on the U1100, so usually, it would be "010101 010101 010101 010101 010101 010101".
For a more compact format, I would use octal: "444444".
(On the serious side: In the 1950s, 60s and to some degree the 70s, a lot of machine architectures were based on units of 3 bits - there were 12-bit, 18-bit, 24-bit, 36 and 72-bit register widths and instruction word sizes. There even was a 42-bit machine (GIER) - but it doesn't really count, as 42 bits only applied to float: A 10 bit exponent and a 32 bit mantissa.)
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Groups of four bits are the quickest visual to understand: 0101 0101 0101 0101
There are no solutions, only trade-offs. - Thomas Sowell
A day can really slip by when you're deliberately avoiding what you're supposed to do. - Calvin (Bill Watterson, Calvin & Hobbes)
|
|
|
|
|
It's about 4 years old, messy, in one file, and works great. You know how it is.
It's time to retire it.
But it feels like having really long luxurious hair that's about to be shaved off.
I am going to cringe while deleting this file. Oh I can just feel it.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
If it's under source control, its not really gone, is it? But it's still like lopping off a limb, or something. There's always that little voice in the back of one's head "But what if I need it, later?"
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
Some times when I visit museums, I feel like a teenager: I walk around among all that age old stuff, asking, "Why does anyone spend resources on keeping all this old sh*t? Some of the utensils (or whatever they are), not even the museum guides can tell what they are for! If you throw it all away, noone would really be affected (except the museum guides)."
As long as there is the slightest chance that the code will be taken into use in the future: Sure, you can keep a copy in a source control system. But some code is just dead forever. Who would ever need the driver code for a Fastrand drum? ("A device for storing angular momentum", according to one dictionary.) Even if you wrote your own DOS driver for an 8" floppy disk: You don't have the hardware for it today. If you find some old 8" floppies, you have to go to some specialist data recovery company to have it read, if a all possible.
Another aspect: How many source control systems have I been through in my professional life? About half a dozen different ones. For most of them, I could probably dig up some code to run it on today's hardware, but that is only because a few people still use them. If I want to look at the code 30 years from now, chances are that it doesn't matter if the software is unavailable, because it is stored on an obsolete medium. Or the other way around: It doesn't matter if the medium is obsolete, because you have no software for that kind of device anyway. I've got files on 7-track half-inch tape reels, 8" floppies in a non-IBM format (different low-level formatting), DCT-300 and DCT-100 tape cassettes, two different Travan tape formats, 8 track punched paper tape and punched cards. I keep them to show people the medium, not the stored information. You can't that easily show your (grand)kids what a - now defunct - source control system looks like
So, be honest to yourself: Realize that these files will never, ever have any sort of value in the future. Do not tuck them away in your attic, when there is no reason at all to do so.
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Never throw anything away.
At times I'll change an extension, e.g. from .c to .c! so it won't get accidently compiled. Recently I have also zipped up some code I don't want to pollute my builds.
P.S. I'm also spending some time searching for a snippet of code (C) I'm sure I wrote a while back, but I probably don't have a copy of it. I wound up writing a new version of it on Friday, but I want to know what the old version was.
modified 25-Aug-24 11:44am.
|
|
|
|
|
PIEBALDconsult wrote: I want to know what the old version was.
Ask the NSA; they probably have a copy somewhre.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
My view
This weekend I finished finally migrating some 30 year old Modula 2 code into c++. To keep track of everything (having the history of source code and the target code consistent), I added the Modula 2 code (< 10MB ) also to the repository.
I know, I'm a nitpicker, but I have no problem with that
modified 25-Aug-24 12:28pm.
|
|
|
|
|
I always found it very satisfying to delete code that was no longer needed because of refactoring.
|
|
|
|
|
I was about to write very same, but you beat me to it.
I must "admit" that I have saved a few files of source code, some of them more than 45 years old, but that is mostly for "The Weird and The Wonderful" kind of use. Especially if the file is in some now-abandoned language, such as Snobol or APL, I may enjoy taking a look at the old code and ask myself (noone else cares : "Why didn't we preserve that mechanism in modern languages? And that one?
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
don't delete it. You will regret it one day. archive it for future reference. bytes are cheap.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I predict that in about two weeks you're going to post about how you wish you had saved it this code because suddenly you had a need to look at it again.
|
|
|
|
|
Wordle 1,163 4/6*
🟨⬜⬜🟨🟩
🟩⬜🟩⬜🟩
🟩🟨🟩⬜🟩
🟩🟩🟩🟩🟩
"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!
|
|
|
|
|
⬜⬜🟩⬜🟩
⬜⬜🟩🟨🟩
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,163 5/6*
🟨🟨⬛⬛🟩
⬛⬛🟩🟩🟩
🟩⬛🟩🟩🟩
🟩⬛🟩🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,163 4/6
🟨⬛⬛⬛🟩
🟩🟨🟩⬛🟩
🟩⬛🟩🟩🟩
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 1,163 3/6
⬛🟨🟩⬛🟨
🟩🟨🟩⬛🟩
🟩🟩🟩🟩🟩
Jeremy Falcon
|
|
|
|
|
Wordle 1,163 5/6
⬜⬜⬜⬜🟩
🟩⬜⬜⬜🟩
🟩⬜🟩⬜🟩
🟩🟨🟩🟨🟩
🟩🟩🟩🟩🟩
Within you lies the power for good - Use it!
|
|
|
|
|
Wordle 1,163 4/6*
🟨⬜⬜🟨🟩
🟩⬜🟩⬜🟩
🟩🟨🟩🟨🟩
🟩🟩🟩🟩🟩
An argument can be made that I actually solved it in 3.
|
|
|
|
|
I just read this, about someone comparing to C to Zig...
Let's say that Zig is a walk with your beautiful girl on a sunny park. You know it's gonna be nice. And C is like... I don't know... like snorting cocaine from a knife with THAT friend who is a terrible influence. If things go well, the rush is incredible and you think "Nah, screw my girlfriend, this is so much better", but there's also a medium risk you suffer from a crash, paranoia, anxiety, pain in the chest, etc. Seasoned devs/drug fiends will know more or less how much they can take without suffering the consequences, but as a newcommer you are not as safe as them. Oh man... that's just gold.
Jeremy Falcon
|
|
|
|
|
No C is like your wife/SO/partner/whatever, solid, dependable and has got your back.
Zig is like the new girlfriend; an exciting experience, new, fresh, exhilarating but you're wondering; will it last, will they stick with me?
Will they put up with all my BS?
Had to add that last bit.
A home without books is a body without soul. Marcus Tullius Cicero
PartsBin an Electronics Part Organizer - Release Version 1.4.0 (Many new features) JaxCoder.com
Latest Article: EventAggregator
|
|
|
|