[PyCharm is great, but IDEs just don't do dynamic code like they can static code and it hurts.]
[PyCharm is great, but IDEs just don't do dynamic code like they can static code and it hurts.]
The particular errors Carmack talks about are all holes in the type system - they're areas where the type system of C/C++ is unsound (as in the type-theory definition, not the colloquial definition). Null pointer exceptions don't exist in Haskell, because null pointers don't exist; you have to explicitly use a Maybe type. Printf errors do (at least with Text/Printf), but there's a lot of research on dependent types to solve specifically that error.
Again, though, it's a tradeoff. Haskell lets you find a lot of errors at compile time, but the tradeoff is that you spend much more time figuring out why your program won't compile. For a lot of software, you're better off shipping with bugs than not shipping at all. Particularly for exploratory software, it makes more sense to build something that works for your demo just to see if it's useful than build something for everyone that nobody wants to use. Specs that don't meet customer needs are just as buggy as code that doesn't meet the spec.
I'm not sure you can say that. `undefined` is a case of `error`, so it will blow up any time it's encountered (it's often used to stub code) not just when you try to use it, it's closer to putting a `throw` than to putting a `null`.
It's usually used to stub code during development in TDD-type scenarios:
myFunction = undefined
myOtherFunction foo = doSomethingWith value
where value = myFunction foo
will typecheck letting you fail your tests.You can't have `undefined` "pass through" your code the way `null` does.
You do. They're not statically checked, but they're there.
> I love Pyton/Ruby and other dynamic languages, but I miss the C++ type system when using them.
Why not use a language less syntactically heavy than C++ but still statically typed then? (and C++'s type system? not really going for the stars, are you?) Because a major part of Python and Ruby is indeed that they're not statically typed. A nominative static type system would yield quite different a language, probably something close to Cython[0]. Alternatively, you could fork Python or Ruby with a structural type system, this could be interesting but still — I think — different languages than their originators, not merely dialects. It also would be nothing even remotely close to "the C++ type system" (not that this would be a bad thing, AFAIC). And you probably wouldn't know "what types you're comparing" either.
http://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-...
Hell, Ada has every single feature he wants plus more. I'm particularly fond of the range feature.
type degrees is range 0..359;
It allows you not just to error on incompatible types, but incompatible values for your types at compile time. There's a lot more there, but I'm 100% positive it'll all be ignored by those who need it the most.I'm not sure how to make someone who isn't interested in learning history, learn history. Is this just a result of that our industry is entirely composed of youth?
If you legally have to have a meeting with 10 people to review and physically sign off on every line of code, your project will probably take a while.
Plus the compilers sucked in the 80's.
Do you mean that not having free side-effects of any kind anywhere is too restrictive?