I vote for the
Code: Select all
parser to include line numbering, what do you think?
In fact, show me the source and I'll do it for ya.
JonnyModerator: General Moderators
Code: Select all
parser to include line numbering, what do you think?
In fact, show me the source and I'll do it for ya.
JonnyCode: Select all
// This next line is line 105Well if it gives a line they can at least indicate which line that is.jonsyd wrote:... see your point, but in most cases the initial poster doesn't know where in code the errors are, so they can't mark it up.
I know that but when someone posts a 30 line piece of code from a longer script it helps to know where the parser's reporting the error so you can ignore the code below, or ask for the code above if they haven't supplied it.jonsyd wrote:Alot of errors which confuse newbies are quote and bracket-related syntactical stuff, where the line number given in the error message doesn't identify the source of the problem, just where the parser gives up.
In your example surely the person just adding a comment to say 'This is where PHP says the error is' means you don't have to search through all the code. If they just post a bunch of code and say 'please fix this' the best reponse is to ask them exactly what needs to be fixed.jonsyd wrote:Having line numbers allows people to refer back to the exact line, rather than having to quote a whole LOC each time - good example is MySQL related code, there will normally be loads of:
$result = mysql_query($query);
where the $query s can look very similar, so you have to hunt through the code rather than just going to the line (human full text search vs index?), and then correctly quote the LOC.
It's probably about the same amount of typing sure.jonsyd wrote:As for your example, isn't it just as easy to quote the error message and say it refers to line 15 of the snippet, as to quote the error message and add a comment to line 15 of the snippet?