Article View: comp.lang.eiffel
Article #1148Re: whither style
From: Douglas Evan Cook
Date: Wed, 10 Jan 1996 21:26
Date: Wed, 10 Jan 1996 21:26
27 lines
2449 bytes
2449 bytes
On 8 Jan 1996, Joachim Durchholz wrote: > I think HN is inappropriate for languages where you can change the > representation of a type behind the scenes, simply because it's impossible > to invent an abbreviation for every type that shows up in a project. In a way, you almost have it exactly right here, but it isn't the language that is the deciding factor--it is the environment of the language. When you run your programs in an environment where you must pass information from one program to another, type checking is not applicable so a notation is necessary to remind programmers (especially when they are doing low-level stuff as is often necessary when moving data between two programs) what type they should be using. When I call the Windows API, it is nice to see that the variable name is lpsz.... when the type is a generic POINTER that could point to anything. When I save data in a file that could be read by an Intel based implementation of Modula II or Pascal, a MIPS version of C, or an embedded system running code developed in Ada, it is nice to know that they all expect an i16... (or however the notation says int16 should be prefixed). However, when I don't have to do this, I let the compiler clue me in. > In my experience, such languages actually don't need HN; the compiler will > catch all errors that HN is supposed to help avoid. This is because in > these languages, the type of a variable or value precisely defines what > operations are admitted for it. If you had a type zero-terminated-string > in such a language, the compiler won't allow you to pass this to a routine > that expects a string with a length descriptor.
Technical Details
Message-ID:
<Pine.HPP.3.91.960110141715.5791A-100000@hot.cs.byu.edu>Path:
arc1-ca.pugleaf.net!hot.cs.byu.edu!cookdReferences:
<cmanDK7x13.5KM@netcom.com> <30e26364.2569895@news1.wolfe.net> <4bvae4$fl6@beatty.slip.netcom.com> <4c0a6d$4hs@news.irisa.fr> <4cnmqu$2fg@beatty.slip.netcom.com> <60SqRiBF3RB@herold.franken.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!hot.cs.byu.edu!cookd From: Douglas Evan Cook <cookd@cs.byu.edu> Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3,comp.lang.smalltalk Subject: Re: whither style Date: Wed, 10 Jan 1996 14:26:40 -0700 Organization: Brigham Young University Message-ID: <Pine.HPP.3.91.960110141715.5791A-100000@hot.cs.byu.edu> References: <cmanDK7x13.5KM@netcom.com> <30e26364.2569895@news1.wolfe.net> <4bvae4$fl6@beatty.slip.netcom.com> <4c0a6d$4hs@news.irisa.fr> <4cnmqu$2fg@beatty.slip.netcom.com> <60SqRiBF3RB@herold.franken.de> NNTP-Posting-Host: hot.cs.byu.edu Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <60SqRiBF3RB@herold.franken.de>