Am 26.05.2013 09:36, schrieb Walter Bright:
On 5/26/2013 12:03 AM, Paulo Pinto wrote:
After being a Turbo Pascal heavy user, C always felt backwards to me
with its
weak types, lack of proper strings, modules and namespaces.

I had the opposite experience. Being a Pascal user from the late 70's, I
hated Pascal's limitations. A friend loaned me K+R and it was like
someone opened a window. I never wrote another line of Pascal; I threw
it under the bus, and couldn't work up any interest in TP (which came
along later).

Proper strings? Those length-prefixed ones that couldn't be longer than
255 characters? Argh. C botched them too with 0 terminated ones, but at
least they were usable.


Pascal string limitations were only an issue in classic Pascal, both Extend Pascal its sucessors Modula-2 and so on follow a model similar to what D offers.

Now it is too late for it, but at the time C could have stayed as powerful as it is while offering:

- proper modules, or at least namespaces

- no automatic conversions between arrays and pointers. how hard it is to write &a[0]?

- arguments by reference, no need to check for null for every parameter

- strong typed enumerations

- memory allocation without requiring the developer to use sizeof everywhere

- strings similar to what D has

- proper arrays, after all the compilers for other languages always offered control over when bound checking code was generated

In the end, same syntax, just some semantic improvements on the type system.

But now it is too late, we only have modern C++ with its warts, or hopefully D, Rust, Go, C#, or something else as possible replacement.

However, given that C and UNIX are one and only, it will outlive us all.

--
Paulo

Reply via email to