#94347 - 2002-10-14 07:04 AM
RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11625
Loc: CA
|
Well, since Rod did not want to discuss other ideas about it in his topic
RFC - Hungarian Notation for KiXtart & KiXforms http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=14;t=000101
I thought I would create another topic with similar name where the other ideas/opinions about it could be discussed.
RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
Rod,
In ("my opinion") yes, what you propose is all well and good, but as far as making KiXtart easier to learn for newbies, I would disagree. This goes along the lines of most OOP (Object Oriented Programming) tools, which "most" are not easy for newbie programmers.
I challenge anyone with NO programming skills to install Visual Studio 97, or .NET and then fire up the program and write a "HELLO" program (without the Wizard). Then fire up KiXtart and write a "HELLO" script. This is an over exaggerated example, but part of what makes some of these programs difficult is all the STRICT Naming and case sensitivity associated with them, and as Lonkero pointed out, using a name for different functionality on the fly is perfectly okay in KiXtart, not so in any other language I'm aware of.
Should those in the know, or more advanced users NOT use it? No, I'm not saying that. If we all did start using it, it may prove to be beneficial in the long run. However, being realistic if I had to place money on a bet as to whether or not it will be accepted... I would bet against it. Partly for the reason Lonkero speaks of. Most of us may or may not be lazy, but it is easier to use $(anythingIwant) rather then having to memorize and/or think about what name I should use for a quick simple piece of code. Unless you are a die-hard VB or C++ programmer you have to constantly lookup the naming convention, which is probably why MS has built-in the smarts to prefix your code with this information for you while typing.
I'm not trying to be pessimistic about this, but unless people are forced into using this convention due to other requirements, I don't think most people will use it. As I say though, this is only (my opinion, and I may be full of SH**)
|
Top
|
|
|
|
#94349 - 2002-10-14 11:17 AM
Re: RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
|
rclarke
Starting to like KiXtart
   
Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
|
Well NTDOC, thanks for hijacking my post
My original argument goes something like this ... I want to use Hungarian Notation in my KiXtart programs, I know that there are others who would also like to use HN, therefore let's define a standard that coders can use if they wish to. It is better to have one accepted standard than hundreds of personal variations.
The discussion I was hoping for was more along the lines of ... should we use 'rg' (range) or 'a' to define arrays, should we still use 'b'oolean and 'c'har, even though those data types do not 'truly' exist in KiXtart, likewise should we use 'e' for error, and maybe consider prefixes for arguments passed to functions etc.
Alas, I feel that this will not happen now as the discussion has already gone in a different direction.
Rod.
|
Top
|
|
|
|
#94352 - 2002-10-14 05:34 PM
Re: RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
whoa guys ... might want to back and re-read Rod's original statement:
quote:
I want to concentrate on defining a standard for those who want to use Hungarian Notation.
I don't think Rod is suggesting we all use HN - not at all - but for those that DO want to use it - lets define a standard for it (for Kixtart that is).
I use HN sometimes. For short and simple scripts I think it can be overkill - but for long and complex scripts - especially forms scripts that have many forms - I find that it does help to keep all those variable names sorted (in my own mind anyways).
Heres a script that uses HN. I think it would be hard to argue with the fact that the HN variable names help - rather than hinder the reader.
Kixforms: Manage User Details - Here`s MUD in your eye !
Heres a snippet of code:
code:
If $chkAccountLocked.Value = 0 $adsUser = GetObject($strUserPath) $adsUser.GetInfo $adsUser.IsAccountLocked = 0 $adsUser.SetInfo EndIf
Anyone familiar with HN should know exactly what is going on here - they could also tell you - without looking at the rest of the code - exactly what variable types are being used here - and whether they are being used correctly or not. Funny thing is - even someone with just VB experience alone could probably read this script and figure it out (HN very widely adopted in programming circles).
Anyway - don't mean to be preachy - im not a consistent user of HN - but a documented standard is good to have if choose to use it.
|
Top
|
|
|
|
#94354 - 2002-10-14 06:35 PM
Re: RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
|
rclarke
Starting to like KiXtart
   
Registered: 2001-06-08
Posts: 178
Loc: Oxfordshire, United Kingdom.
|
Well I am pleased to see that this topic has generated some debate after all. Les, I wasn't really being a sour puss and I appreciate that Ron started a new topic, however my light hearted disappointment, as marked by the emoticon, was due to the fact that his post had drawn attention away from mine
Anyway, I am pleased to see that you, Jens and Shawn appreciate that this is a worthwhile initiative. What is interesting is that your definition of a KiXtart programmer fits me perfectly in that I have had no formal training. Furthermore, I only found out about HN 6 months ago, however I am very keen to change my bad habits and adopt it as soon as a standard has been defined - maybe I'm unusual to do that.
Rod. [ 14. October 2002, 18:35: Message edited by: rclarke ]
|
Top
|
|
|
|
#94356 - 2002-10-17 11:11 AM
Re: RFC - Hungarian Notation for KiXtart & KiXforms - Discussion
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
I think the first time that this came up in discussion was here.
(The eagle-eyed will see that I don't keep to my own rules in the posted code )
One word of warning from painful experience though:
If you are going to take the time to create self-documenting variable names using some type of SFH notation make sure you set "EXPLICIT" on. Not only will it help tighten up your code (no more unexpected globals!) but you will avoid the problem of looking at your code for 15 minutes before spotting that your calculation is returning gibberish simply because you've used "$sProcessCount" rather than "$iProcessCount" in the expression.
The problem is that you see the "ProcessCount" part of the variable name and miss the typo in the prefix, leading to robust exercising of the head/brick wall interface.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 202 anonymous users online.
|
|
|