|
|
|
|
|
by clarry
3206 days ago
|
|
> Even such a simple use case is fraught with major problems:
>
> 1. who allocates needed memory?
>
> 2. who free's it? That's also a major feature. It allows people to write systems that are resilient in the face of tight memory limitations. It's not cool when a language forces string operations to allocate & duplicate memory willy-nilly. > 3. can the compiler constant fold cat("hello","world") ? Does the result wind up allocating memory anyway? I fail to see how that's a major problem. Why are you concatenating string literals? How common is that? > 4. what about the lack of function overloading to handle the permutations? I consider lack of overloading to be a feature. Overloading is one of the things that are way too easily abused, and it makes code auditing harder than it needs to be. Please just type out the different function names so I can see exactly what is going to be called when I read the code. Or use the sprintf family of variadic functions. |
|
With a GC and exceptions you can theoretically be quite resistant to OOM conditions, not that anyone really cares.