Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Good call, writing C/C++ without having a grip on memory allocation is a recipe for exactly the kind of disaster we're in right now :)


Depends on the domain - i suspect that this question would cut off qualified application programmers who are not perfectly familiar with lower level/infrastructure code.


Not if they're writing C/C++; it doesn't really matter how hard you try to hide memory management when the whole language is designed around memory and pointers. What kind of programmer is that, anyway? Who can only program specific api's, as long as they don't touch the wrong parts of the language.


There are different strategies for handling perf problems of memory allocation - you can cache blocks of the same size in some linked list within the application (free list) or you can reconsider the allocator/allocation strategy. Both get the job done.

Preferance of the first solution does not make you a worse programmer.


What you're describing is essentially a pool, which could be thought of as a kind of allocator since it provides an allocation strategy. There's even one in the challenge that does just that. Nothing makes you a worse programmer except refusing to learn.


I would argue that except in the case of legacy software there's no reason to be using C/C++ for something that doesn't care about performance or memory overhead.

Even then it's useful to know how sentinel values and other features work if you don't dig into the performance aspect.


What kind of software doesn't care about performance or memory overhead? And why would anyone want to use it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: