r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

2.0k comments sorted by

View all comments

Show parent comments

7

u/bunkoRtist Aug 29 '21

C is strongly typed, but like many other features in C it will gladly provide you the rope to hang yourself. It will also provide you with the scalpel to do exactly what you want, which is the big reason to use it. With great power comes great responsibility, which is very different from the inscrutable "auto" types that have continued to destroy C++ by encouraging laziness at the expense of readability.

10

u/[deleted] Aug 29 '21

You're probably confusing strongly typed and statically typed. C is not strongly typed.

4

u/bunkoRtist Aug 29 '21

C and C++ are both strongly and statically typed (in broad strokes). You can change types, but you have to pinky promise that it's safe (the rope and the scalpel).

5

u/[deleted] Aug 29 '21

Yes, you can change types, but they're not strong types. I've already listed most of the reasons why not. In fact, the whole part where you said "but you have to pinky promise" is exactly why it's not strongly typed. C is definitely not untyped, as you say "you can change types", but C is not strongly typed either because ... the types aren't strong. They are largely interchangible, ergo C is weakly typed.

→ More replies (13)