simicolons everywhere

  • Thread starter Thread starter Jeff S
  • Start date Start date
J

Jeff S

I promise this will be my last inane question of the day - tomorrow's a
different story : )

Really wondering what the benefit is of terminating practically every line
of C# code with a semicolon (;)

Thanks,

Jeff
 
Heh, basically, it allows you to do span multiple lines without a special
character(_ in VB I think) and to put multiple lines of code on a single
line(not sure its possible in VB). It is also due to C#'s C lineage, all C
based languages(including java) use semicolons to terminate lines.
 
Yes indeed, in VB.NET you have the underscore character to split a line in
two, so it's the other way around. In C# you have to indicate your line
ends, in VB.NET you have to indicate that your line doesn't end at that
point
 
As the other poster mentioned, it's allows you to span lines and to have
multiple statements in a single line. The semicolon is an statement
terminator. In VB, the statement terminator happens to be the end of line
(unless you have an underscore).

But primarily, it's because of its C/C++ heritage. I don't think it's a big
deal one way or the other. I do think the "for" statement would be pretty
ugly without semicolons, though.

Pete
 
Back
Top