|
BernardIE5317 wrote: co-workers who each held me in contempt not to mention the 3 owners who disliked me as they were aware i believed each of them to be insane .
Wow. Just Wow.
But since then you have learned to not tell people that they are insane?
|
|
|
|
|
BernardIE5317 wrote: it quickly found the source of memory errors though the project failed miserably
Not sure what that means but you cannot find the memory problems you stated in C/C++ using static analysis. It requires runtime analysis and it requires, at a minimum, fully exercising the application. Even then there is no guarantee.
|
|
|
|
|
my recollection was faulty . it was merely detecting un-freed memory . this was long before C++ . the project was all C . though fences and vector of stack addresses and automatic inspection of fences upon freeing or at end of execution of un-freed memory vector and manual inspection of stack addresses in either case would work reasonably well far better than examining every line of code in project it seems to me .
|
|
|
|
|
I feel your pain.
Just located and fixed two buffer overruns yesterday where my code was writing I422 video to buffers sized for I420. It would run for hours, but just don't try to allocate/free anything! (... or try to make sense of the data that follows!)
|
|
|
|
|
So much nicer when it crashes immediately!
To err is human. Fortune favors the monsters.
|
|
|
|
|
Like BernardIE5317 and some others mentioned.
I remember using debug versions of malloc/free that would allocate a few extra bytes of memory at the end of a malloc() and write marker bytes in them. free() would check to make sure they survived. I think there were a few other tricks dealing with using special bytes for unallocated memory.
|
|
|
|
|
Hi All,
Being strongly encouraged (read forced) to use Python for a test rig. Okay need to get down with Kids etc. but syntactic white space 'align your tabs' (who came up with that, is it 1988, am I using a BBC micro) oh gord!!!
|
|
|
|
|
Worse: space and tab are not the same: so two lines which look to be identically indented in your chosen editor can be in different code blocks as a tab is one whitespace regardless of the visual effect.
"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!
|
|
|
|
|
Agreed but with intelligent Python editors why can't they convert between white space and tabs?
4 spaces = 1 tab
|
|
|
|
|
Most editors can, but they tend to default to "use tabs" to save file space.
And some only do it for modified lines, and ... it's a mess.
Just don't use Python is my advice!
"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!
|
|
|
|
|
Quote: Just don't use Python is my advice! Laugh | I'm with you, but "it's so simple and easy to use..." crowd are in force!
|
|
|
|
|
OriginalGriff wrote: Just don't use Python is my advice!
Friends don't let friends use Python.
I attempted to learn it a few moons back and found the tab-space thing to much of a deterrent.
|
|
|
|
|
Friends don't let friends use TABs.
|
|
|
|
|
|
It is scripted so it's slower than .NET code. And the UI? 
|
|
|
|
|
|
There's Codon for that:
[^]Python-based compiler achieves orders-of-magnitude speedups | MIT News | Massachusetts Institute of Technology[^]
>64
Some days the dragon wins. Suck it up.
|
|
|
|
|
You rarely if ever find a Python supporter who will agree that some other compiled language is orders-of-magnitude faster than Python.
Yet, when Python is compiled, it is speeded up by orders-of-magnitude.
The only logical conclusion is that compiled Python is way faster than any other compiled language. Believe it if you want to.
|
|
|
|
|
But it gives the correct answers when you have complex variables. Dot-net can't do that.
|
|
|
|
|
OriginalGriff wrote: Most editors can, but they tend to default to "use tabs" to save file space. To save file space???
You (or rather, those you refer to) can't be serious. In year 2023, you do not seriously use a tab character to save three (3) bytes of space! My home PC has two 16 TB disks, one 8 TB and one 1 TB M.2 main disk - that is almost 14 trillion (English - that is 'billion' in many other countries) times the space a tab character will save.
My home PC certainly has got more disk space than most home PCs. Not only have I been using digital video cameras since they came to the market - I imported one from abroad before they were introduced in Norway - but I also have had all my old video, Super-8 and old 8mm digitized. Yet, disk capacities are generally stated in terabytes nowadays.
If you need to save 3 bytes of space here, 3 bytes there, then I guess you also need to rule out file systems that allocate disk blocks of 4 Ki size; 512 bytes would be the maximum acceptable. Maybe you should go down to the old floppy disk standard of 128 byte sectors ... Even 512 bytes rules out NTFS, but I guess you could use some FAT variant. I am not familiar with all 42 Linux file systems, but I'd be surprised if not at least a few of them can be configured for 128 bytes allocation unit. If you worry about a waste of 3 bytes for a source file indent, you will probably want to use 128 bytes units.
|
|
|
|
|
OriginalGriff wrote: "use tabs" to save file space
I'm quite certain that isn't the reasoning. I think some TABophiles use TABs to save keystrokes.
I, of course, use two SPACEs per TAB and otherwise a whole ing load of whitespace, vertical space in particular. I am not interested in "saving space" or "saving keystrokes" I need space so I can read the stuff.
The simple IDE I developed for myself defaults to TABs because there is no reasonable number of SPACEs to use as a default instead. But what can save file space is that it right-trims SPACEs from lines when it saves a file -- that eliminates a lot more characters from saved files than using TABs.
|
|
|
|
|
The reason I use tabs is Shift+Arrow = Highlight - Tab/Shift-Tab = indent/deindent the block of text.
I use this so often when I code that I could scarcely be productive without it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: Tab/Shift-Tab = indent/deindent the block of text
Yes, using the TAB key, but it actually inserts/removes the necessary number of SPACEs rather than TABs.
I don't see that TAB characters makes a difference in doing that.
|
|
|
|
|
Oh, I think my editor uses tabs. So I just use them too. It would be weird anyway for me switching between Tab and spacebar.
In the end i always "Format Document" and I've got the process for that tailored more or less to my liking so it's easy and it works for me.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I'm not talking about using the spacebar to indent code. I don't think the issue is about what key is pressed, but about what characters are produced and stored.
Back when using a VT we had to indent by using the spacebar. But with modern(ish) IDEs we use the TAB key, and have it insert either SPACEs or TABs as configured -- the result looks the same, but it isn't.
I don't recall what Turbo Pascal and C/C++ did with TABs.
When I use Notepad, I still have to use the spacebar to indent because it uses eight-character-wide TAB-stops, but I don't use that for code.
|
|
|
|