Weak sucks, strong rules
-
the point is beginners rarely never follow tutorial whose subject is "refactor this 100 000 LOC project" It's harder to appreciate strong typing from the beginner point of view. For the one that already lost its hair once, the advantages are crystal clear.
Nicolas Dorier wrote:
harder to appreciate strong typing from the beginner point of view
Unrelated, but that reminds me of when I was just learning BASIC -- using floats (x) and heard about integers (x%), and thought, why would would I want to use an integer when the floats work just fine?
-
I'm in the middle of some serious refactoring (banking application)... Part of it is JavaScript code and the other part is C#. Whenever I do some changes in C# code I feel like in haven. Maintaining code (especially written by people who no longer work on the project) is soooo much easier within strongly-typed language. I just hope sanity will prevail and one day we will have a chance to write strongly-typed client side code too (directly and without plugins). And yeah, I like jQuery etc. but this recent blind love for JS is just scary...
-
Nicolas Dorier wrote:
harder to appreciate strong typing from the beginner point of view
Unrelated, but that reminds me of when I was just learning BASIC -- using floats (x) and heard about integers (x%), and thought, why would would I want to use an integer when the floats work just fine?
That was a good question :p I guess you understood when it bit you the hard way because, in some odd condition, (a / b) * b != a . Then you started to appreciate the beauty of integers :p
-
That was a good question :p I guess you understood when it bit you the hard way because, in some odd condition, (a / b) * b != a . Then you started to appreciate the beauty of integers :p
Nicolas Dorier wrote:
the beauty of integers
And recognized the ugliness of BASIC. :-D That was once I started learning Pascal.
-
vl2 wrote:
What's the point of strong typing if you still have to debug your code?
Presumably you either don't understand what strong typing is or you don't know how to debug any application.
-
Absolutely. What's a point of an incomplete type system which does not carry a correctness proof? If you go into strong typing, do it properly, or don't do it at all.
-
The fact that code compiles doesn't prove that business requirements are met. Strong typing makes live easier but it doesn't guarantee that program is doing what it should from end user perspective.
And how debugging is going to ensure such conformance? QA testing can help, yes, but not debugging. Debugging is useless, as long as your code is guaranteed to do exactly what is specified. If program is working incorrectly from end users' perspective, then specification have to be fixed, not the code.
-
And how debugging is going to ensure such conformance? QA testing can help, yes, but not debugging. Debugging is useless, as long as your code is guaranteed to do exactly what is specified. If program is working incorrectly from end users' perspective, then specification have to be fixed, not the code.
I didn't say that debugging is going to ensure conformance to business requirements. All I'm saying is that it is ridiculous to say that strongly typed programs don't need to be debugged. Strongly typed programs contain bugs too. And debugging (stepping through code with a debugger attached) is also a normal part of development. Sometimes its the only way to check what the program is really doing - cause the guys who wrote that +100K LOC (5 years ago) are no longer working at the company end documentation is almost non existing...
-
I didn't say that debugging is going to ensure conformance to business requirements. All I'm saying is that it is ridiculous to say that strongly typed programs don't need to be debugged. Strongly typed programs contain bugs too. And debugging (stepping through code with a debugger attached) is also a normal part of development. Sometimes its the only way to check what the program is really doing - cause the guys who wrote that +100K LOC (5 years ago) are no longer working at the company end documentation is almost non existing...
This is not what I said. I said, why bother using "strong" type system if you still have to debug your code afterwards? You either use a real, proper static type system and then you never have to debug your code interactively, or you'll be more flexible with a dynamic type system and do all that hipster interactive stuff. People tend to overuse interactive debugging, and it is really sad. Debugging is not a "normal" part of development. It should be considered a very last resort, when nothing else works. With a proper type system you don't have to step through your code to find out, what the program is "really doing" - types will tell you all about it straight away.