🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: be.comp.programming
3 messages
3 total messages Started by EM Sat, 25 Oct 2003 16:15
conventies naamgeving variabelen en functies
#3803
Author: EM
Date: Sat, 25 Oct 2003 16:15
20 lines
1766 bytes
Zijn er conventies wat betreft naamgeving variabelen en functies die voor
alle programmeertalen gelden ?
Of zijn die taalafhankelijk.
Ken er zo welk enkel : substantieven voor variabelen en werkwoorden
gebruiken in functies en procs :
GeboorteDatum, HuwelijksDatum, ToonLijst(), BerekenLeeftijd(), ...
In variabele meegeven om welk type het gaat :
 iGetal of intGetal, fGetal of fltGetal, strNaam, conPi, arrLedenLijst,
maar doe je dit ook voor proc en functies ? funBerekenGemiddelde(),
procToonLijst(), ...?
En wat met zelfgemaakte objecten ?
Persoon of objPersoon
en is het dan Persoon.naam of objPersoon.strvoornaam
Persoon.leeftijd() of objPersoon.funLeeftijd() (te berekenen uit
geboortedatum) ?

Kwestie van consequent te zijn en niet opnieuw het warm water uit te vinden
!

Pugi!
Re: conventies naamgeving variabelen en functies
#3804
Author: Tim Van Wassenhove
Date: Sat, 25 Oct 2003 17:03
16 lines
1275 bytes
On 2003-10-25, EM <geralboot@yahoo.co.uk> wrote:
> Zijn er conventies wat betreft naamgeving variabelen en functies die voor
> alle programmeertalen gelden ?
> Of zijn die taalafhankelijk.

Voor de meeste programmeertalen zal er wel een style guide te vinden
zijn. Of worden ze opgelegd door je opdrachtgever/werkgever.

En je vind nog een heleboel tools die code kunnen omzetten naar
de stijl die jezelf het beste bevalt.

Het voornaamste: kies voor je project een stijl, en houd die dan ook
consequent aan.

-- 
esllicious
Re: conventies naamgeving variabelen en functies
#3764
Author: Kris De Decker http://www.jerboa...
Date: Thu, 06 Nov 2003 03:02
64 lines
3722 bytes
> Zijn er conventies wat betreft naamgeving variabelen en functies die voor
> alle programmeertalen gelden ?
Meeste naamgevingen zijn afhankelijk van:
-programmeertaal 
-bedrijf
-project
-programmeur :)
Een C programmeur zal een andere naamgeving hanteren dan een Delphi
programmeur.
Indien je tools gebruikt die geen 'autocomplete' ondersteunen kiest
men voor korte maar minder omschrijvende namen.

> Kwestie van consequent te zijn en niet opnieuw het warm water uit te vinden
Er is dus geen universele 'conventie' maar je kan wel overnemen van
bestaande naamgeving-procedures:
http://delphi.about.com/library/bldnc.htm
"Delphi Identifier Naming Conventions  
How to name all those variables and components you use in your daily
Delphi programming.
The Hungarian naming convention is quite useful � it's one technique
among many that helps programmers produce better code faster. Since
most of the API headers and documentation Microsoft has published over
the last years have used Hungarian notation names for identifiers,
many programmers have adopted one variation or another of this scheme
for naming their identifiers. "

http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_20naming.asp
"To best share ideas and knowledge, the Access development community
will benefit greatly if it adopts a common programming style so that
we can benefit from each other's expertise with a minimum of
translation overhead. Although Microsoft uses certain naming
conventions in the Microsoft? Access documentation, to date they
haven't published an official or comprehensive standard. Thus, we've
formulated a set of naming conventions to better serve Access users
and developers."

Leuk om te weten >> Charles Simonyi een vroegere Chief Architect van
Microsoft spendeerde veel tijd om de Microsoft programmeurs te
overtuigen om een universele conventie te gebruiken. Zijn origineel
artikel vindt je hier >>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsgen/html/HungaNotat.asp
"A note from Dr. GUI: Long, long ago in the early days of DOS,
Microsoft's Chief Architect Dr. Charles Simonyi introduced an
identifier naming convention that adds a prefix to the identifier name
to indicate the functional type of the identifier."
"In closing, it is evident that the conventions participated in making
the code more correct, easier to write, and easier to read. Naming
conventions cannot guarantee good code, however; only the skill of the
programmer can. "

mvg,

Kris De Decker

ps: Realtime bedrijfsinformatie op je PDA
>> http://www.jerboa.be/blog/Articles/Nytro/PDA.html
____________________

[Projectbeheer] = Projecta
[HACCP] = HaccPack
[Productiebeheer] = Insight
[Vastgoedbeheer] = FullFill
[Onderhoud] = Softmaint
[Documentbeheer] = DocShare
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads