Comment

Comment by antirez

Quoting from the article, with my replies:

> String manipulation in C is a tedious chore.

Use a dynamic strings library, like Postfix for instance, and everything else.

> C lacks good memory management.

So strange that you went for C++ for most of your code that is not immune of problems from this point of view. I could understand that point if you were opting for a language with GC support. With C you can easily get better (that is, safer) than C++ native MM just building a reference counting system on top of your C "objects". This is trivial and it is what Redis, Tcl, C-Python, and many others are doing.

With Redis memory leaks or memory management never was a big issue.

> Error handling is optional and cumbersome.

Exceptions mostly suck, and in system software the only sane way to deal with errors is C-alike IMHO, that is, check the return value / error returned by every function and act accordingly.

> Encapsulation and other object-oriented features must be emulated.

This is not an objective point since many thing that this features are actually a problem.

Weak points IMHO, and C++ and Python with the minority of Python looks like a design error.

parent antirez 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton