Page 2 of 6

Re: Naming Conventions

Posted: Tue Jul 27, 2010 6:36 pm
by esgici
melliott42 wrote:Can anyone suggest a compelling reason to use single or double quotes for string values?

If not what do most Clipper\HMG programmers use?
I guess no any compulsion.

Only when need string into string ;)

Do you know, we have another (at least) one string delimiter : [ ] ;)

Regards

--

Esgici

Re: Naming Conventions

Posted: Tue Jul 27, 2010 6:43 pm
by Rathinagiri
esgici wrote:
melliott42 wrote:Can anyone suggest a compelling reason to use single or double quotes for string values?

If not what do most Clipper\HMG programmers use?
I guess no any compulsion.

Only when need string into string ;)

Do you know, we have another (at least) one string delimiter : [ ] ;)

Regards

--

Esgici
This one is new to me.

Re: Naming Conventions

Posted: Tue Jul 27, 2010 6:46 pm
by Rathinagiri
Thanks a lot for a nice topic. :)

Previously I used my own naming conventions ie., no naming convention at all. :)

Now I had started using,

cChar
nNumeric
lLogic
dDate
aArray

Re: Naming Conventions

Posted: Tue Jul 27, 2010 7:20 pm
by esgici
Hi Rathi

Good decision :)

Since you are in a starting point, please try three letter prefix ( type + scope ). May be fatiguing at beginning, but after a short time surely you will be addicted because of its benefits.

Regards

--

Esgici

Re: Naming Conventions

Posted: Tue Jul 27, 2010 7:42 pm
by melliott42
after a short time surely you will be addicted because of its benefits.
Oh yes! :-)

For large projects there is no other way to maintain your code too!

I am at a re-starting place and found it a good time to re-evaluate what conventions I use and why. Esgicia and others here always give such insightful advice. A few words from them can save us all many hours of coding. :D

Re: Naming Conventions

Posted: Tue Jul 27, 2010 9:40 pm
by cdsaenz
As rathinagiri said, I prefer the Hungarian notation.
a = Array
b = Block
c = Character
d = Date
l = Logic
n = Numeric
o = Object

And h = hash?

Re: Naming Conventions

Posted: Tue Jul 27, 2010 9:44 pm
by esgici
cdsaenz wrote:As rathinagiri said, I prefer the Hungarian notation.
a = Array
b = Block
c = Character
d = Date
l = Logic
n = Numeric
o = Object

And h = hash?
Agreeable (including "h") :)

--

Esgici

Re: Naming Conventions

Posted: Wed Jul 28, 2010 12:05 am
by cdsaenz
I really have to play around with hashes. They're so nice.

Re: Naming Conventions

Posted: Wed Jul 28, 2010 12:31 am
by esgici
Could you give a SSW ;(

Saludos

--

Esgici

Re: Naming Conventions

Posted: Thu Jul 29, 2010 6:00 am
by swapan
esgici wrote:Could you give a SSW ;(

Saludos

--

Esgici
I started with prefixing "m" to a variable e.g.:
amount = mamount
name = mname

later adopted the hungarian style
amount = nAmount
name = cName

During Vb6 and. .NET, used:

prefixing with the control names.
name =txtName (textbox control)

Great to know Rathi's style (no conventions)! Never came this "idea", as I learnt to add "m" to memory variables from seniors during learning days of programming! :D