Marc said:
Nowadays with an IDE that already gives you a warning something is not
according to the syntax of a certain language before you press compile,
the reds curly lines, it's quite easy.
Still does not make things the same language. While the IDE may warn you
that things are awry, it will not tell you how to correct your code. If all
that is wrong is curly braces or semi-colons, you are tracking. But there
are other languages differences that do matter.
A quick example:
builder.Append("\r\n");
builder.Append(vbCrLf)
Now, you don't have to use vbCrLf, of course, but most vb devs would, as it
is familiar. How about this:
string connString = "";
SqlConnection conn = new SqlConnection(connString);
Dim connString as String = ""
Dim conn As new SqlConnection(connString)
Functionally equivalent, but knowing the syntax is wrong (backwards?) does
not help you write it. Or how about this:
using(SqlConnection conn = new SqlConnection(connString))
{
conn.Open();
//etc.
}
Dim conn As New SqlConnection(connString)
Try
conn.Open()
Finally
conn.Dispose()
End Try
With no using in .NET 2.0, you are forced to use a Try ... Finally to
accomplish the same thing. No amount of red squigglies will give you the
knowledge to do that.
It gets even more difficult to translate when you start using Generics, as
C# using a much simpler syntax. I could also go into a list of differences
in string handling, LINQ, etc.
As I stated, I agree that they are functionally equivalent, at least
overall, but they are not the same language sans curly braces.