News for hackers. Stuff that matters.
Re:14,000x Speedup (2015) by vidarh on Tuesday October 13, 2020 @11:00AM (#24766201)
Knowing if you're copying or passing references is essential to understanding most languages that supports both.

It's scary how many people are unaware of it, though.

Not nearly as dramatic as the example above, but I once cut the time spent on page generation for a commercial CMS by 30% my first day in a new job by realising they did excessive new allocation of strings instead of concatenation (which will amortise the allocations by allocating more space than needed in most C++ implementations).

I find it quite disturbing, because, while I prefer to use Ruby these days, C++ documentation is really explicit about guarantees provided by both the language and the standard library with respect to things like memory behaviour and algorithmic complexity.

There's if anything less going on under the hood with C++ that you're not explicitly told about than in most modern languages.

Re:14,000x Speedup (2015) by godelski on Tuesday October 13, 2020 @12:17PM (#24766970)
One thing I tell people is that beginning a good C/C++ programmer made me a much better python programmer and makes it substantially easier to pick up other languages. It's not so specific to the language being C as much as it is learning about memory and the what you learn by constantly shooting yourself in the foot because you make dumb mistakes (I still think mistakes are the best way to learn).
Re:14,000x Speedup (2015) by neves on Tuesday October 13, 2020 @03:13PM (#24769095)
I agree, but a simple automatically defined copy constructor can spread havoc in a code base.