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

To: dan1123

That’s not strong typing, it’s duck typing. You didn’t have to declare a, b and c since they took on an assumed type of whatever you assigned to them. It then got caught during runtime, not compile time.

When I program I would wonder is a an int? Maybe it want it to be a byte, decimal, floating point, small (2-byte) int, large (8-byte) int, signed or unsigned.

Duck typing is not necessarily inferior, it’s just a style of programming I don’t prefer. But I do think a programmer should become proficient in strongly-typed design before he goes off with something like Python and produces a horrible, unmaintainable mess.


44 posted on 07/07/2009 6:57:26 AM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 36 | View Replies ]


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: antiRepublicrat

75 posted on 07/07/2009 4:17:45 PM PDT by Mr. K (THIS ADMMINSTATION IS WEARING OUT MY CAPLOCK KEY DAMMIT DAMMIT DAMMIT!!!!!)
[ Post Reply | Private Reply | To 44 | 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