17 ms·
Older, less elegant programming languages like C have no memory model, you manually allocate and deallocate everything, and play with a lot of pointers. The syn
by mikewarot 5y ago
Older, less elegant programming languages like C have no memory model, you manually allocate and deallocate everything, and play with a lot of pointers. The syntax is designed to be as compact as possible, without regard to danger, because it was created in the days when programmer time was far less valuable than CPU time.
Older, more elegant programming languages like Pascal also had you manually dealing with allocations, but were far more careful about pointers, and made it very easy to see when you were dealing with pointers instead of normal variables, by using a carrot ^ to denote indirection. This made it fairly safe for programmers to think about things, and make far fewer mistakes. Turbo Pascal upped the game by including a quite complete run time library, and by avoiding the mistake of null terminated strings that was made in C. Additionally, it reference counts strings and makes allocation automatic, so you can do things like delete the first character from a string, with no need to deal with pointers.
Unfortunately, the lesson learned was that programmers can't be trusted with anything dangerous, instead of making it easy to see danger. This is why Rust exists, and is given so much praise, despite a better alternative having languished in the shadows for so long.