Hungarian notation

Started by fred_tomke · 2009-02-18 21:38 UTC · 3 replies · SMF topic #559

Hello,

while translating the help files I also change the arguments a bit (in the hope Owen won't disagree). I "underline" the argument's type using prefices based on the Hungarian notation. I use

Strings   str   strBlockName
Integer   int   intRow
Floating   rea   reaXCoord
Point     pt   ptCurrentCoord
List    lst  lstControls
Entity   ent   entControl
ActiveX Objekt   o   oControl


... and so on. There's no need to say, that this makes a code more readable and understandable. Of course others may use different prefices. But I want to start a discussion if we should use such a notation (in any kind) in our documentation and if it is possible to make the predefined prefices editable to the user.

Fred
I don't think Hungarian notation is a good idea in the documentation. Every argument is already typed in the syntax definition, so the prefix is superfluous. I also think whatever prefixes are chosen will be meaningless to some percentage of non-English speakers. Finally, it's yet more work and another potential source of error that documentation writers must contend with.
Hm, sure, it is a bit work for the documentation.

Every argument is already typed in the syntax definition.

You are right - but it only works as long as the documentation is open the whole time. I must say, I love it to copy the syntax of the selected event from the events tab, e.g.

(defun c:Unbenannt_Dialog1_Datenblatt1_OnSelChanged (intRow intCol /)


and later in the code, when the help file isn't present anymore, then I (and others who have to deal with my code) still know that this must be an integer. And that's really nice, I think.

Fred
I've also had requests to remove the [as XXX] from the text that gets copied to the clipboard via the control browser. In that case, the hungarian notation would be more useful, but I think for new users the current approach is best. There is an enormous amount of work involved in maintaining and localizing the reference documentation, so I prefer to minimize the work and the chance for error. In any case, I don't want to change it now.