News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by CriticalCathed on Saturday September 21, 2019 @02:23PM (#21037001)
Strict typing afaik isn't really a formally defined, imo.

As you know C is statically typed and generally said to be "weakly typed" as well but you can make a strong argument that just about any language is "strong" or "weak" -ly typed based on a dozen or so characteristics. I think it makes more sense to treat it as a spectrum where some languages are "stronger" than others. Which is different than in the case of "static typing" which you either have or don't.

Re:Why I Write Games in C (yes, C) by sgt101 on Sunday September 22, 2019 @03:36AM (#21040134)
Oh come on, I was taught the difference between strong and weak typing with C (weak) and Pascal (strong) as the examples 30 years ago. You can cast a C entity to something else and NO ONE ELSE KNOWS.

Then THINGS happen.

BAD things.

Re:Why I Write Games in C (yes, C) by unnouinceput on Sunday September 22, 2019 @08:52AM (#21041138)
While Pascal is indeed strong typing and C is weak typing, casting is allowed on both at compile time and introducing bugs this way is not going to be stopped by compiler. Here is what a compile will behave in C vs Pascal:

C code:

int i = 1; char s = "1";

{

if (i == s) //<--- this will be allowed by compiler in C because C is weak typing, and will comeback later to bite you at runtime

{

//bla bla

}

}

Pascal code:

var

i : integer = 1;

s : string = '1';

begin

if i = s then begin //<--- this will not be allowed by compiler in Pascal because Pascal is strong typing

//bla bla

end;

end.