News for hackers. Stuff that matters.
Re:Comparing C and C++ usage and performance with a real wor... by jgh on Sunday September 03, 2017 @11:40AM (#15161986)
Reminds me of this anecdote I came across on the internets one time: https://groups.google.com/forum/message/raw?msg=comp.lang.ad...
Re:Comparing C and C++ usage and performance with a real wor... by jamiek88 on Sunday September 03, 2017 @11:54AM (#15162080)
The ultimate in garbage collection indeed!

Highly recommend reading that short tale! This lore is slowly being forgotten, thanks for that link.

Re:Comparing C and C++ usage and performance with a real wor... by pjc50 on Sunday September 03, 2017 @12:43PM (#15162389)
See also https://www.ibiblio.org/harris/500milemail.html

(Is there a canonical lore repository for this kind of thing, other than the Jargon file?)

Re:Comparing C and C++ usage and performance with a real wor... by jgh on Sunday September 03, 2017 @04:48PM (#15163822)
haha that's a good one!
Re:Comparing C and C++ usage and performance with a real wor... by tjalfi on Sunday September 03, 2017 @01:59PM (#15162817)
I submitted this post to HN a few months ago.

The discussion is at https://news.ycombinator.com/item?id=14233542

Re:Comparing C and C++ usage and performance with a real wor... by jimktrains2 on Sunday September 03, 2017 @04:02PM (#15163544)
It seems you can no longer view Google groups without logging in?
Re:Comparing C and C++ usage and performance with a real wor... by blub on Sunday September 03, 2017 @12:42PM (#15162381)
I have heard of calculating a "memory budget" and pre-allocating that, but calculating a "leak budget" and doubling that doesn't seem like hygienic programming.
Re:Comparing C and C++ usage and performance with a real wor... by coldtea on Sunday September 03, 2017 @01:34PM (#15162665)
Doesn't have to be hygienic, it's enough that fixing it doesn't justify the time/money costs for the programmer.
Re:Comparing C and C++ usage and performance with a real wor... by blub on Sunday September 03, 2017 @06:58PM (#15164462)
We wouldn't want the programmer to spend too much money/time on fixing errors. After all, it's not like people would die if there's an error in the missile software: http://www.gao.gov/mobile/products/IMTEC-92-26

Not to mention they added even more HW to work around the leaks. No wonder those projects always run over budget.

Re:Comparing C and C++ usage and performance with a real wor... by coldtea on Monday September 04, 2017 @04:08AM (#15166540)
>We wouldn't want the programmer to spend too much money/time on fixing errors. After all, it's not like people would die if there's an error in the missile software

When exactly did pkg_config became missile software?

As they say in meme-land, "that escalated quickly".

Here's a novel idea: how about the appropriate level of effort/time/YAGNI-stuff based on the domain?

Or do you write one-time scripts with MISRA rules?

Re:Comparing C and C++ usage and performance with a real wor... by blub on Monday September 04, 2017 @07:19AM (#15167366)
The sub-thread I replied to was linking to an anecdote about missile software.

But I still think not freeing is pretty lame even in short-lived tools. If one is using a no-op deallocator at least the code is designed properly and could be repurposed.

Re:Comparing C and C++ usage and performance with a real wor... by CJefferson on Sunday September 03, 2017 @02:33PM (#15163017)
The problem with counting leaks is it counts memory you need until the very end of your program. There is no point calling free as you are exiting anyway, and I have seen programs where freeing everything took .5 seconds as the program was closing.
Re:Comparing C and C++ usage and performance with a real wor... by nitrogen on Sunday September 03, 2017 @03:09PM (#15163225)
As someone whose startup was probably hindered by an almost religious adherence to testing with Valgrind (hardware was way too slow), I'd still say finding the real leaks and bugs is a lot easier when you don't have the noise of "expected" leaks.