4 ms·
I think the reliability gap is in statically typed, compiled languages versus dynamically typed languages. I think C++ is a good combination of both worlds. You
by cjfd 3y ago
I think the reliability gap is in statically typed, compiled languages versus dynamically typed languages. I think C++ is a good combination of both worlds. You don't have to type quite as much for error checking an manual management and you get a correctly typed program by default.
- deleted 3y ago[deleted]
- xigoi 3y agoStatic typing is useless without strict typing. Knowing the type of everything won’t save you if you can multiply a pointer by an integer and use the result as a file handle.
- fanf2 3y agoFortunately even C and C++ compilers will complain if you try to do that.
- lelanthran 3y ago> Static typing is useless without strict typing. Knowing the type of everything won’t save you if you can multiply a pointer by an integer and use the result as a file handle. What language are you talking about? Go to godbolt and try that with any of the compilers there for C or C++.
- xigoi 3y agoCompiles with only a warning: #include <stdio.h> int main() { int x = 5; int y = &x; FILE *f = x * y; fputs("hello", f); }
- lelanthran 3y agoSo what are you complaining about? That the compiler told you "Don't do that" but you ignored it? I mean, you said: >> Knowing the type of everything won’t save you but the compiler is trying to save you! You have to actively work against it in order to hang yourself, and you blame the language?