Are there any benefits to languages that terminate statements with a semicolon (C, Perl, etc.) compared with those that don't (Python, Ruby, etc.), or vice versa?
(Note to late-comers: the original title and question asked about "do you trust languages that don't use a semi-colon"; it was rewritten to be less argumentative. Some of the...
In many situations, JavaScript parsers will insert semicolons for you if you leave them out. My question is, do you leave them out? I'll post simple Yes/No answers as a poll, but I'm also interested in your reasons.
If you're unfamiliar with the rules, there's a description of semicolon insertion on the Mozilla site. Here's the key poin...
I've only written a small amount of javascript, that runs embedded in a java application, but tested using QUnit, has been mixed and I've not noticed any problems yet.
Is there some conventional wisdom whether to use semi-colons or not in javascript?
Duplicate of Do you recommend using semicolons after every statement in JavaScript?
...
Hi All,
I need to convert a semi-colon delimited file to an Excel.
However, there are some fields that must be removed from the Excel file, and some extra fields to be added. These extra fields are drop-down fields.
Is there any way to do this? Programming language that is preferably to be used is Java, but also welcome the possibility...
The perlstyle pod states
No space before the semicolon
and I can see no reason for that. I know that in english there should not be any space before characters made of 2 parts ( like '?',';','!' ), but I don't see why this should be a rule when writing Perl code.
I confess I personally use spaces before semicolons. My reason is t...
In similar manner to the similar question about generics. What was its first appearance, and how did spread to C?
edit: corrected question based on Jon Skeet's answer (; is a terminator, not a separator)
...
The question is pretty self explanatory.
I'm working with code from multiple developers. Some of whom are inconsistent in their use of semicolons, and I just want them after every line for consistency (and to prevent any masking of errors).
I use Aptana to format my source code, but it won't add semicolons for you AFAIK.
Thanks.
...
Hi,
Right now I use:
char record[BUFLEN];
if(fgets(record, BUFLEN, fp) != NULL) {
/* some code */
}
to get lines from input like:
city=Boston;name=Bob;age=35
city=New York;name=Michael;age=29
Can I use something else in C that would give me not entire lines until '\n' but separate pairs like: "city=Boston" t...
I've seen different developers include semicolons after functions in javascript and some haven't. Which is best practice?
function weLikeSemiColons(arg) {
// bunch of code
};
or
function unnecessary(arg) {
// bunch of code
}
...
In several JavaScript libraries I saw this notation at the very beginning:
/**
* Library XYZ
*/
;(function () {
// ... and so on
While I'm perfectly comfortable with the "immediately executed function" syntax
(function(){...})()
I was wondering what the leading semicolon is for. All I could come up with is, that it is an insura...
Hello All,
i have the following values in a single cell let be A1
1234
567
454
Likewise all the A(N) are filled with values. N various from 1000 to 1500
i want this to get converted as
1234;567;454
Any shortcut available?
...
As said in the book Microsoft Dynamics AX 2009 Programming: Getting Started it´s needed to put semicolons after declarations in x++:
The extra semicolon after the variable
declaration is mandatory as long as
the first line of code is not a
keyword. The semicolon tells the
compiler that variable declarations
have come to an ...
How best does the developer who's decided he likes semicolons at the end of his Javascript statements enforce that expectation technically for himself?
I'm using Visual Studio (ASP.NET webapps), but I'd love to hear about solutions for any environment.
...
Are there any reasons, apart from subjective visual perception and cases where you have multiple statements on the same line, to use semicolon at the end of statements in Javascript?
...
Many times I've seen a semicolon used after a function declaration, or after the anonymous "return" function of a Module Pattern script. When is it appropriate to use a semicolon after curly braces?
...
I've been programming in Java for a while, and I've just come across this syntax for the first time:
public Object getSomething(){return something;};
What's interesting me is the final semicolon. It doesn't seem to be causing a compiler error, and as far as I know isn't generating runtime errors, so it seems to be valid syntax. When ...
I recently heard this was used as an interview question. I suspect there is a very simple answer; I must be over-thinking it.
Can you write Hello World in C without
using any semi-colons? If so, how?
...
What are the best strategies for finding that missing semicolon that's causing the error? Are there automated tools that might help.
I'm currently using Visual Studio 2008, but general strategies for any environment would be interesting and more broadly useful.
Background:
Presently I have a particularly elusive missing semicolon (or b...
Well, first I should probably ask if this is browser dependent.
I've read that if an invalid token is found, but the section of code is valid until that invalid token, a semicolon is inserted before the token if it is preceded by a line break.
However, the common example cited for bugs caused by semicolon insertion is:
return
_a+b;
...
Hi!
I am retrieving an html document from a MySQL db through PHP, and it has semi-colons in the style tags like this
style="background-color:black;display:block"
I've had issues with the quotes, and escaped them with slashes however I can't do the same with a semi-colon. Is there any way to escape this?
Thanks for any help!
...