Terminating Semicolon
-
I had a discussion with my professor, (who is an associate professor) and he didn't effectively explain terminating semicolons to me. I started self-learning in C# and am now in a local CC for a C# certificate. Part of the requirements is a Beginning Web Programming class. Love the class and am loving web programming. Here is my question though. In regards to the terminating semicolon, is there a time when you shouldn't use it? Specifically, I lost points in a test for the following: Write the format for an hotspot: (I wrote) Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons. I don't really care whether I was right or wrong in my argument with the professor, I just want to know the right way to do things, so I don't screw this up when I go to work for someone. Thanks for your responses. Beginning Programmer - Still learning as much as possible.
-
I had a discussion with my professor, (who is an associate professor) and he didn't effectively explain terminating semicolons to me. I started self-learning in C# and am now in a local CC for a C# certificate. Part of the requirements is a Beginning Web Programming class. Love the class and am loving web programming. Here is my question though. In regards to the terminating semicolon, is there a time when you shouldn't use it? Specifically, I lost points in a test for the following: Write the format for an hotspot: (I wrote) Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons. I don't really care whether I was right or wrong in my argument with the professor, I just want to know the right way to do things, so I don't screw this up when I go to work for someone. Thanks for your responses. Beginning Programmer - Still learning as much as possible.
Nekosohana wrote:
Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons.
If you copied that out of a book, then that's one messed up book. You don't terminate HTML attributes with semicolons. You wrap them in quotes. Which you did. There's one specific attribute,
style
, that can contain multiple values delimited by semicolons... but even then, they're part of the value not the definition, so they go inside the quotes. Other uses for semicolons in HTML include terminating character entities (such as: & or A) and terminating statements in blocks of Javascript wrapped in<script>
tags or event handler attributes. -
Nekosohana wrote:
Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons.
If you copied that out of a book, then that's one messed up book. You don't terminate HTML attributes with semicolons. You wrap them in quotes. Which you did. There's one specific attribute,
style
, that can contain multiple values delimited by semicolons... but even then, they're part of the value not the definition, so they go inside the quotes. Other uses for semicolons in HTML include terminating character entities (such as: & or A) and terminating statements in blocks of Javascript wrapped in<script>
tags or event handler attributes.The book wasn't messed up, I added the terminating semicolons myself. That's what I wanted clarification, since it hasn't affected my outputs at all. The challenge I am facing is that when I started learning C# I had to learn the 'why' of what I was doing (a little theory to go with the practice). With this class there is no explination of 'why', just "do it this way". Meh. Thanks for the help, I appreciate it.
Beginning Programmer - Still learning as much as possible.
-
I had a discussion with my professor, (who is an associate professor) and he didn't effectively explain terminating semicolons to me. I started self-learning in C# and am now in a local CC for a C# certificate. Part of the requirements is a Beginning Web Programming class. Love the class and am loving web programming. Here is my question though. In regards to the terminating semicolon, is there a time when you shouldn't use it? Specifically, I lost points in a test for the following: Write the format for an hotspot: (I wrote) Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons. I don't really care whether I was right or wrong in my argument with the professor, I just want to know the right way to do things, so I don't screw this up when I go to work for someone. Thanks for your responses. Beginning Programmer - Still learning as much as possible.
That's not a "Terminating Semicolon"; that's an extraneous semi-colon.
-
That's not a "Terminating Semicolon"; that's an extraneous semi-colon.
I know what extraneous means, so I am not sure if you are being facetious or not.
Beginning Programmer - Still learning as much as possible.
-
I know what extraneous means, so I am not sure if you are being facetious or not.
Beginning Programmer - Still learning as much as possible.
-
If you knew what it meant, you would know whether he was being facetious or not. :-D
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
Heh. However, I am new enough and the professor is teaching zero theory (which is frustrating). I assume he is being facetious, but it could just as easily be used technically and I wouldn't know...
Beginning Programmer - Still learning as much as possible.
-
I know what extraneous means, so I am not sure if you are being facetious or not.
Beginning Programmer - Still learning as much as possible.
Me? Nooooo... not me, nuh uh. :-D
-
I had a discussion with my professor, (who is an associate professor) and he didn't effectively explain terminating semicolons to me. I started self-learning in C# and am now in a local CC for a C# certificate. Part of the requirements is a Beginning Web Programming class. Love the class and am loving web programming. Here is my question though. In regards to the terminating semicolon, is there a time when you shouldn't use it? Specifically, I lost points in a test for the following: Write the format for an hotspot: (I wrote) Basically, I copied it right out of the book, but I got knocked off for the terminating semicolons. I don't really care whether I was right or wrong in my argument with the professor, I just want to know the right way to do things, so I don't screw this up when I go to work for someone. Thanks for your responses. Beginning Programmer - Still learning as much as possible.
C# and XML/HTML are two different things. Not every language or format has terminating semicolons. I'm not sure if this is XML or HTML, but either way, the semicolons are wrong. It's not C#.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
C# and XML/HTML are two different things. Not every language or format has terminating semicolons. I'm not sure if this is XML or HTML, but either way, the semicolons are wrong. It's not C#.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Thank you everyone. I appreciate you clarifying this for me!
Beginning Programmer - Still learning as much as possible.