|
Interesting approach that dll idea. I think we'll work on that
"You get that on the big jobs."
|
|
|
|
|
My company actually uses such an approach for a Form. The two Forms just happen to look the same.
Every Method looks a bit like this:
If m_screenMode = ScreenMode.ScreenOne Then
Else
End If
Fixing one mode almost always messes up the other one.
Adding Controls to the Form messes up the other one unless you do not forget to hide it etc...
It even got to a point where I had to change the name of the Form at runtime because of some other Classes that need a Formname as parameter...
Really horrible!
It's an OO world.
|
|
|
|
|
I have cleared such a mess here. They had all in one and methods with at least 1000 lines.
Total horror!
regards Torsten
I never finish anyth...
|
|
|
|
|
my current project rebuild that I inherited, has one page that has over 1000 lines of code in the page load. That's it, all in the page load....
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
A crisis on your part does not constitute one on mine.
|
|
|
|
|
I had to decipher code from a VB project like that once. It was an ungodly mess... Each form had about eight different possible modes (to use your terminology) which depended on a lot of things that happened when the form was loaded, and to top it off, each one had multiple steps, like a Wizard of some sort. Well, you had to be a real Wizard to understand that code. I guess I qualified?
My employer, which was not the perpetrator of that code, had been contacted to translate that VB mess into a Python-based script with a Web front end. The original "engineer" didn't have a lot of time to tell us how it all worked. We did it.
So you have my sympathies!
|
|
|
|
|
Yeah, I have seen that kind of stuff in legacy code. Really a pain to work with it.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Perfectly valid VB.NET syntax:
If If([If], IIf.[If]("If")) Then : End If
|
|
|
|
|
looks a bit ify to me
"You get that on the big jobs."
|
|
|
|
|
|
Someone once told me that "if" is the biggest word in the dictionary.
-----------------------------
Just along for the ride.
-----------------------------
|
|
|
|
|
If it depends on your definition of if is, then you are screwed.
Psychosis at 10
Film at 11
|
|
|
|
|
Ahhh, a Clinton supporter!
|
|
|
|
|
Finally, a language that doesn't put stupid restrictions on me!
|
|
|
|
|
You don't even want to know what you can do with JavaScript.
|
|
|
|
|
What.
The most iffy thing I've done is to recreate IIf for WP7, but man, that's just...
Don't forget to rate my post if it helped!
"He has no enemies, but is intensely disliked by his friends."
"His mother should have thrown him away, and kept the stork."
"There's nothing wrong with you that reincarnation won't cure."
"He loves nature, in spite of what it did to him."
|
|
|
|
|
|
The "intro message" on one of the new Futurama episodes tonight was:
Some ask "What if?"
We ask "Why if?"
|
|
|
|
|
Whenever I hear "what if", I think of The Time Machine ("you're a man haunted by those two most terrible words: what if").
|
|
|
|
|
Too funny. I just watched that on TV over the last weekend. My son was seeing it for the first time and as one proud, highly geeky dad I observed him riveted to the screen as he pondered the concepts of time travel.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Why Stop.... Carry on Ifs and Iffs ....... But no End If
|
|
|
|
|
and I didn't write it!
Just look at the code the OP posted...
Clickety!
First problem....the post is located in Javascript forum while the code is in vbscript!
"Whether you think you can, or you think you can't--either way, you are right." — Henry Ford
"When I waste my time, I only use the best, Code Project...don't leave home without it." — Slacker007
|
|
|
|
|
Anything which is still vulnerable to SQL injection is definitely deserving of a place in this forum.
|
|
|
|
|
Wow...... I would never hire someone who wrote code like that.
|
|
|
|
|
It starts off, OK (if you ignore the Data Access stuff inside the "Object Model", so it doesn't start OK, but OK is relative in our codebase):
public class FacultyDean
{
}
Nothing too contenious, unless you want to argue about the use of the word Faculty: all faculties have one dean, and all deans belong to 1..* Faculties so it is not necessary. I'd have called it Dean but there it is.
Here comes the complete listing for a subclass of FacultyDean :
public class NullFacultyDean : FacultyDean
{
public NullFacultyDean()
{
ID = -1;
}
}
A whole subclass for an uninitialised dean, what luxury! There is no flag to say that the Dean is null, so I'm not 100% sure what this is doing.
Oh and we have tens of classes like this all over:
public class DeanCollection : List<FacultyDean>
{
}
Again this is the full class, and 99% of them are uneccessary (Hurray! I Can't just remove theem en-masse, I have to check each!). Notice this time we have a DeanCollection rather than FacultyDeanCollection. Nice, consistent naming!
|
|
|
|
|
Keith Barrow wrote: public class DeanCollection : List<FacultyDean>
{
}
This could make sense if you are using reflection. Which I guess you are not.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|