News for hackers. Stuff that matters.
Re:Best aspects of C by int_19h on Thursday November 19, 2020 @03:44PM (#25154123)
When it comes to declarations, the world is already moving over to Pascal's syntactic conventions in some ways. In newer languages, you see something like this:

   var x: *int;
more often than:

   int* x;
i.e. type name follows variable name, and type modifiers work more like unary prefix operators on types. And this is because it's less ambiguous to parse, and makes more complex types a lot easier to read, since you simply go left-to-right, instead of C's "spiraling" declarations.

The rest of Pascal's syntax is not particularly problematic, either. I'd say that the two biggest problems with it were begin..end for blocks, and having all local declarations in a block separate from code. But Modula-2 already dropped "begin", and various Pascal dialects added inline variable declarations eventually. So, on the whole, I think we'd actually be better off in terms of code readability if Modula-2 rather than C became the standard systems programming language.

Re:Best aspects of C by Gibbon1 on Thursday November 19, 2020 @03:53PM (#25154215)
Thing that makes me somewhat sad is there isn't much reason why you couldn't fix some of C's syntax and other issues. I feel like any breaking changes wouldn't be that big of deal as long as you have a backwards compatible ABI.

Say you add fn and var as keywords. Exactly how hard would that be to fix? You could probably write a tool to do that.