News for hackers. Stuff that matters.
Re:Git's list of banned C functions by ajuc on Friday March 05, 2021 @04:28AM (#26354824)
Everything was faster in C - it was compiled and BASIC was interpreted.

Better comparison would be between C and Turbo Pascal strings in DOS times. TP strings were limited to 255 characters but they were almost as fast as C strings, in some operations (like checking length) they were faster, and you had to work very hard to create a memory leak or security problem using them.

I've learnt Pascal before C and the whole mess with arrays/strings/pointers was shocking to me.

Re:Git's list of banned C functions by schlupa on Friday March 05, 2021 @10:13AM (#26357674)
UCSD and Turbo-Pascal had it easy with the 255 byte strings. They had real strings but these were compiler extensions. Real Pascal didn't have string support and you could only work with packed array of chars of fixed size and as the language was extremely strong types, to packed chars types of different lengths were considered different types, so you had to write procedures and functions for all used packed array sizes.
Re:Git's list of banned C functions by mcguire on Friday March 05, 2021 @11:25AM (#26358633)
Brian Kernighan on "Why Pascal is not my Favorite Programming Language" (https://www.lysator.liu.se/c/bwk-on-pascal.html) [1981].

Turbo Pascal wasn't released until 1983, if the wiki is to be believed.

Re:Git's list of banned C functions by ajuc on Friday March 05, 2021 @12:20PM (#26359297)
I find it strange that he complained about Pascal's lack of dynamic arrays, when the Pascal solution is to use pointers (exactly what C does for all arrays and strings anyway).

Many of his other points are solved by Turbo Pascal and Delphi/Object Pascal.

But of course nowadays there are better languages for real world programming. It's just a shame that there's nothing as simple and elegant for teaching programming ().

() lisp is even more elegant, but it has a lot of gotchas and it's so far from mainstream that using it for teaching isn't a good idea IMHO

Re:Git's list of banned C functions by indymike on Friday March 05, 2021 @06:41AM (#26355736)
I learned C before Pascal and having to write so much code to deal with 255 character limits was kind of jarring.