Hacker News new | ask | show | jobs
by dh2022 74 days ago
I think the concern was conserving memory ( which was scarce back then) and not iterating through each substring.
2 comments

I am very sceptical about that. Much safer and cleaner languages like ML and Lisp were contemporary to C, and were equally developed on memory-scarce hardware.
They were also comparatively slow, no? And their runtimes used up much more of that scarce memory than a C program did.
Maybe on the high-end machines in some fancy lab somewhere?

All I saw were 386's and 486's, and I am pretty sure every piece of software I ever used was either C or Turbo Pascal or direct assembly. In the mid-90s, Java appeared and I remember how horribly slow those Java apps were compared to C/Pascal code.

But does it even conserve memory? Copying a string when you have the length is 2 bytes of machine code on x86 (rep movsb).

Remember, code takes up memory too.