help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check for redundancy


From: Robert Thorpe
Subject: Re: Check for redundancy
Date: Sun, 28 Jun 2015 22:38:42 +0100

Emanuel Berg <embe8573@student.uu.se> writes:

> <tomas@tuxteam.de> writes:
...
> Indeed. For untyped languages, why put the types in
> code where they aren't actually types anyway?

Just because there aren't types doesn't mean that variables don't have
types.  What "untyped" means is that the language doesn't enforce typing
for you.  That makes it more important that you manage them carefully
for yourself.

> And for
> typed languages, why put them in code where they still
> aren't types and even more, where they can indicate
> the *incorrect* type as well?

As I said, one reason can be: because the framework or library you're
using doesn't use the type system fully.  That's the situation with the
MS Windows interfaces.

I agree with Yuri Khan that it's useful in other situations.  Khan's
examples depend on how broadly you treat the word "type".  Khan is
treating things as types that you don't think of as types, his
definition is a bit broader than yours.  There are arguments for both
ways of looking at things.

Another thing that it's useful for is differentiating a type from
instances of a type.  For example, many people use "something_t" as the
type and "something" as the instance.  I prefer to be more specific,
e.g.: "something_s" for a struct and "something_e" for an enum.

BR,
Robert Thorpe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]