5 ms·
Thank god for C winning that battle. Imagine a world where most the languages follow Lisp's syntactic conventions, or Pascal's. What a nightmare.
by young_unixer 6y ago
Thank god for C winning that battle.
Imagine a world where most the languages follow Lisp's syntactic conventions, or Pascal's. What a nightmare.
- Banana699 6y agoAs opposed to C's syntactic conventions, the absolutely gorgeous mush of *s, &s, __MACRO_LIKE_FUNCTIONS___() and #preprocessor directives The default is not the best, the default has just beaten the world so many times on the head that anything else became foreign and weird and got laughed out of the room before it even had the chance to say anything. One programming language history book/blog/paper a day keeps the nonsense notions away, C "Won" like people win the lottery or the roulette.
- int_19h 6y agoWhen 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.
- Gibbon1 6y agoThing 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.