|
TBH I had to put it in VS. Seems like a bug in VS right?
return 5;
|
|
|
|
|
Yeah, I was thinking of reporting this to Microsoft Connect. Seems like a bug in the parser.
|
|
|
|
|
They could really do with a good review of the asp editor in general. it is very annoying how it formats code when you start using if/else statements.
Also, something like the following causes warnings (even if it is bad coding)
<div>
<% if(true){ %>
It is true I tell you!</div>
<% } else { %>
You will never here from me!</div>
<% } %>
return 5;
|
|
|
|
|
What warning does it give? I would think it's a good thing that it warns you of unreachable code.
|
|
|
|
|
Sorry. Bad example. The warning I mean refers to unmatching div tags
return 5;
|
|
|
|
|
Oh, I gotcha. Yeah, that is annoying. I usually use an asp:Literal tag to get around that.
|
|
|
|
|
I found this on my friend's source code, I wonder the intention of this function ....
He create a function on an Oracle database.
<br />
FUNCTION f_init<br />
RETURN VARCHAR2<br />
IS<br />
vssqlerrm VARCHAR2 (255);<br />
vsvalidation VARCHAR2 (255);<br />
BEGIN<br />
vssqlerrm := '';<br />
vsvalidation := '';<br />
RETURN vsvalidation;<br />
EXCEPTION<br />
WHEN OTHERS<br />
THEN<br />
BEGIN<br />
vssqlerrm := SQLERRM;<br />
vsvalidation := vssqlerrm;<br />
END;<br />
END;<br />
It's easy to laugh, but, it's so hard to smile ...
|
|
|
|
|
|
No, it's not a template, cause it used in another routines.
It's easy to laugh, but, it's so hard to smile ...
|
|
|
|
|
PL-SQL supports overloading...
|
|
|
|
|
Maybe he's still paid by line.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
PRE tags please!
FUNCTION f_init
RETURN VARCHAR2
IS
vssqlerrm VARCHAR2 (255);
vsvalidation VARCHAR2 (255);
BEGIN
vssqlerrm := '';
vsvalidation := '';
RETURN vsvalidation;
EXCEPTION
WHEN OTHERS
THEN
BEGIN
vssqlerrm := SQLERRM;
vsvalidation := vssqlerrm;
END;
END;
I'm not familiar with that language, but it looks a bit like it's a function that returns an empty string and has some unecessary exception handling. Quite the horror!
|
|
|
|
|
Sorry, but in this case the pre tags don't really help
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Yeah, some languages are hopeless.
|
|
|
|
|
aspdotnetdev wrote: I'm not familiar with that language
Looks like PL-SQL to me.
|
|
|
|
|
Have you asked your friend?
|
|
|
|
|
I was just given a project to rewrite, cleanup, and add features to. The first class I look at has these variables. It appears the original author liked to use almost every convention for naming variables, arbitrarily changing it up.
private string ip_addr = "xx.xx.xx.xx";
private int _port = 2000;
public int countQuotesReceived = 0, countQuotesCreated = 0;
public bool _connected = false;
public bool _initialized = false;
public bool BroadCast = false, ResetHighsLows = false;
public bool reconnecting = false;
modified on Monday, January 17, 2011 4:35 PM
|
|
|
|
|
Where's Hungarian?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Here it is. Note, it's on a public variable, too. I should have posted more the first time. This is a copy/paste, so this is his spacing, and his ordering of the access levels:
public DataTable dtQuotes;
private QuoteHub _QuoteHub;
private string ip_addr = "xx.xx.xx.xxx";
private int _port = 2000;
public int countQuotesReceived = 0, countQuotesCreated = 0;
public bool _connected = false;
public bool _initialized = false;
public bool BroadCast = false, ResetHighsLows = false;
public bool reconnecting = false;
modified on Monday, January 17, 2011 4:35 PM
|
|
|
|
|
So, it should be "m_dtQuotes" anyway.
Make his wages as consistent as his naming conventions. Bet he falls into line quickly.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Well, he's no longer at the company, not sure why .
I was hired to fill his position.
|
|
|
|
|
By Hungarian @OriginalGriff is looking for m_
|
|
|
|
|
|
By Hungarian I mean the type is prefixed onto the variable name as in iCount, lpszName etc. The "m_", "p_", g_" etc. metaprefix indates the scope: Member of class, function parameter, global and so on.
Once upon a time we thought this was a good idea! But then incremental compilation meant we could go back to readable, pronounceable variable names.
(I'm waiting for the next generation retrospective on naming, when we go back to a maximum of six characters, and the first character defines it as a integer if it is 'i' to 'n' so you don't even have to declare them...)
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: (I'm waiting for the next generation retrospective on naming, when we go back to a maximum of six characters, and the first character defines it as a integer if it is 'i' to 'n' so you don't even have to declare them...)
Good idea. Let us know when it is released
|
|
|
|