0:00
/
0:00

Paid episode

The full episode is only available to paid subscribers of Computer, Enhance!

Q&A #81 (2025-12-22)

Answers to questions from the last Q&A thread.

In each Q&A video, I answer questions from the comments on the previous Q&A video, which can be from any part of the course.

The questions addressed in this video are:

  • [00:04] “What are your top 5 recommendations for must have projects or applications to build at least once in your life to make you a better programmer ?”

  • [14:32] “My question is regarding your previous comment on stack below, where you mentioned that we don't want to do a lot with the stack for performance oriented code. Before this course, I had impression that I should prefer stack allocation to heap allocation (maybe just C++) because I read/watched somewhere saying that 1) stack allocation/dealloc is faster (just move the stack pointer) than heap allocation 2) stack object has more obvious lifetime, 3) stack has no fragmentation concern which improves locality 4) you call on stack object directly while heap object involves indirection.

    I wonder whether my understanding above is correct or not. If not, does that mean I can prefer using heap over stack allocation most of the time? Could you please further comment? Thanks!”

  • [32:48] “One idea is to avoid dynamic allocation in the critical path by pushing each measurement into a dedicated logging/profiler thread through a channel. The worker thread would record measurements while the computation threads only perform the minimal ‘send’ operation. But atomic operations, queues, and cross-thread communication can also add overhead, but also distort the original program execution … I’d like advice on how to judge whether this dedicated-thread idea is sound, and in general how to think about designing a low-overhead profiler.”

  • [44:20] “What is your opinion on using callbacks for say signal handling? They often seem necessary but I may be overusing them, which leads me to believe my overall architecture could be flawed. But generally speaking, what’s your view on callbacks? Love them or hate them? Do you try to avoid them?”

The full video is for paid subscribers