473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

simicolons everywhere

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
Nov 15 '05 #1
3 955

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.

"Jeff S" <Je******@asdf.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #2
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

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> schreef in bericht
news:uK**************@TK2MSFTNGP12.phx.gbl...

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.

"Jeff S" <Je******@asdf.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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


Nov 15 '05 #3
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

"Jeff S" <Je******@asdf.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: myang | last post by:
After we compile a C program, we can put the executable file under a directory (like /bin) so that we can run it everywhere, and don't have to type the full path. Can we do the same thing to a...
0
by: asj | last post by:
luke: BORRRRRRRRING......the most interesting initiatives are happening on the client side - in small wireless devices such as cellphones and smartphones, where J2ME has become the de facto...
10
by: Gabriel | last post by:
I enjoy writing .Net applications; for me, C# has made developing fun once again. :) My only beef with .Net development is the fact that so few end users have the .Net framework installed, most of...
16
by: The Ruling Class | last post by:
With all the books and code written in Java, why are there no /killer/ applications? Can you name one Java application that is a must have? I run Suse 9.0 -- I don't see a single Java...
4
by: Michel Racicot | last post by:
Ok, I heard that C# code was supposed to run on many platforms/OS, as long as you have the CLR installed. Where can I download the CLR for other OS? Thank you
2
by: Shapper | last post by:
Hello, I have a DataReader which returns only one record from a database: ID Name Content 12 hello world Is it possible to create a variable named var_hello which value is "world"?
1
by: Newbie! | last post by:
Hey group, I`ve looked everywhere for this one but it dosn`t seem to be documentsed for VB.Net on C#. All is in VB.NET and Access 2002 Here goes, I have a Datagrid bound to a Tabled Called...
7
by: danijela | last post by:
Hi again! I have one more question. How can i make an exe file from my ..Net VB project which would work on win 98, win 2000 and so on...(I'm using .Net Visual studio 2003 professional) Thanks! ...
4
by: Learnicus | last post by:
No matter where i choose to create a new application VS2005 tells me that a webiste already exists there. Any ideas? Lenny
1
by: Peter Hartlén | last post by:
Hi! Could someone please point me to a good tutorial or similar (what classes, small hint...) describing the best practice when it comes to importing database schema and data into a sql...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.