Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: antiRepublicrat
That’s not strong typing, it’s duck typing.

The first part is duck typing. The error comes up because of strong typing. I think you're confusing strong typing with static typing. You can have a static strong typed system (Java), a static weak typed system (C), or a dynamic (or duck) strong typed system (Python).

A major problem with the C type system is implicit casts. You can define your type as a 2-byte integer, but you can add a 1-byte char to it or a pointer to it and the compiler won't even send out a warning. Sometimes that may be what you want, but the compiler should at least point out that you're operating across different types. Also, I would like a C compiler to tell me if I'm adding pointers when I probably don't want to (like when two char* are being added when I probably want to concatenate).

53 posted on 07/07/2009 10:59:17 AM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 44 | View Replies ]


To: dan1123
I think you're confusing strong typing with static typing.

Not completely. I was blending bits of strong, static and safe. But for example:

a = 20
b = 1
c = a + b

What will the result be? An int? A byte? A float? Python doesn't care, it's all an int, or a float if there's a decimal point. It will only catch egregious errors as you mentioned. I'm not a Python expert, so correct me if I'm wrong.

As far as dynamic typing, it's also bad for beginners. It lets them play too fast and loose. Thus we get a lot of code jockeys who don't really know how to program.

This looseness is also what I hate about Visual Basic and most other scriptable languages. Sure it lets you prototype faster, but there's a lot more to programming than the prototype. This is my main complaint in my recent foray into Objective C. I like the strong, static, safe, nominal typing of c#. But then I'm a control freak when it comes to programming.

59 posted on 07/07/2009 11:47:31 AM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 53 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson