|
It wasn't that he was or wasn't using a DataSet... he was using the same DataSet member variable for all of the queries run in the class. It's like declaring a class member variable i for all of the for loops that you're going to do in your class.
|
|
|
|
|
Yes, I understand that, but if he was concerned about the footprint and/or construction time of a DataSet, why create any at all?
|
|
|
|
|
PIEBALDconsult wrote: Sounds like he didn't need a DataSet at all
led mike
|
|
|
|
|
Was he in a way reinventing the wheel?
|
|
|
|
|
Is that a serious post... for real?
I now return to The daily WTF for all of my coding freak out needs.
|
|
|
|
|
scott_hackett wrote: Is that a serious post... for real?
Couldn't get you?
|
|
|
|
|
scott_hackett wrote: He had declared a private DataSet class member and used that in all of those functions. The reason... it was too inefficient to declare them locally when you could do it once at the top of the class!
This clearly is a 'code smell'. The state of an object should not be littered with local states. This kind of private members often need to be reset when the function starts - a constant source for bugs. Most probably not even the claimed spreed improvement is true.
|
|
|
|
|
It's funny that this forum popped right when I needed it!
This is the only time I've ever "lifted" a smiley from CP and put it into a company email (Sorry Chris!), see if you can guess which one.
I got an email from my counterpart at one our other sites. He's asking what the impact is on our Tivoli database if he takes all the hardware out of a machine and drops it into another case. OK, fine. I told him nothing, so long as the mobo and hard drive gets moved over with the O/S intact.
Then I read a little farther down and he says that he's been told to replace the case on every Dell GX270 computer they have because "they don't look good"! Mind you, the machines do get a bit dusty in our environment, but nothing that would warrant this.
...Uhhhh... yeah... like we've got nothing better to do!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: This is the only time I've ever "lifted" a smiley from CP and put it into a company email (Sorry Chris!), see if you can guess which one.
Probably ?
|
|
|
|
|
You are correct!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: "they don't look good"
Someone should try suggesting that they look better after a few drinks.
led mike
|
|
|
|
|
I've recently had a somewhat similar experience in which certain people on the team I used to work with wanted to completely re-write an application because they wanted to use the intellisense feature of Visual Studio.
Apparently, for some people, there is no better use of a companies resources than changing aesthetics.
Phil
|
|
|
|
|
Hey, I also almost bought a new case. I, however, refrained from doing so when I learned the price of the case I had laid my eyes on.
However, my case is now printed neon red with neon green stripes and purple-metallic dots.
PRETTY!
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
I once inherited a WinForms app, .NET 1.1. The devs who made the app up until that point were comfortable with ASP, but didn't know jack about WinForms. I think it was their first experience with .NET.
They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false .
|
|
|
|
|
Josh Smith wrote: They needed to pass values between Forms. They decided to do it by putting the values into a hidden ComboBox, and passing a reference to the ComboBox between the Forms! Instead of just creating an ArrayList, they actually drag-dropped a ComboBox onto the MainForm and set the Visible property to false.
Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms.
|
|
|
|
|
Judah Himango wrote: Oh dear Lord...sounds like they didn't understand how to share data between classes, which indicates very little OO experience, let alone .NET WinForms.
Yep. It turns out that people will pass data between pages in ASP by putting them in hidden dropdowns (I was told this by an ASP guy, but can't verify that it's kosher). When the folks who made that WinForms app decided to use a ComboBox as their collection of choice, they must have never considered that there just might be better ways to go about it!
|
|
|
|
|
Sob!
However, if we're talking about pure ASP, in high school I just used sessions to grant persistency between pages. Dunno if this can be done in .NET, i'm not into it
|
|
|
|
|
Jeez! They shared a ComboBox, so what's so hard about the data in it!?!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I saw an equivalnet at a client site ages ago where the main form had several hundred labels on the bottom, each with "Visible=False".
Turned out the dev was using them as "variables that have a change event"
|
|
|
|
|
I came across something similar when I was hired at my current company. I was porting a VB.NET application to C# and noticed that the original developer was using DataGrids as business logic class members to hold data. I guess he wasn't familiar with the System.Data namespace.
|
|
|
|
|
Let me start with one of my own from my days when I either didn't understand or didn't trust VBScript
Function TestBit(Value, Bit)
TestBit = ((CLng(Value) And CLng(Bit)) > 0)
End Function
All I'll say is that I was young and foolish.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: didn't understand
Most likely since I've seen this code in C, C#, VB...
|
|
|
|
|
Chris Maunder wrote: didn't trust VBScript
Can hardly blame you there... damn context-sensitive "and"s...
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
That reminds me of a previous boss who made us initialize all C++ pointers to null TWICE (just to make sure)
|
|
|
|
|
"pointer = null; pointer = null;"?
Well... very interesting. However, I suppose it doesn't make the problem solved.
I would rather use:
"while (pointer != null) pointer = null;"
|
|
|
|