Because I don't want to drag
https://forums.jiwa.com.au/viewtopic.php?f=26&t=1613 off-topic.
SBarnes wrote:Whilst this could start a debate over which language is better I say go with the one that works better for you as both largely can do the same job.
I prefer c# for two very honest reasons:
- When looking for something I can usually find a c# example quicker on google
- I will be honest and admit it means I have to type less
I don't think either is 'better' (in case it appears that I have an opinion on it).
As you say, they can both largely do the same job, especially when you're talking about business software. And EXTRA especially when you're talking about writing Jiwa plugins.
Except XML. C# sucks at XML. Which is why if I'm doing serious XML stuff, I prefer VB. In Jiwa, that can mean adding a plugin just for that, which you can then reference as needed.
I have built up a small library of bits and pieces in both languages, and just work with whatever I've got; I see no value in translating just for the sake of it.
Now. When Jiwa's plugin compilers get right up-to-date, that might change, since C# has continued getting new language features while VB is officially on "no new features" at Microsoft.
SBarnes wrote:I will be honest and admit it means I have to type less
There are many good arguments for C#, but this isn't one of them.
It *is* a common argument I see for C#, and over at vblang on github there have been several complaints about the amount of typing required to do something in VB, typically using an example of 'poorly' written VB - often a bit of C# directly translated instead of 'interpreted' into a decent VB style.
However, in practice, if you are using a modern editor with intelligent auto-completion, there is little in it, and even ignoring XML, there are cases where VB can require typing *fewer* characters, and even fewer keypresses if you factor in the need to use your shift key (which you need for C#'s squiggly brackets).
Quick e.g. Given these two bits of code, using visual Studio 2019 and intellisense, the difference in the number of keystrokes required is C# winning by about four (give-or-take, depending on your project and how intellisense behaves).
- Code: Select all
// C#.
bool test(int a, int b)
{
return a == b;
}
'' VB.
Function test(a As Integer, b As Integer) As Boolean
Return a = b
End Function
However, expand it a bit, and things get a bit hazy. In this case, you will likely hit fewer keys in VB:
- Code: Select all
bool test2(int a, int b)
{
if (a == b)
{
return true;
}
else
{
return false;
}
}
Function test2(a As Integer, b As Integer) As Boolean
If a = b Then
Return True
Else
Return False
End If
End Function
And if you use VB's built-in LINQ instead of lambdas:
- Code: Select all
// C# - lots of shift key action.
return items.Where(i=>i.Key==1).Select(i=>i.Value).Take(1);
'' VB - spaces instead of parentheses
Return From i In items Where i.Key=1 Select i.Value Take 1