Mazliet par VB.Net un glītāku kodu.
Ja jāveido klase, kurai ir daudz atribūtu (property) un tiem visiem nepieciešamas set un get metodes, tad izvedojas milzīgi garš kods, kurš sastāv gandrīz tikai no
Public Property Name() As String
Get
Name = scName
End Get
Set(ByVal Value As String)
scName = Value
End Set
End Property
Un tā daudzas reizes. Šis kods gandrīz nekad nav jāmaina un nav arī nepieciešams to bieži apskatīt. VB.Net development IDE piedāvā iespēju “collapsēt” katra atsevišķa property kodu. Bet diemžēl IDE šo informāciju nesaglabā un, nākamo reizi atverot šīs pašas klases koda failu, atkal ieraugām gāaaaru palagu ar atribūtiem. Toties, ja izvedo atsevišķu reģionu ar atribūtiem, tad tā stāvoklis saglabājas arī pie faila aizvēršanas. Attiecīgi kodā rakstāmGet
Name = scName
End Get
Set(ByVal Value As String)
scName = Value
End Set
End Property
#Region "Klases properties"
Public Property Name() As String
Get
Name = scName
End Get
Set(ByVal Value As String)
scName = Value
End Set
End Property
#End Region
Public Property Name() As String
Get
Name = scName
End Get
Set(ByVal Value As String)
scName = Value
End Set
End Property
#End Region