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: Fri, 03 Jul 2015 00:37:42 +0100

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

> Robert Thorpe <rt@robertthorpeconsulting.com> writes:
>> 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.
>
> ... are you sure?
>
> In C, you do
>
>     int five = 5;
>
> In Lisp (Elisp), you do
>
>     (let ((five 5)) ...)

I don't understand what this has to do with the issue.  Both of the
languages here have types.  C has static types and Lisp has latent (or
dynamic) types.

What about assembly language?  What about other languages with no type
system or a very limited type system?

> If you want to, you can do (integerp five)

In Lisp the type of a variable is stored with the variable at runtime.
In C the type of a variable is recorded and enforced at compile time.
In many Assembly languages neither are done.  You can't ask the variable
what it's type is and you can't ask the compiler either.  The only
record is in your program and in your mind.

> Yeah, I think there is a misunderstanding where you
> think I say you cannot mention types, encodings,
> units, etc. ever in variable names, i.e. you should
> never name something in terms of technology.
> That isn't so; I agree there are such cases when that
> is called for.

In that case I don't think our opinions about this differ too much.

> However, the way I understood HN is that you should
> *always* use prefixes like that. What I remembered it
> looked like this:
>
>     intMoney = 0;
>     strGreeting = "Stay a while, and listen!";
>
> And I don't see any reason to do that.

It's useful in assembly language programming.

It's also useful in MS Window programming where everything is some kind
of handle.  Even then though, I would only use it for the user
interface, not every variable as you say.

BR,
Rob



reply via email to

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