|
You should add some object-oriented design.
Let us start with a HellType enumeration:
public enum HellType
{
Christian,
Muslim,
Chinese
}
Then we need an interface for the Hell:
public interface IHell
{
HellType HellType { get; }
}
Here, some methods should be declared for taking up, treating and removing sinners.
Perhaps we could also be interested in the Hell Staff (the devil and his helpers), a list of sinners already in hell, etc. Capacity is not a useful property, as it is always infinite.
Now we can come to a more important part: the HellFactory.
public class HellFactory
{
public IHell CreateHell(HellType hellType)
{
}
}
And here, theological problems arise. In all religions, there is only one instance of hell. Hence we must amend the interface with
IHell Instance { get; }
and also change our HellFactory
public IHell GetHell(HellType hellType)
{
}
We could also need a static constructor in some hells, as that hell does simply exist. Things become even worse when the only instance has to be created by the apprpriate god... To hell with such a hell!
|
|
|
|
|
And, as this is the hall of shame,
GOTO HELL;
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Do not believe in anything simply because you have heard it. Do not believe in anything simply because it is spoken and rumored by many. Do not believe in anything simply because it is found written in your religious books. Do not believe in anything merely on the authority of your teachers and elders. Do not believe in traditions because they have been handed down for many generations. But after observation and analysis, when you find that anything agrees with reason and is conducive to the good and benefit of one and all, then accept it and live up to it. The Buddha
|
|
|
|
|
On the subject of completelystupid programmers I one came accross this. Someone had told this idiot that literal cnstants (magic numbers) were "a bad thing", so the benighed fool hd produces a file containint the following:
#define ZERO 0
#define ONE 1
#define TWO 2
#define THREE 3
...
#define TEN_THOUSAND 10000
and included it in every source file.
And this is the absolute truth, no kidding.
|
|
|
|
|
While that is a coding horror, I would hate to read your code comments.
Adrian.Tawse wrote: completelystupid
Adrian.Tawse wrote: cnstants
Adrian.Tawse wrote: benighed
Adrian.Tawse wrote: hd
Adrian.Tawse wrote: containint
|
|
|
|
|
Give him a break... His profile says he is in the UK....
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
And after 4 years, that was the first time he's posted, so he's not yet aware of the abuse he'll receive for poor spelling.
|
|
|
|
|
Mea culpa, mea culpa, mea maxima culpa. I was wearing the wrong glasses.
And now for a new snippet:
A software package was being put together for release and a colleague remarked of one item "Oh God, not that pile of sh*t". I asked why and he said that it corrupted floppies. Now this was before the days when the FAT file system was build into Unix. The utility attempted to write Unix files to a DOS FAT floppy. It did this by opening the device in RAW mode and read and wrote whole sectors, including the FAT table. When transferring text files it would read a sector’s worth of data, scan for \n, shift everything up one, and insert \r. This, of course, would result in buffer overflow. What followed the buffer in memory? You guessed it, the FAT table, which was duly written back to the floppy at the end; it took about ten seconds to notice the problem. I went to the Team Leader to say “You cannot possibly ship this; I can fix it in minutes”. His reply was that they had had a summer student in ad it had taken him all summer to do that, and on no account was I to touch a line; it was to ship exactly as is. “It is OK when used with newly formatted floppies, and the file is not too big” I am not sure who I was more amazed with, the summer student or the Team Leader.
|
|
|
|
|
That is organisationally crap on so many levels.
Anna
Tech Blog | Visual Lint
"Why would anyone prefer to wield a weapon that takes both hands at once, when they could use a lighter (and obviously superior) weapon that allows you to wield multiple ones at a time, and thus supports multi-paradigm carnage?"
|
|
|
|
|
Worse things can be seen:
int ONE_HUNDRED = 100;
ONE_HUNDRED++;
|
|
|
|
|
If it's any consolation, I've seen FORTRAN compilers which which will allow the equivalent of the following:
public void inc(ref int i)
{
i *= 2;
}
...
Console.WriteLine(100);
inc(100);
Console.WriteLine(100);
... And would print:
100
200 And I had to find that in production code...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
LOOOOL!! This is me while reading your post:
Thanks for sharing such a pearl.
|
|
|
|
|
I have been a Contractor for 35 years. In that time I have been on about 40 or so projects most of which have been at least partial disasters. Some day I will write the whole gory details. I will make you belly laugh, then very very depressed.
|
|
|
|
|
<code>
public AssetInfo
{
....
public string CustAssID;
....
}
</code>
|
|
|
|
|
Well, errrr, some scientists say that each person's ass is unique, such as his/her fingerprint...
|
|
|
|
|
Imagine dusting for ass prints?
As an Atheist I am offended by any reference to religion.
I want all Muslims, Christians, Jews and [Insert fuller list of Religious Communities Here], to get the f*** off my planet and go live in space pixie land with the tooth fairy and the easter bunny. - DD
|
|
|
|
|
That might be the most appropriate ID name for a customer that I have ever seen.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
They were only saving 2 characters with the abbreviation, so you know what was really on their mind.
|
|
|
|
|
awesome name
you just enlighten me ,take a look at this name
public TitlesInfo
{
....
// Customer Title id.
public string CustTitsID;
....
}
well, some scientist said there are no same tits in this world, too ,they are all unique .
Today is a gift, that's why we call it present
|
|
|
|
|
that can be called as 'programming with tits n ass of customer'
lol
|
|
|
|
|
Reminds me of my utility class for accessing assembly attributes:
public class AssInfo
{
... stuff ...
}
|
|
|
|
|
damn! thats nice. Why do you post it here and not in "clever code" ??
regards
Torsten
I never finish anyth...
|
|
|
|
|
We worked with a third party application designed in France - all the database table names were French abbreviations or acronyms. The "Authorized List" table was called ASS. Imagine the SQL when we desired to create a new record in that table:
"INSERT INTO ASS ..."
|
|
|
|
|
Really a way to show performance improvement.
Version 1.0
for ( int i = 0; i < data.Count; i++ )
{
Thread.Sleep(200);
container.Add(data[i].Items);
}
Version 2.0
for ( int i = 0; i < data.Count; i++ )
{
Thread.Sleep(100);
container.Add(data[i].Items);
}
Version 3.0
for ( int i = 0; i < data.Count; i++ )
{
container.Add(data[i].Items);
}
Should I tell the boss?
|
|
|
|
|
I would if I was you: he should have used a foreach ...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|