- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
You know about Inversion of Control?
This developer obviously did!
Admin
How about we use properties *until* performance is actually measured, found to be unacceptable, and then those properties determined to be an actual factor in the unacceptable performance?
I'm constantly amazed by how much emphasis people put on performance, usually, it seems, before the solution has actually been finished or they've done any testing. But they always have an anecdote or story that 'supports' them!
Me, I want code that's foremost maintainable and does the job it's designed to do, and not written in a certain way "for performance reasons" (like "I'm not using properties, I heard they were slow" - that's not meant as a criticism btw, just an example of the sort of thing I hear). Optimise when performance is an issue, not when you think it might be.
Of course, this assumes the thing in question was sensibly designed in the first place. :)
Admin
<font face="Verdana" size="2"><font color="#000080">>>> As I already said, semantics. If you took what I posted to mean that there's somehow a flaw in the nature of identity columns that causes breaks in sequential numbering, then you must view the world in an extremely literal manner.</font> <<<
WTF???
How else was he supposed to read it? It's what you said. There was no ambiguity, or possibility of misinterpretation. I don't know anything about SQL Server, but I know that non-sequential identity columns are possible, so it was perfectly conceivable you meant exactly what you said.
-O
</font>
Admin
You are the wind beneath my wings. [:D]
Admin
Admin
(Cough)
London Ambulance Service
(Cough)
Admin
Wouldn't SELECT TOP 1 1 FROM Staff_DepartmentLink be more efficient than SELECT Count(*) and SELECT *
Admin
I love the fact that those most involved in this flame war don't sign in as anything other than "Anonymous'. Either grow a pair or shaddap.
Admin
If you use "SELECT TOP [N]", you must then have a way to figure out that there was something returned. This implies additional code, such as a "SELECT COUNT"(*) from a derived table (reverting right back to the original issue), or worse yet, using a temporary table to house the results of "SELECT TOP [N]", then doing the "SELECT COUNT(*)" on the temporary table. Lastly, you could return a useless recordset with your "SELECT TOP [N]" and check @@ROWCOUNT. This would qualify you for a "diamond award" for WTF's.
If you're checking existence to create the condition for an [IF/ELSE] block, there is _nothing_ more efficient than EXISTS(). EXISTS() will stop on the first row that satisifies the condition. Incidentally, depending upon your WHERE clause, using an explicit column name may actually harm the performance, as you may cause the optimizer to choose a poor plan because whatever index is most suitable for handling your WHERE criteria may not contain the referenced column. For some reason unknown, the data engine will actually add I/O to the query to fetch the referenced column. In this case, using "*" actually results in better performance, because only the index will need to be examined to satisfy the request, and the data page would not need to be touched.
Regards,
Mr. Angry DBA
Admin
We had a guy do this nonsensical crap in an app we were developing. Apparently it was "confusing" for him to generate HTML at the file level so he he generated it all in the SQL.
We fire him.
Admin
this is actually a good way to replace the .InnerHTML of a DIV block using some DHTML..
used mostly for dynamically querying a webservice after the page has rendered ..
a typical scenario is populating a dropdown based on the selection of another dropdown when it doesn;t make sense to cache everything in the page load or when your data is too volatile ..
http://www.codeguru.com/Csharp/Csharp/cs_webservices/tutorials/article.php/c7781/
http://www.15seconds.com/issue/040708.htm
quit your whining and get with the program, you noob ...
Admin
This argument is getting well past pointless. You are choosing to devote a lot of time and effort on a difference in semantics. I know what I meant, and you know what I meant. If you really need stuff to be that rigorously worded to avoid having a nervous breakdown, you would be much better off reading academic journals and not this, a humor website. I'm done with this argument and won't be replying to this thread again. Sorry to everyone else for encouraging this jerk.
Admin
This is what I meant to say :P
(Obligatory supporting story)
Did some quick one-shot tool some time ago. Used properties. Took too long. Used plain variables, took about 70% of the time. In that case it really helped.
Drak
Admin
Surely you jest. The best way to generate the HTML you need is using the same templating system as you did to generate the page, else you're opening yourself up for some major headaches.
Good example of making things up as you go along. :)
Admin
Looks to me like this guy just invented Microsoft reporting server before Microsoft did ...
http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/default.aspx
Admin
"templating system" ?
"making things up as you go along" ?
yeah .. you sure seem like you "know" what you're talking about as opposed to someone who talks out of their ass ...