Comment

Comment by david2ndaccount

Pascal strings might be the only string design worse than C strings. C Strings at least let you take a zero copy substring of the tail. Pascal strings require a copy for any substring! Strings should be two machine words - length + pointer (aka what is commonly called a string view). This is no different than any other array view. Strings are not a special case.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton