News for hackers. Stuff that matters.
Re:Zed Shaw on C++ by coliveira on Friday July 16, 2010 @10:04AM (#1521166)
> const-correctness may be another misfeature (I know I make fun of it), but the point isn't hard to see: if you take the time to const-correct your code, the compiler will spit out errors that would have otherwise been runtime faults.

I think it is so interesting the mentality of static typing people. I would much prefer handling the few resulting run time faults than having to stuff with my code with const.

Anyway, there is no guarantee in C++ that something that compiles with all consts in the world will not throw a segfault at run time in the least expected moment...

Re:Zed Shaw on C++ by amalcon on Friday July 16, 2010 @12:02PM (#1521525)
I think it's interesting the mentality of dynamic typing die-hards. I find it much easier (for complex projects) to just type "const" where appropriate and let the compiler think about mutability for me, than to think about mutability myself. The mental overhead is definitely superlinear with the complexity of the project, and typing "const" a few times lets me use that resource for more subtle correctness issues.

Of course, one problem with C++ (and, to a lesser extent, C) is that many of those subtle correctness issues are direct results of the type system in the first place. Go figure.

Re:Zed Shaw on C++ by tptacek on Friday July 16, 2010 @10:20AM (#1521206)
No compiler error ever ruined a NASA mission.
Re:Zed Shaw on C++ by edanm on Friday July 16, 2010 @03:36PM (#1522260)
Funny, but imo misses the point.

The beauty of dynamic typing is that it makes the writing of the code easier, which makes development shorter, which gives you more time to thoroughly test your code. After years leading a QA team, I'm convinced that more time testing is always superior to more time writing code, even if the code you're writing is there to stop bugs!

Re:Zed Shaw on C++ by jemfinch on Saturday July 17, 2010 @11:25AM (#1523916)
The beauty of static typing is that it consists of a proof that entire classes of errors cannot occur when your program runs. Like Dijkstra said, tests can only prove the presence of bugs, never their absence. Static typing proves their absence and is thus extremely useful in writing highly reliable software.