3 ms·
True, I should have said pointers and pointer arithmetic. In Pascal you cannot do these things because there is no pointer arithmetic to move along strings and
by coliveira 11y ago
True, I should have said pointers and pointer arithmetic. In Pascal you cannot do these things because there is no pointer arithmetic to move along strings and arrays.
- pjmlp 11y agoOnly if you are speaking about the boring ISO Pascal. All Pascal dialects like Apple Pascal and Turbo Pascal had pointer arithmetic.
- coliveira 11y agoThat was an extension to the Pascal language, it doesn't really change the way to write idiomatic code.
- pjmlp 11y agoMoving goal posts are we? Should I list all the compiler specific features that everyday C programmer uses but aren't defined in ANSI C, e.g. inline assembly? No professional Pascal compiler was a pure ISO Pascal, that error was left for schools teaching bad Pascal. Professional Pascal compilers were way more powerful than C, safer and in the days of K&R C chaos, just as portable.
- coliveira 11y agoI have made no comment about the quality of Pascal vs. C. In fact I like Pascal a lot, my comment is just on the way to write idiomatic code in each language. In C it is much easier and common to traverse data structures. Pascal may do it in some implementations, but its not how programmers used to organize their code. This just means that for C programmers it is frequently easier to work with NULL terminated strings.