|
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 Property
C# 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.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
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.
|
|
|
|
|
I've seen a lot (lot) worse, tbh
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
Public Property Something As String
Get
Return _Something
End Get
Set(value As String)
_Something = value
End Set
End Property
public 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#.
|
|
|
|
|
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.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
But still less vertical space!
|
|
|
|
|
Sander Rossel wrote: But still less vertical space!
public string Something
{
get { return _Something; }
set { _Something = value; }
} Where, exactly?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Yep, that's how I would write simple getters and setters. I only go multiline if there's some additional logic in there
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
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
|
|
|
|
|
|
VB? I see why you're ashamed!
veni bibi saltavi
|
|
|
|
|
expected ';'
|
|
|
|
|
When it is just so very easy?
Select Case word
Case "JULY"
Return 7
End Select
|
|
|
|
|
Maybe because if you used mixed case (July) it would fail, or be hard for the original author to determine what the issue was?
|
|
|
|
|
"because it requires a recompile to update the values"
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Nothing is removed from the snippet- it really can only deal with JULY.
|
|
|
|
|
Where is that sarcasm icon when it's needed most?
|
|
|
|
|
Maybe the TDDers never got round to writing the tests for other strings - therefore they weren't allowed to change it!
|
|
|
|
|
Almost each project has them.
It gets better if there's a concatenation going on of constants into a stringbuilder.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
That's the one to watch for these days..
Your product may only be intended to English speaking nations (although there are differences even between these), but eventually some bright spark of a salesman's going to drop everyone in it selling a version to Beijing or some other exotic location
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
oh, now this is fun.
July and july for starters, but you can have other languages as well. In dutch it's pretty straightforward "juli", but in French that becomes juillet, spanish=julio and croatian apparently returns "srpanj"
|
|
|
|
|
I challenge you to pronounce you if you're not slavic (I am, btw)
R in sRpanj is hard as when the russian speaks english in movies and nj is single letter pronounced like New without U
|
|
|
|