Skip to content

Comment on Making a StringBuffer in C, and questioning my sanity

Comments

What I don't like is that some functions take as arguments a mix of StringBuffer's and regular C strings. This is confusing. For example why this:

  void StringBuffer_replace(StringBuffer *buf,
    const char *original,
    const char *update,
    size_t from);
instead of this:
  void StringBuffer_replace(StringBuffer *buf,
    const StringBuffer *original,
    const StringBuffer *update,
    size_t from);
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.