Overpaid, over engineered and totally in-yer-face...
-
One of my own little beauties to show why I should be kept on a short leash...
''' <summary>
''' Projection over the client event stream to summarise the state of a client
''' </summary>
Public NotInheritable Class ClientSummaryProjection
Inherits ProjectionBase(Of AggregateIdentifiers.ClientAggregateIdentity)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.NewBazaarCreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.BazaarClosedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.CreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.ClientNameChangedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.DisabledEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.EnabledEvent)ReadOnly m\_identity As AggregateIdentifiers.ClientAggregateIdentity ''' <summary> ''' The aggregate identifier of the client over which this projection applies ''' </summary> Public Overrides ReadOnly Property Identity As AggregateIdentifiers.ClientAggregateIdentity Get Return m\_identity End Get End Property Private m\_openBazaars As Integer ''' <summary> ''' The number of Bazaars open at this point in time ''' </summary> Public ReadOnly Property OpenBazaars As Integer Get Return m\_openBazaars End Get End Property Private m\_totalBazaars As Integer ''' <summary> ''' The total number of bazaars ever opened for this client at this point in time ''' </summary> Public ReadOnly Property TotalBazaars As Integer Get Return m\_totalBazaars End Get End Property Private m\_clientName As String ''' <summary> ''' The full display name to use for the client ''' </summary> Public ReadOnly Property ClientName As String Get Return m\_clientName End Get End Property Private m\_enabled As Boolean = True ''' <summary> '
-
One of my own little beauties to show why I should be kept on a short leash...
''' <summary>
''' Projection over the client event stream to summarise the state of a client
''' </summary>
Public NotInheritable Class ClientSummaryProjection
Inherits ProjectionBase(Of AggregateIdentifiers.ClientAggregateIdentity)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.NewBazaarCreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.BazaarClosedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.CreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.ClientNameChangedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.DisabledEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.EnabledEvent)ReadOnly m\_identity As AggregateIdentifiers.ClientAggregateIdentity ''' <summary> ''' The aggregate identifier of the client over which this projection applies ''' </summary> Public Overrides ReadOnly Property Identity As AggregateIdentifiers.ClientAggregateIdentity Get Return m\_identity End Get End Property Private m\_openBazaars As Integer ''' <summary> ''' The number of Bazaars open at this point in time ''' </summary> Public ReadOnly Property OpenBazaars As Integer Get Return m\_openBazaars End Get End Property Private m\_totalBazaars As Integer ''' <summary> ''' The total number of bazaars ever opened for this client at this point in time ''' </summary> Public ReadOnly Property TotalBazaars As Integer Get Return m\_totalBazaars End Get End Property Private m\_clientName As String ''' <summary> ''' The full display name to use for the client ''' </summary> Public ReadOnly Property ClientName As String Get Return m\_clientName End Get End Property Private m\_enabled As Boolean = True ''' <summary> '
I think you just proved why I have such a low opinion of VB programmers. (Marc ducks and runs for cover)
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
-
I think you just proved why I have such a low opinion of VB programmers. (Marc ducks and runs for cover)
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
It'd probably be as ugly in C#with the need for explicit interface implementation
-
It'd probably be as ugly in C#with the need for explicit interface implementation
It's been a while since I've seen any VB..
Public ReadOnly Property Enabled As Boolean
Get
Return m_enabled
End Get
End PropertyC# certainly appears to be slightly cleaner in my opinion, although it's a matter of preference/working environment/etc..
public readonly bool Enabled { get { return m_enabled; } }
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
-
It's been a while since I've seen any VB..
Public ReadOnly Property Enabled As Boolean
Get
Return m_enabled
End Get
End PropertyC# certainly appears to be slightly cleaner in my opinion, although it's a matter of preference/working environment/etc..
public readonly bool Enabled { get { return m_enabled; } }
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
You can do implied getters/setters in VB (and C#) to save a bit of space. It was more the one implements of the interface per event handler that was the OMG part.
-
You can do implied getters/setters in VB (and C#) to save a bit of space. It was more the one implements of the interface per event handler that was the OMG part.
-
It's been a while since I've seen any VB..
Public ReadOnly Property Enabled As Boolean
Get
Return m_enabled
End Get
End PropertyC# certainly appears to be slightly cleaner in my opinion, although it's a matter of preference/working environment/etc..
public readonly bool Enabled { get { return m_enabled; } }
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
Public Property Something As String
Get
Return _Something
End Get
Set(value As String)
_Something = value
End Set
End Propertypublic string Something
{
get
{
return _Something;
}
set
{
_Something = value;
}
}That's eight vs. eleven lines. It adds up! I always find VB has a vertical cleanliness whereas C# has a horizontal cleanliness :) I love both languages by the way. It's just a little bit easier to write messy code in VB due to backwards compatibility with VB1-6, but you can write utter crap in both languages any language! Started out in VB.NET and later moved to C#.
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
Public Property Something As String
Get
Return _Something
End Get
Set(value As String)
_Something = value
End Set
End Propertypublic string Something
{
get
{
return _Something;
}
set
{
_Something = value;
}
}That's eight vs. eleven lines. It adds up! I always find VB has a vertical cleanliness whereas C# has a horizontal cleanliness :) I love both languages by the way. It's just a little bit easier to write messy code in VB due to backwards compatibility with VB1-6, but you can write utter crap in both languages any language! Started out in VB.NET and later moved to C#.
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
In your example, VB has 20 keywords, variable names, etc. C# has 9. Nuff said :)
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
But still less vertical space! :laugh:
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
But still less vertical space! :laugh:
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
Stop ruining my point with your better syntax![^] :laugh: So maybe properties aren't the best example... Let's look at a switch statement? Always loved them in VB, but disliked them in C# (mandatory break!?)... :)
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
-
In VB.NET you could type only Public String Something variable _Someting would be internally created and accessible without explicit definition. I don't know if they added it in C# too.. While there are more keywords, intellisense is better and there is actually less typing in vb version :)
-
In VB.NET you could type only Public String Something variable _Someting would be internally created and accessible without explicit definition. I don't know if they added it in C# too.. While there are more keywords, intellisense is better and there is actually less typing in vb version :)
Similar like C#, but there the generated backing-field is not accessible. http://www.infoq.com/news/2009/06/Auto-Properties[^]
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
One of my own little beauties to show why I should be kept on a short leash...
''' <summary>
''' Projection over the client event stream to summarise the state of a client
''' </summary>
Public NotInheritable Class ClientSummaryProjection
Inherits ProjectionBase(Of AggregateIdentifiers.ClientAggregateIdentity)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.NewBazaarCreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.BazaarClosedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.CreatedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.ClientNameChangedEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.DisabledEvent)
Implements IEventConsumer(Of AggregateIdentifiers.ClientAggregateIdentity, Events.Client.EnabledEvent)ReadOnly m\_identity As AggregateIdentifiers.ClientAggregateIdentity ''' <summary> ''' The aggregate identifier of the client over which this projection applies ''' </summary> Public Overrides ReadOnly Property Identity As AggregateIdentifiers.ClientAggregateIdentity Get Return m\_identity End Get End Property Private m\_openBazaars As Integer ''' <summary> ''' The number of Bazaars open at this point in time ''' </summary> Public ReadOnly Property OpenBazaars As Integer Get Return m\_openBazaars End Get End Property Private m\_totalBazaars As Integer ''' <summary> ''' The total number of bazaars ever opened for this client at this point in time ''' </summary> Public ReadOnly Property TotalBazaars As Integer Get Return m\_totalBazaars End Get End Property Private m\_clientName As String ''' <summary> ''' The full display name to use for the client ''' </summary> Public ReadOnly Property ClientName As String Get Return m\_clientName End Get End Property Private m\_enabled As Boolean = True ''' <summary> '
VB? I see why you're ashamed!
veni bibi saltavi
-
VB? I see why you're ashamed!
veni bibi saltavi
expected ';' ;P