← Back to context

Comment by dale_glass

4 years ago

Lots of functionality has been added that cost significant effort to implement, but people don't even notice it's there.

Eg, take calculating the length of a string. That's just "add 1 to count until reaching \0", right?

Not in the modern day, where you have UTF8, and what qualifies as a character is a lot more complicated than it used to be. A modern program, wanting to accurately calculate the number of characters in a string then brings up a bunch of UTF8 machinery with it. Then there's a good deal more than that to UTF8, so that also brings up a bunch of other code that is needed for other purposes, but for now may not be used.

But these days we mostly use GUIs, so instead of "length of a string in characters", you probably want "length of a string in pixels". In comes the TrueType library you need to parse the font and implement the virtual machine (!), because these days a font file contains code that helps the system produce the best possible result.

And so on, and so forth. Doing the most basic version possible in English on a fixed width text display with fixed width fonts is just a few bytes of code. Doing the modern version that takes into account things like that Japan exists quickly expands the problem to megabytes worth of code.