Linked by Thom Holwerda on Wed 7th Mar 2007 22:27 UTC
Java "Although the .NET vs. Java war is basically over for control of the Windows desktop, where .NET is sure to become the managed language of choice for new Windows desktop applications, there is a new battle brewing. That battle is for the Linux desktop. Now that Java has been open sourced under the GPL, even the most strict of the 'free software only' distributions can start bundling it and integrating it into their Linux distributions out of the box."
Thread beginning with comment 219763
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[5]: Only Two Choices?
by Mystilleef on Thu 8th Mar 2007 21:34 UTC in reply to "RE[4]: Only Two Choices?"
Mystilleef
Member since:
2005-06-29

Static type checking is overrated. And does almost nothing to alleviate software complexity or reduce bugs in typical software programs. When was the last time a type error brought a project to a hault? In my experience writing programs with both statically and dynamically typed languages, type errors have been the least of my concerns. And I only realized that after writing a medium scale project in a dynamically typed languages.

What static type checking does is give impressionable developers a false sense of security. The reality is that disasterous bugs in software are only found via testing. Unit automated testing, regression testing, user testing and manual testing are the scientifically proven ways to ferret out bugs in software, not fanatically checking data types whether or not it makes sense. Type errors are cheap to discover and fix in about every language I know. Python, in particular, points you to exact function and line a possible type error may have occurred, albeit during testing.

The errors most developers have nightmares over are the ones related to design, semantics, threading (race condition, dead locks, etc), inadequate understanding of the problem space or inexperience, bugs in third party libraries, poor or lack of documentation among many others. I have yet to a see a developers grow gray hair over type errors.

Static typing is something smart compilers should manage for programs. In fact, some smart compilers already do that. Haskell's compiler has an impressive inference engine that many statically typed languages should emulate. The single significant advantage of static typing is optimization and performance tuning. Errors with respect to types are almost always insignificant and cheap to discover. A programmer's greatest challenge should be design, not fighting around needlessly with compiler errors or language semantics.

Reply Parent Score: 1

RE[6]: Only Two Choices?
by RandomGuy on Fri 9th Mar 2007 10:29 in reply to "RE[5]: Only Two Choices?"
RandomGuy Member since:
2006-07-30

I feel that both, static and dynamic typing, can be a pain if they're forced on you. That's a problem that I encountered in C++ for example:

I'm writing some sort of function and don't yet know what sort of input it's going to take but I need some sort of temp variable. Problem: I need to declare the variable AND it's type at the same time - all squeezed into one tiny statement. Yes, I know there are templates but they're just a pain in the a**!

On the other hand, sometimes you WANT to give type information. As a comment, to increase performance and, last but not least, for polymorphism types are imho essential.
But they should be dynamic so that you could e.g. first use something as a vector with vector addition and multiplication and then use it as a list like this:
my a, b
a=(1, 2, 3)
b=(-1, 1, 0)
(a, b) are vectors
a+=b // a is now (0, 3, 3)
a/=3 // a is now (0, 1, 1)
(a, b) are lists
a+=b // a is now (0, 1, 1, -1, 1, 0)

That'd be sweet!

Reply Parent Score: 1

RE[7]: Only Two Choices?
by ma_d on Sun 11th Mar 2007 00:31 in reply to "RE[6]: Only Two Choices?"
ma_d Member since:
2005-06-29

Some statically typed languages are introducing inferred types which you might find interesting (although I think you'd need to be dilligent in replacing their use once you're done experimenting). C# is an example, I believe in 3.0 the "var" keyword now means to use an inferred type.

Reply Parent Score: 2

RE[6]: Only Two Choices?
by ma_d on Sun 11th Mar 2007 00:36 in reply to "RE[5]: Only Two Choices?"
ma_d Member since:
2005-06-29

Static type checking is a minor general form of testing. By giving it up you're simply adding one more test onto your unit test requirements... I see no reason to rewrite this over and over when general algorithms have been _mathematically proven_.

You admit you're going to test the typing anyway so why not just have the compiler do it?

As I pointed out before, Python has a similar tool: PyChecker. You might try reading posts before you spout off self-righteously as if we told you your favorite language was bad, which I don't think anyone has.
Python is one of my favorite languages, I use it quite often. And not just on tiny problems.

Reply Parent Score: 2

RE[7]: Only Two Choices?
by Mystilleef on Sun 11th Mar 2007 00:54 in reply to "RE[6]: Only Two Choices?"
Mystilleef Member since:
2005-06-29

Your claim that dynamically typed languages is not good for "complex" projects/problems is bogus. I could care less if Python is your most or least favored language.

Reply Parent Score: 1