[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Programmering i C# - "best practise" ?



lørdag 13 Oktober 2007 skrev Michael Rasmussen:
> > Som sagt... Det jeg søger er lidt om "pænest" måde at skrive læsbare
> > programmer på. Og jo jeg ved godt at der ikke findes en regel for hvad
> > der er "pænest" og mest "læsbar".

Perforce har en interessant artikel på 

http://www.perforce.com/perforce/papers/prettycode.html

Der er iøvrigt for nyligt kommet en bog der hedder "Beatiful Code" - den har 
nogle sjove overvejelser, ikke om design, men om kode: 
http://www.amazon.com/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047

> > Men jeg har da set en række gode 
> > eksempler på vejledning til f.eks. C - men synes ikke helt den kan
> > overføres til principperne bag C# som er bundet af den
> > objektorienterede struktur.
> >
> Du kan ikke splitte klasser op i flere filer. 

Jow, det kan man faktisk godt i C#. Check "partial" som klasse dims ala 
public, den slags (hvad er det nu det hedder).

partial er iøvrigt kanongrimt, efter min mening, men det er nok delvist en 
smagssag.

> Er grunden til dit ønske, 
> at du har fået for komplekse klasser, bunder det i en designmæssig
> fejl. En tommelfinger regel er, at en klasse højest må fylde 2-3 A4
> sider kode, så hvis dine klasser fylder mere, må du opsplitte dem via
> agregering eller komposition.

Det må siges at være en tommelfingerregel. Men, generelt er det en god ide at 
splitte op.

Mvh

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
There are many gods which Christians reject. I just believe in one less god
then they do. The reasons that you might give for your atheism toward the
Roman gods are likely the same reasons I would give for not believing in
Jesus.
                               - Dan Barker


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *