|
pretty sure that's something they teach you not to do in school, funny
~d~
|
|
|
|
|
Everything is a pointer for your interpretation...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
yes to this
Real programmers use butterflies
|
|
|
|
|
And when it breaks, everyone will be pointing at it.
|
|
|
|
|
I had a legacy program that had void****** as part of a sort routine.
It worked, i didn't now how.
The guy that wrote it was long gone and i spent a afternoon trying to figure out how it worked.
In the end i left it alone.
|
|
|
|
|
|
Member 14732673 wrote: In the end i left it alone. Really wise.
Never touch a running system, unless you really know how to fix it
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
That's the fun! Make a change and watch it break and fix the break is the only way to understand ancient code.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
"Make a change and watch it break and fix the break is the only way to understand ancient code."
While looking for a new job!
|
|
|
|
|
Well, I didn't say put it in production. But haha, that is a potentiality.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
That looks like a documentation trick to me. "I don't care what the heck is on the other side of the pointer". What was the max dereference level in the actual usage? A single level?
|
|
|
|
|
Such a right-thinking person.
Are you implying that there are languages that don't allow this, and force you to serialize using JSON or some other drool?!
|
|
|
|
|
something like that, yes.
Real programmers use butterflies
|
|
|
|
|
Program: Shoot in foot
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
|
The one about Forth is right on the mark.
|
|
|
|
|
The C++ one is even more accurate when pointers are involved !
|
|
|
|
|
I see no danger. Better than some other techniques.
|
|
|
|
|
C# has been improving a lot in that area. You can take a Span of various types (some mostly-reasonable restrictions apply) and use MemoryMarshal.AsBytes on it to view it has a Span<byte> , then stash it in a file or whatever. It's nice.
Actually paradoxically it's nicer than in C, because in C# you can actually control the layout of fields to whatever degree you need, so you can use this for file headers that have "unaligned" fields. C# is a better low level language than C.
|
|
|
|
|
Does it mandate the endianism and take the hit on non-compliant platforms, or is it still a problem for intersystem messages?
|
|
|
|
|
Unfortunately it's always in the native endianness, with no way to control it. An attribute for that is on my wishlist.
|
|
|
|
|
The proprietary language in which I worked for many years standardized its endianism and took the hit, so intersystem messaging was easy. It was designed when memory was precious--unlike today --so it was easy to control packing. For example, a bool was a single bit, and an enum could be packed into the fewest bits needed for its enumerators (negative values not allowed). We would only pad a field when performance was critical.
|
|
|
|
|
Hopefully people will come to their senses and switch from C# to Java, just saying.
~d~
|
|
|
|
|
Sure, and then they can't do any of this. No structs, no spans, no layout control.
|
|
|
|
|
why would I want to take a giant leap backwards?
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|