Eloquently sums up my feelings about the disadvantages of dynamic typing

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Oct 16 19:36:18 PDT 2013


On Wed, Oct 16, 2013 at 10:16:17PM -0400, Jonathan M Davis wrote:
> On Tuesday, October 15, 2013 15:15:45 Walter Bright wrote:
> > http://www.reddit.com/r/programming/comments/1oi8wd/ruby_is_a_dying_language
> > /ccs8yr8
> 
> I can't possibly like any language where the type of a variable could
> change based on whether the condition in an if statement is true
> (because a variable gets assigned a completely different type
> depending no the branch of the if statement).

	auto func(alias condition)()
	{
		static if (condition())
			int t;
		else
			float t;
		return t;
	}

;-)


> I've never seen static typing as a burden. Rather, it's finding bugs
> in your program for you.
[...]

I think many people got the false impression of static typing being a
burden from historical languages where type annotations have to be
explicit all the time. With the advent of type inference, much of this
burden has been lifted, and this argument is no longer relevant.


T

-- 
Caffeine underflow. Brain dumped.


More information about the Digitalmars-d mailing list