|
buahahahahahaha that's good
|
|
|
|
|
hehe and I thought programmers are almost the most logically thinking people.
|
|
|
|
|
Logically Thinking -- True.
But sometimes, throws exceptions.
|
|
|
|
|
When I first starting programming in .NET I was fairly new to object-oriented programming. The first program I ever made for .NET had 2 classes that needed to communicate together. I accomplished this by creating a .dll in VB.NET that used implicit late-binding to call the methods in the other class. After a while I realized I could just pass a reference to the class it needs to communicate and it could call the methods directly. 2
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
The COM way first and the migrated to managed code?
|
|
|
|
|
You could have used sockets!
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Mark Salsbery wrote: You could have used sockets!
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I once worked with a guy who was writing a lot of the DAL code. When it was time to code review some of his stuff, we saw a lot of functions that made a query string, got a DataSet back, extracted the data from the DataSet and returned the extracted data. Basic stuff. However, there were no DataSets declared locally in any of those functions. 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!
Forehead slaps broke out around the room.
|
|
|
|
|
Sounds like he didn't need a DataSet at all; just a DataTable or a Collection of some Type populated with a DataReader.
I very rarely use a DataSet. It seems to me that the power of the DataSet is its ability to contain relationships between the DataTables it contains; so if I don't need those relationships, I don't need a DataSet. If you only need one DataTable, why construct a whole DataSet?
|
|
|
|
|
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!
|
|
|
|